clawbot-estree 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ * @format
9
+ */
10
+ 'use strict';
11
+
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+
16
+ var _predicates = require("./predicates");
17
+
18
+ Object.keys(_predicates).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _predicates[key]) return;
21
+ exports[key] = _predicates[key];
22
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ export type * from './selectors';
14
+ export type * from './types';
15
+ export * from './predicates';
@@ -0,0 +1,250 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+ 'use strict';
10
+ /*::
11
+ import type {
12
+ ESNode,
13
+ Token,
14
+ MostTokens,
15
+ BlockComment,
16
+ LineComment,
17
+ AFunction,
18
+ PropertyDefinition,
19
+ PropertyDefinitionWithNonComputedName,
20
+ MethodDefinition,
21
+ MethodDefinitionConstructor,
22
+ MethodDefinitionWithNonComputedName,
23
+ MemberExpression,
24
+ MemberExpressionWithNonComputedName,
25
+ ObjectPropertyWithShorthandStaticName,
26
+ ObjectPropertyWithNonShorthandStaticName,
27
+ DestructuringObjectPropertyWithShorthandStaticName,
28
+ DestructuringObjectPropertyWithNonShorthandStaticName,
29
+ ClassMember,
30
+ ClassDeclaration,
31
+ ClassExpression,
32
+ Literal,
33
+ BigIntLiteral,
34
+ BooleanLiteral,
35
+ NullLiteral,
36
+ NumericLiteral,
37
+ RegExpLiteral,
38
+ StringLiteral,
39
+ Identifier,
40
+ EnumDefaultedMember,
41
+ Expression,
42
+ Statement,
43
+ } from './types';
44
+ */
45
+
46
+ Object.defineProperty(exports, "__esModule", {
47
+ value: true
48
+ });
49
+ var _exportNames = {
50
+ isClass: true,
51
+ isPropertyDefinitionWithNonComputedName: true,
52
+ isClassMember: true,
53
+ isClassMemberWithNonComputedName: true,
54
+ isComment: true,
55
+ isFunction: true,
56
+ isMethodDefinitionWithNonComputedName: true,
57
+ isMemberExpressionWithNonComputedProperty: true,
58
+ isOptionalMemberExpressionWithNonComputedProperty: true,
59
+ isObjectPropertyWithShorthand: true,
60
+ isObjectPropertyWithNonComputedName: true,
61
+ isBigIntLiteral: true,
62
+ isBooleanLiteral: true,
63
+ isNullLiteral: true,
64
+ isNumericLiteral: true,
65
+ isRegExpLiteral: true,
66
+ isStringLiteral: true,
67
+ isExpression: true,
68
+ isStatement: true
69
+ };
70
+ exports.isBigIntLiteral = isBigIntLiteral;
71
+ exports.isBooleanLiteral = isBooleanLiteral;
72
+ exports.isClass = isClass;
73
+ exports.isClassMember = isClassMember;
74
+ exports.isClassMemberWithNonComputedName = isClassMemberWithNonComputedName;
75
+ exports.isComment = isComment;
76
+ exports.isExpression = isExpression;
77
+ exports.isFunction = isFunction;
78
+ exports.isMemberExpressionWithNonComputedProperty = isMemberExpressionWithNonComputedProperty;
79
+ exports.isMethodDefinitionWithNonComputedName = isMethodDefinitionWithNonComputedName;
80
+ exports.isNullLiteral = isNullLiteral;
81
+ exports.isNumericLiteral = isNumericLiteral;
82
+ exports.isObjectPropertyWithNonComputedName = isObjectPropertyWithNonComputedName;
83
+ exports.isObjectPropertyWithShorthand = isObjectPropertyWithShorthand;
84
+ exports.isOptionalMemberExpressionWithNonComputedProperty = isOptionalMemberExpressionWithNonComputedProperty;
85
+ exports.isPropertyDefinitionWithNonComputedName = isPropertyDefinitionWithNonComputedName;
86
+ exports.isRegExpLiteral = isRegExpLiteral;
87
+ exports.isStatement = isStatement;
88
+ exports.isStringLiteral = isStringLiteral;
89
+
90
+ var _predicates = require("./generated/predicates");
91
+
92
+ Object.keys(_predicates).forEach(function (key) {
93
+ if (key === "default" || key === "__esModule") return;
94
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
95
+ if (key in exports && exports[key] === _predicates[key]) return;
96
+ exports[key] = _predicates[key];
97
+ });
98
+
99
+ function isClass(node
100
+ /*: ESNode */
101
+ )
102
+ /*: implies node is (ClassDeclaration | ClassExpression) */
103
+ {
104
+ return node.type === 'ClassDeclaration' || node.type === 'ClassExpression';
105
+ }
106
+
107
+ function isPropertyDefinitionWithNonComputedName(node
108
+ /*: ESNode */
109
+ )
110
+ /*: implies node is PropertyDefinitionWithNonComputedName */
111
+ {
112
+ return node.type === 'PropertyDefinition' && node.computed === false;
113
+ }
114
+
115
+ function isClassMember(node
116
+ /*: ESNode */
117
+ )
118
+ /*: implies node is ClassMember */
119
+ {
120
+ return node.type === 'PropertyDefinition' || node.type === 'MethodDefinition';
121
+ }
122
+
123
+ function isClassMemberWithNonComputedName(node
124
+ /*: ESNode */
125
+ )
126
+ /*: implies node is (PropertyDefinitionWithNonComputedName | MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */
127
+ {
128
+ return (node.type === 'PropertyDefinition' || node.type === 'MethodDefinition') && node.computed === false;
129
+ }
130
+
131
+ function isComment(node
132
+ /*: ESNode | Token */
133
+ )
134
+ /*: implies node is (MostTokens | BlockComment | LineComment) */
135
+ {
136
+ return node.type === 'Block' || node.type === 'Line';
137
+ }
138
+
139
+ function isFunction(node
140
+ /*: ESNode */
141
+ )
142
+ /*: implies node is AFunction */
143
+ {
144
+ return node.type === 'ArrowFunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression';
145
+ }
146
+
147
+ function isMethodDefinitionWithNonComputedName(node
148
+ /*: ESNode */
149
+ )
150
+ /*: implies node is (MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */
151
+ {
152
+ return node.type === 'MethodDefinition' && node.computed === false;
153
+ }
154
+
155
+ function isMemberExpressionWithNonComputedProperty(node
156
+ /*: ESNode */
157
+ )
158
+ /*: implies node is MemberExpressionWithNonComputedName */
159
+ {
160
+ return node.type === 'MemberExpression' && node.computed === false;
161
+ }
162
+
163
+ function isOptionalMemberExpressionWithNonComputedProperty(node
164
+ /*: ESNode */
165
+ )
166
+ /*: implies node is MemberExpressionWithNonComputedName */
167
+ {
168
+ return node.type === 'MemberExpression' && node.computed === false;
169
+ }
170
+
171
+ function isObjectPropertyWithShorthand(node
172
+ /*: ESNode */
173
+ )
174
+ /*: implies node is (ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */
175
+ {
176
+ return node.type === 'Property' && node.shorthand === true;
177
+ }
178
+
179
+ function isObjectPropertyWithNonComputedName(node
180
+ /*: ESNode */
181
+ )
182
+ /*: implies node is (ObjectPropertyWithNonShorthandStaticName | ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithNonShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */
183
+ {
184
+ return node.type === 'Property' && node.computed === false;
185
+ }
186
+
187
+ function isBigIntLiteral(node
188
+ /*: ESNode */
189
+ )
190
+ /*: implies node is BigIntLiteral */
191
+ {
192
+ return node.type === 'Literal' && node.literalType === 'bigint';
193
+ }
194
+
195
+ function isBooleanLiteral(node
196
+ /*: ESNode */
197
+ )
198
+ /*: implies node is BooleanLiteral */
199
+ {
200
+ return node.type === 'Literal' && node.literalType === 'boolean';
201
+ }
202
+
203
+ function isNullLiteral(node
204
+ /*: ESNode */
205
+ )
206
+ /*: implies node is NullLiteral */
207
+ {
208
+ return node.type === 'Literal' && node.literalType === 'null';
209
+ }
210
+
211
+ function isNumericLiteral(node
212
+ /*: ESNode */
213
+ )
214
+ /*: implies node is NumericLiteral */
215
+ {
216
+ return node.type === 'Literal' && node.literalType === 'numeric';
217
+ }
218
+
219
+ function isRegExpLiteral(node
220
+ /*: ESNode */
221
+ )
222
+ /*: implies node is RegExpLiteral */
223
+ {
224
+ return node.type === 'Literal' && node.literalType === 'regexp';
225
+ }
226
+
227
+ function isStringLiteral(node
228
+ /*: ESNode */
229
+ )
230
+ /*: implies node is StringLiteral */
231
+ {
232
+ return node.type === 'Literal' && node.literalType === 'string';
233
+ }
234
+
235
+ function isExpression(node
236
+ /*: ESNode */
237
+ )
238
+ /*: implies node is Expression */
239
+ {
240
+ return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || node.type === 'ObjectExpression' || // $FlowFixMe[incompatible-type]
241
+ node.type === 'ObjectExpression' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression' || node.type === 'YieldExpression' || node.type === 'Literal' || node.type === 'UnaryExpression' || node.type === 'UpdateExpression' || node.type === 'BinaryExpression' || node.type === 'AssignmentExpression' || node.type === 'LogicalExpression' || node.type === 'MemberExpression' || node.type === 'ConditionalExpression' || node.type === 'CallExpression' || node.type === 'NewExpression' || node.type === 'SequenceExpression' || node.type === 'TemplateLiteral' || node.type === 'TaggedTemplateExpression' || node.type === 'ClassExpression' || node.type === 'MetaProperty' || node.type === 'Identifier' || node.type === 'AwaitExpression' || node.type === 'ImportExpression' || node.type === 'ChainExpression' || node.type === 'TypeCastExpression' || node.type === 'AsExpression' || node.type === 'AsConstExpression' || node.type === 'JSXFragment' || node.type === 'JSXElement';
242
+ }
243
+
244
+ function isStatement(node
245
+ /*: ESNode */
246
+ )
247
+ /*: implies node is Statement */
248
+ {
249
+ return node.type === 'BlockStatement' || node.type === 'BreakStatement' || node.type === 'ClassDeclaration' || node.type === 'ContinueStatement' || node.type === 'DebuggerStatement' || node.type === 'DeclareClass' || node.type === 'DeclareVariable' || node.type === 'DeclareFunction' || node.type === 'DeclareInterface' || node.type === 'DeclareModule' || node.type === 'DeclareOpaqueType' || node.type === 'DeclareTypeAlias' || node.type === 'DoWhileStatement' || node.type === 'EmptyStatement' || node.type === 'EnumDeclaration' || node.type === 'ExpressionStatement' || node.type === 'ForInStatement' || node.type === 'ForOfStatement' || node.type === 'ForStatement' || node.type === 'FunctionDeclaration' || node.type === 'IfStatement' || node.type === 'InterfaceDeclaration' || node.type === 'LabeledStatement' || node.type === 'OpaqueType' || node.type === 'ReturnStatement' || node.type === 'SwitchStatement' || node.type === 'ThrowStatement' || node.type === 'TryStatement' || node.type === 'TypeAlias' || node.type === 'VariableDeclaration' || node.type === 'WhileStatement' || node.type === 'WithStatement';
250
+ }
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ /*::
13
+ import type {
14
+ ESNode,
15
+ Token,
16
+ MostTokens,
17
+ BlockComment,
18
+ LineComment,
19
+ AFunction,
20
+ PropertyDefinition,
21
+ PropertyDefinitionWithNonComputedName,
22
+ MethodDefinition,
23
+ MethodDefinitionConstructor,
24
+ MethodDefinitionWithNonComputedName,
25
+ MemberExpression,
26
+ MemberExpressionWithNonComputedName,
27
+ ObjectPropertyWithShorthandStaticName,
28
+ ObjectPropertyWithNonShorthandStaticName,
29
+ DestructuringObjectPropertyWithShorthandStaticName,
30
+ DestructuringObjectPropertyWithNonShorthandStaticName,
31
+ ClassMember,
32
+ ClassDeclaration,
33
+ ClassExpression,
34
+ Literal,
35
+ BigIntLiteral,
36
+ BooleanLiteral,
37
+ NullLiteral,
38
+ NumericLiteral,
39
+ RegExpLiteral,
40
+ StringLiteral,
41
+ Identifier,
42
+ EnumDefaultedMember,
43
+ Expression,
44
+ Statement,
45
+ } from './types';
46
+ */
47
+
48
+ export * from './generated/predicates';
49
+
50
+ export function isClass(node /*: ESNode */) /*: implies node is (ClassDeclaration | ClassExpression) */ {
51
+ return node.type === 'ClassDeclaration' || node.type === 'ClassExpression';
52
+ }
53
+
54
+ export function isPropertyDefinitionWithNonComputedName(
55
+ node /*: ESNode */,
56
+ ) /*: implies node is PropertyDefinitionWithNonComputedName */ {
57
+ return node.type === 'PropertyDefinition' && node.computed === false;
58
+ }
59
+
60
+ export function isClassMember(node /*: ESNode */) /*: implies node is ClassMember */ {
61
+ return node.type === 'PropertyDefinition' || node.type === 'MethodDefinition';
62
+ }
63
+
64
+ export function isClassMemberWithNonComputedName(
65
+ node /*: ESNode */,
66
+ ) /*: implies node is (PropertyDefinitionWithNonComputedName | MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */ {
67
+ return (node.type === 'PropertyDefinition' || node.type === 'MethodDefinition') && node.computed === false;
68
+ }
69
+
70
+ export function isComment(node /*: ESNode | Token */) /*: implies node is (MostTokens | BlockComment | LineComment) */ {
71
+ return node.type === 'Block' || node.type === 'Line';
72
+ }
73
+
74
+ export function isFunction(node /*: ESNode */) /*: implies node is AFunction */ {
75
+ return (
76
+ node.type === 'ArrowFunctionExpression' ||
77
+ node.type === 'FunctionDeclaration' ||
78
+ node.type === 'FunctionExpression'
79
+ );
80
+ }
81
+
82
+ export function isMethodDefinitionWithNonComputedName(
83
+ node /*: ESNode */,
84
+ ) /*: implies node is (MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */ {
85
+ return node.type === 'MethodDefinition' && node.computed === false;
86
+ }
87
+
88
+ export function isMemberExpressionWithNonComputedProperty(
89
+ node /*: ESNode */,
90
+ ) /*: implies node is MemberExpressionWithNonComputedName */ {
91
+ return node.type === 'MemberExpression' && node.computed === false;
92
+ }
93
+
94
+ export function isOptionalMemberExpressionWithNonComputedProperty(
95
+ node /*: ESNode */,
96
+ ) /*: implies node is MemberExpressionWithNonComputedName */ {
97
+ return node.type === 'MemberExpression' && node.computed === false;
98
+ }
99
+
100
+ export function isObjectPropertyWithShorthand(node /*: ESNode */) /*: implies node is (ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */ {
101
+ return node.type === 'Property' && node.shorthand === true;
102
+ }
103
+
104
+ export function isObjectPropertyWithNonComputedName(node /*: ESNode */) /*: implies node is (ObjectPropertyWithNonShorthandStaticName | ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithNonShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */ {
105
+ return node.type === 'Property' && node.computed === false;
106
+ }
107
+
108
+ export function isBigIntLiteral(node /*: ESNode */) /*: implies node is BigIntLiteral */ {
109
+ return node.type === 'Literal' && node.literalType === 'bigint';
110
+ }
111
+
112
+ export function isBooleanLiteral(node /*: ESNode */) /*: implies node is BooleanLiteral */ {
113
+ return node.type === 'Literal' && node.literalType === 'boolean';
114
+ }
115
+
116
+ export function isNullLiteral(node /*: ESNode */) /*: implies node is NullLiteral */ {
117
+ return node.type === 'Literal' && node.literalType === 'null';
118
+ }
119
+
120
+ export function isNumericLiteral(node /*: ESNode */) /*: implies node is NumericLiteral */ {
121
+ return node.type === 'Literal' && node.literalType === 'numeric';
122
+ }
123
+
124
+ export function isRegExpLiteral(node /*: ESNode */) /*: implies node is RegExpLiteral */ {
125
+ return node.type === 'Literal' && node.literalType === 'regexp';
126
+ }
127
+
128
+ export function isStringLiteral(node /*: ESNode */) /*: implies node is StringLiteral */ {
129
+ return node.type === 'Literal' && node.literalType === 'string';
130
+ }
131
+
132
+ export function isExpression(node /*: ESNode */) /*: implies node is Expression */ {
133
+ return (
134
+ node.type === 'ThisExpression' ||
135
+ node.type === 'ArrayExpression' ||
136
+ node.type === 'ObjectExpression' ||
137
+ // $FlowFixMe[incompatible-type]
138
+ node.type === 'ObjectExpression' ||
139
+ node.type === 'FunctionExpression' ||
140
+ node.type === 'ArrowFunctionExpression' ||
141
+ node.type === 'YieldExpression' ||
142
+ node.type === 'Literal' ||
143
+ node.type === 'UnaryExpression' ||
144
+ node.type === 'UpdateExpression' ||
145
+ node.type === 'BinaryExpression' ||
146
+ node.type === 'AssignmentExpression' ||
147
+ node.type === 'LogicalExpression' ||
148
+ node.type === 'MemberExpression' ||
149
+ node.type === 'ConditionalExpression' ||
150
+ node.type === 'CallExpression' ||
151
+ node.type === 'NewExpression' ||
152
+ node.type === 'SequenceExpression' ||
153
+ node.type === 'TemplateLiteral' ||
154
+ node.type === 'TaggedTemplateExpression' ||
155
+ node.type === 'ClassExpression' ||
156
+ node.type === 'MetaProperty' ||
157
+ node.type === 'Identifier' ||
158
+ node.type === 'AwaitExpression' ||
159
+ node.type === 'ImportExpression' ||
160
+ node.type === 'ChainExpression' ||
161
+ node.type === 'TypeCastExpression' ||
162
+ node.type === 'AsExpression' ||
163
+ node.type === 'AsConstExpression' ||
164
+ node.type === 'JSXFragment' ||
165
+ node.type === 'JSXElement'
166
+ );
167
+ }
168
+
169
+ export function isStatement(node /*: ESNode */) /*: implies node is Statement */ {
170
+ return (
171
+ node.type === 'BlockStatement' ||
172
+ node.type === 'BreakStatement' ||
173
+ node.type === 'ClassDeclaration' ||
174
+ node.type === 'ContinueStatement' ||
175
+ node.type === 'DebuggerStatement' ||
176
+ node.type === 'DeclareClass' ||
177
+ node.type === 'DeclareVariable' ||
178
+ node.type === 'DeclareFunction' ||
179
+ node.type === 'DeclareInterface' ||
180
+ node.type === 'DeclareModule' ||
181
+ node.type === 'DeclareOpaqueType' ||
182
+ node.type === 'DeclareTypeAlias' ||
183
+ node.type === 'DoWhileStatement' ||
184
+ node.type === 'EmptyStatement' ||
185
+ node.type === 'EnumDeclaration' ||
186
+ node.type === 'ExpressionStatement' ||
187
+ node.type === 'ForInStatement' ||
188
+ node.type === 'ForOfStatement' ||
189
+ node.type === 'ForStatement' ||
190
+ node.type === 'FunctionDeclaration' ||
191
+ node.type === 'IfStatement' ||
192
+ node.type === 'InterfaceDeclaration' ||
193
+ node.type === 'LabeledStatement' ||
194
+ node.type === 'OpaqueType' ||
195
+ node.type === 'ReturnStatement' ||
196
+ node.type === 'SwitchStatement' ||
197
+ node.type === 'ThrowStatement' ||
198
+ node.type === 'TryStatement' ||
199
+ node.type === 'TypeAlias' ||
200
+ node.type === 'VariableDeclaration' ||
201
+ node.type === 'WhileStatement' ||
202
+ node.type === 'WithStatement'
203
+ );
204
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ * @format
9
+ */
10
+ 'use strict';
11
+
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import type {ESQueryNodeSelectorsWithoutFallback} from './generated/clawbotESTreeSelectorTypes';
14
+
15
+ export type ESQueryNodeSelectors = {
16
+ ...ESQueryNodeSelectorsWithoutFallback,
17
+
18
+ // We want to allow consumers to manually type their weird selectors.
19
+ // If we use the \`ESNode\` type here then flow will error on cases like this:
20
+ // 'FunctionDeclaration[id="foo"]'(node: FunctionDeclaration) {...}
21
+ // But this sucks as it means someone would then have to manually do an \`if\`
22
+ // check inside the selector body.
23
+ +[selector: string]: (node: $FlowFixMe) => void,
24
+ };
25
+
26
+ export type {ESQueryNodeSelectorsWithoutFallback} from './generated/clawbotESTreeSelectorTypes';
27
+
28
+ export {};
package/dist/types.js ADDED
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ * @format
9
+ */
10
+ 'use strict';
11
+ /**
12
+ *
13
+ * IMPORTANT NOTE
14
+ *
15
+ * This file intentionally uses interfaces and `+` for readonly.
16
+ *
17
+ * - `$ReadOnly` is an "evaluated" utility type in flow; meaning that flow does
18
+ * not actually calculate the resulting type until it is used. This creates
19
+ * a copy of the type at each usage site - ballooning memory and processing
20
+ * times.
21
+ * Usually this isn't a problem as a type might only be used one or two times
22
+ * - but in this giant circular-referencing graph that is the AST types, this
23
+ * causes check times for consumers to be awful.
24
+ *
25
+ * Thus instead we manually annotate properties with `+` to avoid the `$ReadOnly` type.
26
+ *
27
+ * - `...Type` spreads do not preserve the readonly-ness of the properties. If
28
+ * we used object literal types then we would have to `$ReadOnly` all spreads
29
+ * (see point 1). On the other hand extending an interface does preserve
30
+ * readonlyness of properties.
31
+ *
32
+ * Thus instead of object literals, we use interfaces.
33
+ *
34
+ *** Please ensure all properties are marked as readonly! ***
35
+ */
36
+
37
+ Object.defineProperty(exports, "__esModule", {
38
+ value: true
39
+ });