hermes-estree 0.32.0 → 0.33.0
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/generated/HermesESTreeSelectorTypes.js.flow +262 -27
- package/dist/generated/predicates.js +120 -0
- package/dist/generated/predicates.js.flow +72 -0
- package/dist/predicates.js +2 -3
- package/dist/predicates.js.flow +5 -3
- package/dist/src/generated/predicates.js +120 -0
- package/dist/src/predicates.js +2 -3
- package/dist/types.js.flow +103 -11
- package/package.json +1 -1
|
@@ -139,6 +139,8 @@ import type {
|
|
|
139
139
|
MatchExpression,
|
|
140
140
|
MatchExpressionCase,
|
|
141
141
|
MatchIdentifierPattern,
|
|
142
|
+
MatchInstanceObjectPattern,
|
|
143
|
+
MatchInstancePattern,
|
|
142
144
|
MatchLiteralPattern,
|
|
143
145
|
MatchMemberPattern,
|
|
144
146
|
MatchObjectPattern,
|
|
@@ -153,6 +155,7 @@ import type {
|
|
|
153
155
|
MetaProperty,
|
|
154
156
|
MethodDefinition,
|
|
155
157
|
MixedTypeAnnotation,
|
|
158
|
+
NeverTypeAnnotation,
|
|
156
159
|
NewExpression,
|
|
157
160
|
NullableTypeAnnotation,
|
|
158
161
|
NullLiteralTypeAnnotation,
|
|
@@ -175,6 +178,13 @@ import type {
|
|
|
175
178
|
PropertyDefinition,
|
|
176
179
|
QualifiedTypeIdentifier,
|
|
177
180
|
QualifiedTypeofIdentifier,
|
|
181
|
+
RecordDeclaration,
|
|
182
|
+
RecordDeclarationBody,
|
|
183
|
+
RecordDeclarationImplements,
|
|
184
|
+
RecordDeclarationProperty,
|
|
185
|
+
RecordDeclarationStaticProperty,
|
|
186
|
+
RecordExpression,
|
|
187
|
+
RecordExpressionProperties,
|
|
178
188
|
RestElement,
|
|
179
189
|
ReturnStatement,
|
|
180
190
|
SequenceExpression,
|
|
@@ -206,7 +216,9 @@ import type {
|
|
|
206
216
|
TypeParameterInstantiation,
|
|
207
217
|
TypePredicate,
|
|
208
218
|
UnaryExpression,
|
|
219
|
+
UndefinedTypeAnnotation,
|
|
209
220
|
UnionTypeAnnotation,
|
|
221
|
+
UnknownTypeAnnotation,
|
|
210
222
|
UpdateExpression,
|
|
211
223
|
VariableDeclaration,
|
|
212
224
|
VariableDeclarator,
|
|
@@ -233,9 +245,6 @@ interface ArrayPattern_With_typeAnnotation extends ArrayPattern {
|
|
|
233
245
|
interface ArrayTypeAnnotation_With_elementType extends ArrayTypeAnnotation {
|
|
234
246
|
+elementType: $NonMaybeType<ArrayTypeAnnotation['elementType']>;
|
|
235
247
|
}
|
|
236
|
-
interface ArrowFunctionExpression_With_id extends ArrowFunctionExpression {
|
|
237
|
-
+id: $NonMaybeType<ArrowFunctionExpression['id']>;
|
|
238
|
-
}
|
|
239
248
|
interface ArrowFunctionExpression_With_params extends ArrowFunctionExpression {
|
|
240
249
|
+params: $NonMaybeType<ArrowFunctionExpression['params']>;
|
|
241
250
|
}
|
|
@@ -348,8 +357,8 @@ interface ClassDeclaration_With_typeParameters extends ClassDeclaration {
|
|
|
348
357
|
interface ClassDeclaration_With_superClass extends ClassDeclaration {
|
|
349
358
|
+superClass: $NonMaybeType<ClassDeclaration['superClass']>;
|
|
350
359
|
}
|
|
351
|
-
interface
|
|
352
|
-
+
|
|
360
|
+
interface ClassDeclaration_With_superTypeArguments extends ClassDeclaration {
|
|
361
|
+
+superTypeArguments: $NonMaybeType<ClassDeclaration['superTypeArguments']>;
|
|
353
362
|
}
|
|
354
363
|
interface ClassDeclaration_With_implements extends ClassDeclaration {
|
|
355
364
|
+implements: $NonMaybeType<ClassDeclaration['implements']>;
|
|
@@ -369,8 +378,8 @@ interface ClassExpression_With_typeParameters extends ClassExpression {
|
|
|
369
378
|
interface ClassExpression_With_superClass extends ClassExpression {
|
|
370
379
|
+superClass: $NonMaybeType<ClassExpression['superClass']>;
|
|
371
380
|
}
|
|
372
|
-
interface
|
|
373
|
-
+
|
|
381
|
+
interface ClassExpression_With_superTypeArguments extends ClassExpression {
|
|
382
|
+
+superTypeArguments: $NonMaybeType<ClassExpression['superTypeArguments']>;
|
|
374
383
|
}
|
|
375
384
|
interface ClassExpression_With_implements extends ClassExpression {
|
|
376
385
|
+implements: $NonMaybeType<ClassExpression['implements']>;
|
|
@@ -1077,6 +1086,21 @@ interface MatchExpressionCase_With_guard extends MatchExpressionCase {
|
|
|
1077
1086
|
interface MatchIdentifierPattern_With_id extends MatchIdentifierPattern {
|
|
1078
1087
|
+id: $NonMaybeType<MatchIdentifierPattern['id']>;
|
|
1079
1088
|
}
|
|
1089
|
+
interface MatchInstanceObjectPattern_With_properties
|
|
1090
|
+
extends MatchInstanceObjectPattern {
|
|
1091
|
+
+properties: $NonMaybeType<MatchInstanceObjectPattern['properties']>;
|
|
1092
|
+
}
|
|
1093
|
+
interface MatchInstanceObjectPattern_With_rest
|
|
1094
|
+
extends MatchInstanceObjectPattern {
|
|
1095
|
+
+rest: $NonMaybeType<MatchInstanceObjectPattern['rest']>;
|
|
1096
|
+
}
|
|
1097
|
+
interface MatchInstancePattern_With_targetConstructor
|
|
1098
|
+
extends MatchInstancePattern {
|
|
1099
|
+
+targetConstructor: $NonMaybeType<MatchInstancePattern['targetConstructor']>;
|
|
1100
|
+
}
|
|
1101
|
+
interface MatchInstancePattern_With_properties extends MatchInstancePattern {
|
|
1102
|
+
+properties: $NonMaybeType<MatchInstancePattern['properties']>;
|
|
1103
|
+
}
|
|
1080
1104
|
interface MatchLiteralPattern_With_literal extends MatchLiteralPattern {
|
|
1081
1105
|
+literal: $NonMaybeType<MatchLiteralPattern['literal']>;
|
|
1082
1106
|
}
|
|
@@ -1389,6 +1413,67 @@ interface QualifiedTypeofIdentifier_With_qualification
|
|
|
1389
1413
|
interface QualifiedTypeofIdentifier_With_id extends QualifiedTypeofIdentifier {
|
|
1390
1414
|
+id: $NonMaybeType<QualifiedTypeofIdentifier['id']>;
|
|
1391
1415
|
}
|
|
1416
|
+
interface RecordDeclaration_With_id extends RecordDeclaration {
|
|
1417
|
+
+id: $NonMaybeType<RecordDeclaration['id']>;
|
|
1418
|
+
}
|
|
1419
|
+
interface RecordDeclaration_With_typeParameters extends RecordDeclaration {
|
|
1420
|
+
+typeParameters: $NonMaybeType<RecordDeclaration['typeParameters']>;
|
|
1421
|
+
}
|
|
1422
|
+
interface RecordDeclaration_With_implements extends RecordDeclaration {
|
|
1423
|
+
+implements: $NonMaybeType<RecordDeclaration['implements']>;
|
|
1424
|
+
}
|
|
1425
|
+
interface RecordDeclaration_With_body extends RecordDeclaration {
|
|
1426
|
+
+body: $NonMaybeType<RecordDeclaration['body']>;
|
|
1427
|
+
}
|
|
1428
|
+
interface RecordDeclarationBody_With_elements extends RecordDeclarationBody {
|
|
1429
|
+
+elements: $NonMaybeType<RecordDeclarationBody['elements']>;
|
|
1430
|
+
}
|
|
1431
|
+
interface RecordDeclarationImplements_With_id
|
|
1432
|
+
extends RecordDeclarationImplements {
|
|
1433
|
+
+id: $NonMaybeType<RecordDeclarationImplements['id']>;
|
|
1434
|
+
}
|
|
1435
|
+
interface RecordDeclarationImplements_With_typeArguments
|
|
1436
|
+
extends RecordDeclarationImplements {
|
|
1437
|
+
+typeArguments: $NonMaybeType<RecordDeclarationImplements['typeArguments']>;
|
|
1438
|
+
}
|
|
1439
|
+
interface RecordDeclarationProperty_With_key extends RecordDeclarationProperty {
|
|
1440
|
+
+key: $NonMaybeType<RecordDeclarationProperty['key']>;
|
|
1441
|
+
}
|
|
1442
|
+
interface RecordDeclarationProperty_With_typeAnnotation
|
|
1443
|
+
extends RecordDeclarationProperty {
|
|
1444
|
+
+typeAnnotation: $NonMaybeType<RecordDeclarationProperty['typeAnnotation']>;
|
|
1445
|
+
}
|
|
1446
|
+
interface RecordDeclarationProperty_With_defaultValue
|
|
1447
|
+
extends RecordDeclarationProperty {
|
|
1448
|
+
+defaultValue: $NonMaybeType<RecordDeclarationProperty['defaultValue']>;
|
|
1449
|
+
}
|
|
1450
|
+
interface RecordDeclarationStaticProperty_With_key
|
|
1451
|
+
extends RecordDeclarationStaticProperty {
|
|
1452
|
+
+key: $NonMaybeType<RecordDeclarationStaticProperty['key']>;
|
|
1453
|
+
}
|
|
1454
|
+
interface RecordDeclarationStaticProperty_With_typeAnnotation
|
|
1455
|
+
extends RecordDeclarationStaticProperty {
|
|
1456
|
+
+typeAnnotation: $NonMaybeType<
|
|
1457
|
+
RecordDeclarationStaticProperty['typeAnnotation'],
|
|
1458
|
+
>;
|
|
1459
|
+
}
|
|
1460
|
+
interface RecordDeclarationStaticProperty_With_value
|
|
1461
|
+
extends RecordDeclarationStaticProperty {
|
|
1462
|
+
+value: $NonMaybeType<RecordDeclarationStaticProperty['value']>;
|
|
1463
|
+
}
|
|
1464
|
+
interface RecordExpression_With_recordConstructor extends RecordExpression {
|
|
1465
|
+
+recordConstructor: $NonMaybeType<RecordExpression['recordConstructor']>;
|
|
1466
|
+
}
|
|
1467
|
+
interface RecordExpression_With_typeArguments extends RecordExpression {
|
|
1468
|
+
+typeArguments: $NonMaybeType<RecordExpression['typeArguments']>;
|
|
1469
|
+
}
|
|
1470
|
+
interface RecordExpression_With_properties extends RecordExpression {
|
|
1471
|
+
+properties: $NonMaybeType<RecordExpression['properties']>;
|
|
1472
|
+
}
|
|
1473
|
+
interface RecordExpressionProperties_With_properties
|
|
1474
|
+
extends RecordExpressionProperties {
|
|
1475
|
+
+properties: $NonMaybeType<RecordExpressionProperties['properties']>;
|
|
1476
|
+
}
|
|
1392
1477
|
interface RestElement_With_argument extends RestElement {
|
|
1393
1478
|
+argument: $NonMaybeType<RestElement['argument']>;
|
|
1394
1479
|
}
|
|
@@ -1457,8 +1542,8 @@ interface TryStatement_With_handler extends TryStatement {
|
|
|
1457
1542
|
interface TryStatement_With_finalizer extends TryStatement {
|
|
1458
1543
|
+finalizer: $NonMaybeType<TryStatement['finalizer']>;
|
|
1459
1544
|
}
|
|
1460
|
-
interface
|
|
1461
|
-
+
|
|
1545
|
+
interface TupleTypeAnnotation_With_elementTypes extends TupleTypeAnnotation {
|
|
1546
|
+
+elementTypes: $NonMaybeType<TupleTypeAnnotation['elementTypes']>;
|
|
1462
1547
|
}
|
|
1463
1548
|
interface TupleTypeAnnotation_With_inexact extends TupleTypeAnnotation {
|
|
1464
1549
|
+inexact: $NonMaybeType<TupleTypeAnnotation['inexact']>;
|
|
@@ -1638,6 +1723,7 @@ type DeclarationSpecialSelector =
|
|
|
1638
1723
|
| HookDeclaration
|
|
1639
1724
|
| ImportDeclaration
|
|
1640
1725
|
| InterfaceDeclaration
|
|
1726
|
+
| RecordDeclaration
|
|
1641
1727
|
| TypeParameterDeclaration
|
|
1642
1728
|
| VariableDeclaration;
|
|
1643
1729
|
type PatternSpecialSelector =
|
|
@@ -1647,6 +1733,8 @@ type PatternSpecialSelector =
|
|
|
1647
1733
|
| MatchAsPattern
|
|
1648
1734
|
| MatchBindingPattern
|
|
1649
1735
|
| MatchIdentifierPattern
|
|
1736
|
+
| MatchInstanceObjectPattern
|
|
1737
|
+
| MatchInstancePattern
|
|
1650
1738
|
| MatchLiteralPattern
|
|
1651
1739
|
| MatchMemberPattern
|
|
1652
1740
|
| MatchObjectPattern
|
|
@@ -1678,6 +1766,7 @@ type ExpressionSpecialSelector =
|
|
|
1678
1766
|
| MemberExpression
|
|
1679
1767
|
| NewExpression
|
|
1680
1768
|
| ObjectExpression
|
|
1769
|
+
| RecordExpression
|
|
1681
1770
|
| SequenceExpression
|
|
1682
1771
|
| TaggedTemplateExpression
|
|
1683
1772
|
| ThisExpression
|
|
@@ -1708,9 +1797,6 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1708
1797
|
node: ArrayTypeAnnotation_With_elementType,
|
|
1709
1798
|
) => void,
|
|
1710
1799
|
+ArrowFunctionExpression?: (node: ArrowFunctionExpression) => void,
|
|
1711
|
-
+'ArrowFunctionExpression[id]'?: (
|
|
1712
|
-
node: ArrowFunctionExpression_With_id,
|
|
1713
|
-
) => void,
|
|
1714
1800
|
+'ArrowFunctionExpression[params]'?: (
|
|
1715
1801
|
node: ArrowFunctionExpression_With_params,
|
|
1716
1802
|
) => void,
|
|
@@ -1803,8 +1889,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1803
1889
|
+'ClassDeclaration[superClass]'?: (
|
|
1804
1890
|
node: ClassDeclaration_With_superClass,
|
|
1805
1891
|
) => void,
|
|
1806
|
-
+'ClassDeclaration[
|
|
1807
|
-
node:
|
|
1892
|
+
+'ClassDeclaration[superTypeArguments]'?: (
|
|
1893
|
+
node: ClassDeclaration_With_superTypeArguments,
|
|
1808
1894
|
) => void,
|
|
1809
1895
|
+'ClassDeclaration[implements]'?: (
|
|
1810
1896
|
node: ClassDeclaration_With_implements,
|
|
@@ -1821,8 +1907,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1821
1907
|
+'ClassExpression[superClass]'?: (
|
|
1822
1908
|
node: ClassExpression_With_superClass,
|
|
1823
1909
|
) => void,
|
|
1824
|
-
+'ClassExpression[
|
|
1825
|
-
node:
|
|
1910
|
+
+'ClassExpression[superTypeArguments]'?: (
|
|
1911
|
+
node: ClassExpression_With_superTypeArguments,
|
|
1826
1912
|
) => void,
|
|
1827
1913
|
+'ClassExpression[implements]'?: (
|
|
1828
1914
|
node: ClassExpression_With_implements,
|
|
@@ -2380,6 +2466,20 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2380
2466
|
+'MatchIdentifierPattern[id]'?: (
|
|
2381
2467
|
node: MatchIdentifierPattern_With_id,
|
|
2382
2468
|
) => void,
|
|
2469
|
+
+MatchInstanceObjectPattern?: (node: MatchInstanceObjectPattern) => void,
|
|
2470
|
+
+'MatchInstanceObjectPattern[properties]'?: (
|
|
2471
|
+
node: MatchInstanceObjectPattern_With_properties,
|
|
2472
|
+
) => void,
|
|
2473
|
+
+'MatchInstanceObjectPattern[rest]'?: (
|
|
2474
|
+
node: MatchInstanceObjectPattern_With_rest,
|
|
2475
|
+
) => void,
|
|
2476
|
+
+MatchInstancePattern?: (node: MatchInstancePattern) => void,
|
|
2477
|
+
+'MatchInstancePattern[targetConstructor]'?: (
|
|
2478
|
+
node: MatchInstancePattern_With_targetConstructor,
|
|
2479
|
+
) => void,
|
|
2480
|
+
+'MatchInstancePattern[properties]'?: (
|
|
2481
|
+
node: MatchInstancePattern_With_properties,
|
|
2482
|
+
) => void,
|
|
2383
2483
|
+MatchLiteralPattern?: (node: MatchLiteralPattern) => void,
|
|
2384
2484
|
+'MatchLiteralPattern[literal]'?: (
|
|
2385
2485
|
node: MatchLiteralPattern_With_literal,
|
|
@@ -2447,6 +2547,7 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2447
2547
|
) => void,
|
|
2448
2548
|
+'MethodDefinition[static]'?: (node: MethodDefinition_With_static) => void,
|
|
2449
2549
|
+MixedTypeAnnotation?: (node: MixedTypeAnnotation) => void,
|
|
2550
|
+
+NeverTypeAnnotation?: (node: NeverTypeAnnotation) => void,
|
|
2450
2551
|
+NewExpression?: (node: NewExpression) => void,
|
|
2451
2552
|
+'NewExpression[callee]'?: (node: NewExpression_With_callee) => void,
|
|
2452
2553
|
+'NewExpression[typeArguments]'?: (
|
|
@@ -2630,6 +2731,62 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2630
2731
|
+'QualifiedTypeofIdentifier[id]'?: (
|
|
2631
2732
|
node: QualifiedTypeofIdentifier_With_id,
|
|
2632
2733
|
) => void,
|
|
2734
|
+
+RecordDeclaration?: (node: RecordDeclaration) => void,
|
|
2735
|
+
+'RecordDeclaration[id]'?: (node: RecordDeclaration_With_id) => void,
|
|
2736
|
+
+'RecordDeclaration[typeParameters]'?: (
|
|
2737
|
+
node: RecordDeclaration_With_typeParameters,
|
|
2738
|
+
) => void,
|
|
2739
|
+
+'RecordDeclaration[implements]'?: (
|
|
2740
|
+
node: RecordDeclaration_With_implements,
|
|
2741
|
+
) => void,
|
|
2742
|
+
+'RecordDeclaration[body]'?: (node: RecordDeclaration_With_body) => void,
|
|
2743
|
+
+RecordDeclarationBody?: (node: RecordDeclarationBody) => void,
|
|
2744
|
+
+'RecordDeclarationBody[elements]'?: (
|
|
2745
|
+
node: RecordDeclarationBody_With_elements,
|
|
2746
|
+
) => void,
|
|
2747
|
+
+RecordDeclarationImplements?: (node: RecordDeclarationImplements) => void,
|
|
2748
|
+
+'RecordDeclarationImplements[id]'?: (
|
|
2749
|
+
node: RecordDeclarationImplements_With_id,
|
|
2750
|
+
) => void,
|
|
2751
|
+
+'RecordDeclarationImplements[typeArguments]'?: (
|
|
2752
|
+
node: RecordDeclarationImplements_With_typeArguments,
|
|
2753
|
+
) => void,
|
|
2754
|
+
+RecordDeclarationProperty?: (node: RecordDeclarationProperty) => void,
|
|
2755
|
+
+'RecordDeclarationProperty[key]'?: (
|
|
2756
|
+
node: RecordDeclarationProperty_With_key,
|
|
2757
|
+
) => void,
|
|
2758
|
+
+'RecordDeclarationProperty[typeAnnotation]'?: (
|
|
2759
|
+
node: RecordDeclarationProperty_With_typeAnnotation,
|
|
2760
|
+
) => void,
|
|
2761
|
+
+'RecordDeclarationProperty[defaultValue]'?: (
|
|
2762
|
+
node: RecordDeclarationProperty_With_defaultValue,
|
|
2763
|
+
) => void,
|
|
2764
|
+
+RecordDeclarationStaticProperty?: (
|
|
2765
|
+
node: RecordDeclarationStaticProperty,
|
|
2766
|
+
) => void,
|
|
2767
|
+
+'RecordDeclarationStaticProperty[key]'?: (
|
|
2768
|
+
node: RecordDeclarationStaticProperty_With_key,
|
|
2769
|
+
) => void,
|
|
2770
|
+
+'RecordDeclarationStaticProperty[typeAnnotation]'?: (
|
|
2771
|
+
node: RecordDeclarationStaticProperty_With_typeAnnotation,
|
|
2772
|
+
) => void,
|
|
2773
|
+
+'RecordDeclarationStaticProperty[value]'?: (
|
|
2774
|
+
node: RecordDeclarationStaticProperty_With_value,
|
|
2775
|
+
) => void,
|
|
2776
|
+
+RecordExpression?: (node: RecordExpression) => void,
|
|
2777
|
+
+'RecordExpression[recordConstructor]'?: (
|
|
2778
|
+
node: RecordExpression_With_recordConstructor,
|
|
2779
|
+
) => void,
|
|
2780
|
+
+'RecordExpression[typeArguments]'?: (
|
|
2781
|
+
node: RecordExpression_With_typeArguments,
|
|
2782
|
+
) => void,
|
|
2783
|
+
+'RecordExpression[properties]'?: (
|
|
2784
|
+
node: RecordExpression_With_properties,
|
|
2785
|
+
) => void,
|
|
2786
|
+
+RecordExpressionProperties?: (node: RecordExpressionProperties) => void,
|
|
2787
|
+
+'RecordExpressionProperties[properties]'?: (
|
|
2788
|
+
node: RecordExpressionProperties_With_properties,
|
|
2789
|
+
) => void,
|
|
2633
2790
|
+RestElement?: (node: RestElement) => void,
|
|
2634
2791
|
+'RestElement[argument]'?: (node: RestElement_With_argument) => void,
|
|
2635
2792
|
+ReturnStatement?: (node: ReturnStatement) => void,
|
|
@@ -2685,8 +2842,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2685
2842
|
+'TryStatement[handler]'?: (node: TryStatement_With_handler) => void,
|
|
2686
2843
|
+'TryStatement[finalizer]'?: (node: TryStatement_With_finalizer) => void,
|
|
2687
2844
|
+TupleTypeAnnotation?: (node: TupleTypeAnnotation) => void,
|
|
2688
|
-
+'TupleTypeAnnotation[
|
|
2689
|
-
node:
|
|
2845
|
+
+'TupleTypeAnnotation[elementTypes]'?: (
|
|
2846
|
+
node: TupleTypeAnnotation_With_elementTypes,
|
|
2690
2847
|
) => void,
|
|
2691
2848
|
+'TupleTypeAnnotation[inexact]'?: (
|
|
2692
2849
|
node: TupleTypeAnnotation_With_inexact,
|
|
@@ -2767,10 +2924,12 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2767
2924
|
+'UnaryExpression[operator]'?: (node: UnaryExpression_With_operator) => void,
|
|
2768
2925
|
+'UnaryExpression[argument]'?: (node: UnaryExpression_With_argument) => void,
|
|
2769
2926
|
+'UnaryExpression[prefix]'?: (node: UnaryExpression_With_prefix) => void,
|
|
2927
|
+
+UndefinedTypeAnnotation?: (node: UndefinedTypeAnnotation) => void,
|
|
2770
2928
|
+UnionTypeAnnotation?: (node: UnionTypeAnnotation) => void,
|
|
2771
2929
|
+'UnionTypeAnnotation[types]'?: (
|
|
2772
2930
|
node: UnionTypeAnnotation_With_types,
|
|
2773
2931
|
) => void,
|
|
2932
|
+
+UnknownTypeAnnotation?: (node: UnknownTypeAnnotation) => void,
|
|
2774
2933
|
+UpdateExpression?: (node: UpdateExpression) => void,
|
|
2775
2934
|
+'UpdateExpression[operator]'?: (
|
|
2776
2935
|
node: UpdateExpression_With_operator,
|
|
@@ -2824,9 +2983,6 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2824
2983
|
node: ArrayTypeAnnotation_With_elementType,
|
|
2825
2984
|
) => void,
|
|
2826
2985
|
+'ArrowFunctionExpression:exit'?: (node: ArrowFunctionExpression) => void,
|
|
2827
|
-
+'ArrowFunctionExpression[id]:exit'?: (
|
|
2828
|
-
node: ArrowFunctionExpression_With_id,
|
|
2829
|
-
) => void,
|
|
2830
2986
|
+'ArrowFunctionExpression[params]:exit'?: (
|
|
2831
2987
|
node: ArrowFunctionExpression_With_params,
|
|
2832
2988
|
) => void,
|
|
@@ -2933,8 +3089,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2933
3089
|
+'ClassDeclaration[superClass]:exit'?: (
|
|
2934
3090
|
node: ClassDeclaration_With_superClass,
|
|
2935
3091
|
) => void,
|
|
2936
|
-
+'ClassDeclaration[
|
|
2937
|
-
node:
|
|
3092
|
+
+'ClassDeclaration[superTypeArguments]:exit'?: (
|
|
3093
|
+
node: ClassDeclaration_With_superTypeArguments,
|
|
2938
3094
|
) => void,
|
|
2939
3095
|
+'ClassDeclaration[implements]:exit'?: (
|
|
2940
3096
|
node: ClassDeclaration_With_implements,
|
|
@@ -2951,8 +3107,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2951
3107
|
+'ClassExpression[superClass]:exit'?: (
|
|
2952
3108
|
node: ClassExpression_With_superClass,
|
|
2953
3109
|
) => void,
|
|
2954
|
-
+'ClassExpression[
|
|
2955
|
-
node:
|
|
3110
|
+
+'ClassExpression[superTypeArguments]:exit'?: (
|
|
3111
|
+
node: ClassExpression_With_superTypeArguments,
|
|
2956
3112
|
) => void,
|
|
2957
3113
|
+'ClassExpression[implements]:exit'?: (
|
|
2958
3114
|
node: ClassExpression_With_implements,
|
|
@@ -3562,6 +3718,22 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
3562
3718
|
+'MatchIdentifierPattern[id]:exit'?: (
|
|
3563
3719
|
node: MatchIdentifierPattern_With_id,
|
|
3564
3720
|
) => void,
|
|
3721
|
+
+'MatchInstanceObjectPattern:exit'?: (
|
|
3722
|
+
node: MatchInstanceObjectPattern,
|
|
3723
|
+
) => void,
|
|
3724
|
+
+'MatchInstanceObjectPattern[properties]:exit'?: (
|
|
3725
|
+
node: MatchInstanceObjectPattern_With_properties,
|
|
3726
|
+
) => void,
|
|
3727
|
+
+'MatchInstanceObjectPattern[rest]:exit'?: (
|
|
3728
|
+
node: MatchInstanceObjectPattern_With_rest,
|
|
3729
|
+
) => void,
|
|
3730
|
+
+'MatchInstancePattern:exit'?: (node: MatchInstancePattern) => void,
|
|
3731
|
+
+'MatchInstancePattern[targetConstructor]:exit'?: (
|
|
3732
|
+
node: MatchInstancePattern_With_targetConstructor,
|
|
3733
|
+
) => void,
|
|
3734
|
+
+'MatchInstancePattern[properties]:exit'?: (
|
|
3735
|
+
node: MatchInstancePattern_With_properties,
|
|
3736
|
+
) => void,
|
|
3565
3737
|
+'MatchLiteralPattern:exit'?: (node: MatchLiteralPattern) => void,
|
|
3566
3738
|
+'MatchLiteralPattern[literal]:exit'?: (
|
|
3567
3739
|
node: MatchLiteralPattern_With_literal,
|
|
@@ -3647,6 +3819,7 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
3647
3819
|
node: MethodDefinition_With_static,
|
|
3648
3820
|
) => void,
|
|
3649
3821
|
+'MixedTypeAnnotation:exit'?: (node: MixedTypeAnnotation) => void,
|
|
3822
|
+
+'NeverTypeAnnotation:exit'?: (node: NeverTypeAnnotation) => void,
|
|
3650
3823
|
+'NewExpression:exit'?: (node: NewExpression) => void,
|
|
3651
3824
|
+'NewExpression[callee]:exit'?: (node: NewExpression_With_callee) => void,
|
|
3652
3825
|
+'NewExpression[typeArguments]:exit'?: (
|
|
@@ -3850,6 +4023,66 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
3850
4023
|
+'QualifiedTypeofIdentifier[id]:exit'?: (
|
|
3851
4024
|
node: QualifiedTypeofIdentifier_With_id,
|
|
3852
4025
|
) => void,
|
|
4026
|
+
+'RecordDeclaration:exit'?: (node: RecordDeclaration) => void,
|
|
4027
|
+
+'RecordDeclaration[id]:exit'?: (node: RecordDeclaration_With_id) => void,
|
|
4028
|
+
+'RecordDeclaration[typeParameters]:exit'?: (
|
|
4029
|
+
node: RecordDeclaration_With_typeParameters,
|
|
4030
|
+
) => void,
|
|
4031
|
+
+'RecordDeclaration[implements]:exit'?: (
|
|
4032
|
+
node: RecordDeclaration_With_implements,
|
|
4033
|
+
) => void,
|
|
4034
|
+
+'RecordDeclaration[body]:exit'?: (node: RecordDeclaration_With_body) => void,
|
|
4035
|
+
+'RecordDeclarationBody:exit'?: (node: RecordDeclarationBody) => void,
|
|
4036
|
+
+'RecordDeclarationBody[elements]:exit'?: (
|
|
4037
|
+
node: RecordDeclarationBody_With_elements,
|
|
4038
|
+
) => void,
|
|
4039
|
+
+'RecordDeclarationImplements:exit'?: (
|
|
4040
|
+
node: RecordDeclarationImplements,
|
|
4041
|
+
) => void,
|
|
4042
|
+
+'RecordDeclarationImplements[id]:exit'?: (
|
|
4043
|
+
node: RecordDeclarationImplements_With_id,
|
|
4044
|
+
) => void,
|
|
4045
|
+
+'RecordDeclarationImplements[typeArguments]:exit'?: (
|
|
4046
|
+
node: RecordDeclarationImplements_With_typeArguments,
|
|
4047
|
+
) => void,
|
|
4048
|
+
+'RecordDeclarationProperty:exit'?: (node: RecordDeclarationProperty) => void,
|
|
4049
|
+
+'RecordDeclarationProperty[key]:exit'?: (
|
|
4050
|
+
node: RecordDeclarationProperty_With_key,
|
|
4051
|
+
) => void,
|
|
4052
|
+
+'RecordDeclarationProperty[typeAnnotation]:exit'?: (
|
|
4053
|
+
node: RecordDeclarationProperty_With_typeAnnotation,
|
|
4054
|
+
) => void,
|
|
4055
|
+
+'RecordDeclarationProperty[defaultValue]:exit'?: (
|
|
4056
|
+
node: RecordDeclarationProperty_With_defaultValue,
|
|
4057
|
+
) => void,
|
|
4058
|
+
+'RecordDeclarationStaticProperty:exit'?: (
|
|
4059
|
+
node: RecordDeclarationStaticProperty,
|
|
4060
|
+
) => void,
|
|
4061
|
+
+'RecordDeclarationStaticProperty[key]:exit'?: (
|
|
4062
|
+
node: RecordDeclarationStaticProperty_With_key,
|
|
4063
|
+
) => void,
|
|
4064
|
+
+'RecordDeclarationStaticProperty[typeAnnotation]:exit'?: (
|
|
4065
|
+
node: RecordDeclarationStaticProperty_With_typeAnnotation,
|
|
4066
|
+
) => void,
|
|
4067
|
+
+'RecordDeclarationStaticProperty[value]:exit'?: (
|
|
4068
|
+
node: RecordDeclarationStaticProperty_With_value,
|
|
4069
|
+
) => void,
|
|
4070
|
+
+'RecordExpression:exit'?: (node: RecordExpression) => void,
|
|
4071
|
+
+'RecordExpression[recordConstructor]:exit'?: (
|
|
4072
|
+
node: RecordExpression_With_recordConstructor,
|
|
4073
|
+
) => void,
|
|
4074
|
+
+'RecordExpression[typeArguments]:exit'?: (
|
|
4075
|
+
node: RecordExpression_With_typeArguments,
|
|
4076
|
+
) => void,
|
|
4077
|
+
+'RecordExpression[properties]:exit'?: (
|
|
4078
|
+
node: RecordExpression_With_properties,
|
|
4079
|
+
) => void,
|
|
4080
|
+
+'RecordExpressionProperties:exit'?: (
|
|
4081
|
+
node: RecordExpressionProperties,
|
|
4082
|
+
) => void,
|
|
4083
|
+
+'RecordExpressionProperties[properties]:exit'?: (
|
|
4084
|
+
node: RecordExpressionProperties_With_properties,
|
|
4085
|
+
) => void,
|
|
3853
4086
|
+'RestElement:exit'?: (node: RestElement) => void,
|
|
3854
4087
|
+'RestElement[argument]:exit'?: (node: RestElement_With_argument) => void,
|
|
3855
4088
|
+'ReturnStatement:exit'?: (node: ReturnStatement) => void,
|
|
@@ -3911,8 +4144,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
3911
4144
|
+'TryStatement[handler]:exit'?: (node: TryStatement_With_handler) => void,
|
|
3912
4145
|
+'TryStatement[finalizer]:exit'?: (node: TryStatement_With_finalizer) => void,
|
|
3913
4146
|
+'TupleTypeAnnotation:exit'?: (node: TupleTypeAnnotation) => void,
|
|
3914
|
-
+'TupleTypeAnnotation[
|
|
3915
|
-
node:
|
|
4147
|
+
+'TupleTypeAnnotation[elementTypes]:exit'?: (
|
|
4148
|
+
node: TupleTypeAnnotation_With_elementTypes,
|
|
3916
4149
|
) => void,
|
|
3917
4150
|
+'TupleTypeAnnotation[inexact]:exit'?: (
|
|
3918
4151
|
node: TupleTypeAnnotation_With_inexact,
|
|
@@ -4001,10 +4234,12 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
4001
4234
|
node: UnaryExpression_With_argument,
|
|
4002
4235
|
) => void,
|
|
4003
4236
|
+'UnaryExpression[prefix]:exit'?: (node: UnaryExpression_With_prefix) => void,
|
|
4237
|
+
+'UndefinedTypeAnnotation:exit'?: (node: UndefinedTypeAnnotation) => void,
|
|
4004
4238
|
+'UnionTypeAnnotation:exit'?: (node: UnionTypeAnnotation) => void,
|
|
4005
4239
|
+'UnionTypeAnnotation[types]:exit'?: (
|
|
4006
4240
|
node: UnionTypeAnnotation_With_types,
|
|
4007
4241
|
) => void,
|
|
4242
|
+
+'UnknownTypeAnnotation:exit'?: (node: UnknownTypeAnnotation) => void,
|
|
4008
4243
|
+'UpdateExpression:exit'?: (node: UpdateExpression) => void,
|
|
4009
4244
|
+'UpdateExpression[operator]:exit'?: (
|
|
4010
4245
|
node: UpdateExpression_With_operator,
|
|
@@ -147,6 +147,8 @@ import type {
|
|
|
147
147
|
MatchExpression,
|
|
148
148
|
MatchExpressionCase,
|
|
149
149
|
MatchIdentifierPattern,
|
|
150
|
+
MatchInstanceObjectPattern,
|
|
151
|
+
MatchInstancePattern,
|
|
150
152
|
MatchLiteralPattern,
|
|
151
153
|
MatchMemberPattern,
|
|
152
154
|
MatchObjectPattern,
|
|
@@ -161,6 +163,7 @@ import type {
|
|
|
161
163
|
MetaProperty,
|
|
162
164
|
MethodDefinition,
|
|
163
165
|
MixedTypeAnnotation,
|
|
166
|
+
NeverTypeAnnotation,
|
|
164
167
|
NewExpression,
|
|
165
168
|
NullableTypeAnnotation,
|
|
166
169
|
NullLiteralTypeAnnotation,
|
|
@@ -183,6 +186,13 @@ import type {
|
|
|
183
186
|
PropertyDefinition,
|
|
184
187
|
QualifiedTypeIdentifier,
|
|
185
188
|
QualifiedTypeofIdentifier,
|
|
189
|
+
RecordDeclaration,
|
|
190
|
+
RecordDeclarationBody,
|
|
191
|
+
RecordDeclarationImplements,
|
|
192
|
+
RecordDeclarationProperty,
|
|
193
|
+
RecordDeclarationStaticProperty,
|
|
194
|
+
RecordExpression,
|
|
195
|
+
RecordExpressionProperties,
|
|
186
196
|
RestElement,
|
|
187
197
|
ReturnStatement,
|
|
188
198
|
SequenceExpression,
|
|
@@ -214,7 +224,9 @@ import type {
|
|
|
214
224
|
TypeParameterInstantiation,
|
|
215
225
|
TypePredicate,
|
|
216
226
|
UnaryExpression,
|
|
227
|
+
UndefinedTypeAnnotation,
|
|
217
228
|
UnionTypeAnnotation,
|
|
229
|
+
UnknownTypeAnnotation,
|
|
218
230
|
UpdateExpression,
|
|
219
231
|
VariableDeclaration,
|
|
220
232
|
VariableDeclarator,
|
|
@@ -421,6 +433,8 @@ exports.isMatchBindingPattern = isMatchBindingPattern;
|
|
|
421
433
|
exports.isMatchExpression = isMatchExpression;
|
|
422
434
|
exports.isMatchExpressionCase = isMatchExpressionCase;
|
|
423
435
|
exports.isMatchIdentifierPattern = isMatchIdentifierPattern;
|
|
436
|
+
exports.isMatchInstanceObjectPattern = isMatchInstanceObjectPattern;
|
|
437
|
+
exports.isMatchInstancePattern = isMatchInstancePattern;
|
|
424
438
|
exports.isMatchLiteralPattern = isMatchLiteralPattern;
|
|
425
439
|
exports.isMatchMemberPattern = isMatchMemberPattern;
|
|
426
440
|
exports.isMatchObjectPattern = isMatchObjectPattern;
|
|
@@ -439,6 +453,7 @@ exports.isMinusToken = isMinusToken;
|
|
|
439
453
|
exports.isMixedTypeAnnotation = isMixedTypeAnnotation;
|
|
440
454
|
exports.isModuleKeyword = isModuleKeyword;
|
|
441
455
|
exports.isMultiplyEqualToken = isMultiplyEqualToken;
|
|
456
|
+
exports.isNeverTypeAnnotation = isNeverTypeAnnotation;
|
|
442
457
|
exports.isNewExpression = isNewExpression;
|
|
443
458
|
exports.isNewToken = isNewToken;
|
|
444
459
|
exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
|
|
@@ -473,6 +488,13 @@ exports.isPropertyDefinition = isPropertyDefinition;
|
|
|
473
488
|
exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
|
|
474
489
|
exports.isQualifiedTypeofIdentifier = isQualifiedTypeofIdentifier;
|
|
475
490
|
exports.isQuestionMarkToken = isQuestionMarkToken;
|
|
491
|
+
exports.isRecordDeclaration = isRecordDeclaration;
|
|
492
|
+
exports.isRecordDeclarationBody = isRecordDeclarationBody;
|
|
493
|
+
exports.isRecordDeclarationImplements = isRecordDeclarationImplements;
|
|
494
|
+
exports.isRecordDeclarationProperty = isRecordDeclarationProperty;
|
|
495
|
+
exports.isRecordDeclarationStaticProperty = isRecordDeclarationStaticProperty;
|
|
496
|
+
exports.isRecordExpression = isRecordExpression;
|
|
497
|
+
exports.isRecordExpressionProperties = isRecordExpressionProperties;
|
|
476
498
|
exports.isRemainderEqualToken = isRemainderEqualToken;
|
|
477
499
|
exports.isRestElement = isRestElement;
|
|
478
500
|
exports.isReturnStatement = isReturnStatement;
|
|
@@ -519,8 +541,10 @@ exports.isTypePredicate = isTypePredicate;
|
|
|
519
541
|
exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
|
|
520
542
|
exports.isUnaryExpression = isUnaryExpression;
|
|
521
543
|
exports.isUnaryNegationToken = isUnaryNegationToken;
|
|
544
|
+
exports.isUndefinedTypeAnnotation = isUndefinedTypeAnnotation;
|
|
522
545
|
exports.isUnionTypeAnnotation = isUnionTypeAnnotation;
|
|
523
546
|
exports.isUnionTypeToken = isUnionTypeToken;
|
|
547
|
+
exports.isUnknownTypeAnnotation = isUnknownTypeAnnotation;
|
|
524
548
|
exports.isUpdateExpression = isUpdateExpression;
|
|
525
549
|
exports.isVarToken = isVarToken;
|
|
526
550
|
exports.isVariableDeclaration = isVariableDeclaration;
|
|
@@ -1463,6 +1487,22 @@ function isMatchIdentifierPattern(node
|
|
|
1463
1487
|
return node.type === 'MatchIdentifierPattern';
|
|
1464
1488
|
}
|
|
1465
1489
|
|
|
1490
|
+
function isMatchInstanceObjectPattern(node
|
|
1491
|
+
/*: ESNode | Token */
|
|
1492
|
+
)
|
|
1493
|
+
/*: implies node is MatchInstanceObjectPattern */
|
|
1494
|
+
{
|
|
1495
|
+
return node.type === 'MatchInstanceObjectPattern';
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
function isMatchInstancePattern(node
|
|
1499
|
+
/*: ESNode | Token */
|
|
1500
|
+
)
|
|
1501
|
+
/*: implies node is MatchInstancePattern */
|
|
1502
|
+
{
|
|
1503
|
+
return node.type === 'MatchInstancePattern';
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1466
1506
|
function isMatchLiteralPattern(node
|
|
1467
1507
|
/*: ESNode | Token */
|
|
1468
1508
|
)
|
|
@@ -1575,6 +1615,14 @@ function isMixedTypeAnnotation(node
|
|
|
1575
1615
|
return node.type === 'MixedTypeAnnotation';
|
|
1576
1616
|
}
|
|
1577
1617
|
|
|
1618
|
+
function isNeverTypeAnnotation(node
|
|
1619
|
+
/*: ESNode | Token */
|
|
1620
|
+
)
|
|
1621
|
+
/*: implies node is NeverTypeAnnotation */
|
|
1622
|
+
{
|
|
1623
|
+
return node.type === 'NeverTypeAnnotation';
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1578
1626
|
function isNewExpression(node
|
|
1579
1627
|
/*: ESNode | Token */
|
|
1580
1628
|
)
|
|
@@ -1751,6 +1799,62 @@ function isQualifiedTypeofIdentifier(node
|
|
|
1751
1799
|
return node.type === 'QualifiedTypeofIdentifier';
|
|
1752
1800
|
}
|
|
1753
1801
|
|
|
1802
|
+
function isRecordDeclaration(node
|
|
1803
|
+
/*: ESNode | Token */
|
|
1804
|
+
)
|
|
1805
|
+
/*: implies node is RecordDeclaration */
|
|
1806
|
+
{
|
|
1807
|
+
return node.type === 'RecordDeclaration';
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
function isRecordDeclarationBody(node
|
|
1811
|
+
/*: ESNode | Token */
|
|
1812
|
+
)
|
|
1813
|
+
/*: implies node is RecordDeclarationBody */
|
|
1814
|
+
{
|
|
1815
|
+
return node.type === 'RecordDeclarationBody';
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
function isRecordDeclarationImplements(node
|
|
1819
|
+
/*: ESNode | Token */
|
|
1820
|
+
)
|
|
1821
|
+
/*: implies node is RecordDeclarationImplements */
|
|
1822
|
+
{
|
|
1823
|
+
return node.type === 'RecordDeclarationImplements';
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
function isRecordDeclarationProperty(node
|
|
1827
|
+
/*: ESNode | Token */
|
|
1828
|
+
)
|
|
1829
|
+
/*: implies node is RecordDeclarationProperty */
|
|
1830
|
+
{
|
|
1831
|
+
return node.type === 'RecordDeclarationProperty';
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
function isRecordDeclarationStaticProperty(node
|
|
1835
|
+
/*: ESNode | Token */
|
|
1836
|
+
)
|
|
1837
|
+
/*: implies node is RecordDeclarationStaticProperty */
|
|
1838
|
+
{
|
|
1839
|
+
return node.type === 'RecordDeclarationStaticProperty';
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
function isRecordExpression(node
|
|
1843
|
+
/*: ESNode | Token */
|
|
1844
|
+
)
|
|
1845
|
+
/*: implies node is RecordExpression */
|
|
1846
|
+
{
|
|
1847
|
+
return node.type === 'RecordExpression';
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
function isRecordExpressionProperties(node
|
|
1851
|
+
/*: ESNode | Token */
|
|
1852
|
+
)
|
|
1853
|
+
/*: implies node is RecordExpressionProperties */
|
|
1854
|
+
{
|
|
1855
|
+
return node.type === 'RecordExpressionProperties';
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1754
1858
|
function isRestElement(node
|
|
1755
1859
|
/*: ESNode | Token */
|
|
1756
1860
|
)
|
|
@@ -1999,6 +2103,14 @@ function isUnaryExpression(node
|
|
|
1999
2103
|
return node.type === 'UnaryExpression';
|
|
2000
2104
|
}
|
|
2001
2105
|
|
|
2106
|
+
function isUndefinedTypeAnnotation(node
|
|
2107
|
+
/*: ESNode | Token */
|
|
2108
|
+
)
|
|
2109
|
+
/*: implies node is UndefinedTypeAnnotation */
|
|
2110
|
+
{
|
|
2111
|
+
return node.type === 'UndefinedTypeAnnotation';
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2002
2114
|
function isUnionTypeAnnotation(node
|
|
2003
2115
|
/*: ESNode | Token */
|
|
2004
2116
|
)
|
|
@@ -2007,6 +2119,14 @@ function isUnionTypeAnnotation(node
|
|
|
2007
2119
|
return node.type === 'UnionTypeAnnotation';
|
|
2008
2120
|
}
|
|
2009
2121
|
|
|
2122
|
+
function isUnknownTypeAnnotation(node
|
|
2123
|
+
/*: ESNode | Token */
|
|
2124
|
+
)
|
|
2125
|
+
/*: implies node is UnknownTypeAnnotation */
|
|
2126
|
+
{
|
|
2127
|
+
return node.type === 'UnknownTypeAnnotation';
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2010
2130
|
function isUpdateExpression(node
|
|
2011
2131
|
/*: ESNode | Token */
|
|
2012
2132
|
)
|
|
@@ -148,6 +148,8 @@ import type {
|
|
|
148
148
|
MatchExpression,
|
|
149
149
|
MatchExpressionCase,
|
|
150
150
|
MatchIdentifierPattern,
|
|
151
|
+
MatchInstanceObjectPattern,
|
|
152
|
+
MatchInstancePattern,
|
|
151
153
|
MatchLiteralPattern,
|
|
152
154
|
MatchMemberPattern,
|
|
153
155
|
MatchObjectPattern,
|
|
@@ -162,6 +164,7 @@ import type {
|
|
|
162
164
|
MetaProperty,
|
|
163
165
|
MethodDefinition,
|
|
164
166
|
MixedTypeAnnotation,
|
|
167
|
+
NeverTypeAnnotation,
|
|
165
168
|
NewExpression,
|
|
166
169
|
NullableTypeAnnotation,
|
|
167
170
|
NullLiteralTypeAnnotation,
|
|
@@ -184,6 +187,13 @@ import type {
|
|
|
184
187
|
PropertyDefinition,
|
|
185
188
|
QualifiedTypeIdentifier,
|
|
186
189
|
QualifiedTypeofIdentifier,
|
|
190
|
+
RecordDeclaration,
|
|
191
|
+
RecordDeclarationBody,
|
|
192
|
+
RecordDeclarationImplements,
|
|
193
|
+
RecordDeclarationProperty,
|
|
194
|
+
RecordDeclarationStaticProperty,
|
|
195
|
+
RecordExpression,
|
|
196
|
+
RecordExpressionProperties,
|
|
187
197
|
RestElement,
|
|
188
198
|
ReturnStatement,
|
|
189
199
|
SequenceExpression,
|
|
@@ -215,7 +225,9 @@ import type {
|
|
|
215
225
|
TypeParameterInstantiation,
|
|
216
226
|
TypePredicate,
|
|
217
227
|
UnaryExpression,
|
|
228
|
+
UndefinedTypeAnnotation,
|
|
218
229
|
UnionTypeAnnotation,
|
|
230
|
+
UnknownTypeAnnotation,
|
|
219
231
|
UpdateExpression,
|
|
220
232
|
VariableDeclaration,
|
|
221
233
|
VariableDeclarator,
|
|
@@ -812,6 +824,16 @@ export function isMatchIdentifierPattern(node /*: ESNode | Token */) /*: implies
|
|
|
812
824
|
}
|
|
813
825
|
|
|
814
826
|
|
|
827
|
+
export function isMatchInstanceObjectPattern(node /*: ESNode | Token */) /*: implies node is MatchInstanceObjectPattern */ {
|
|
828
|
+
return node.type === 'MatchInstanceObjectPattern';
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
export function isMatchInstancePattern(node /*: ESNode | Token */) /*: implies node is MatchInstancePattern */ {
|
|
833
|
+
return node.type === 'MatchInstancePattern';
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
|
|
815
837
|
export function isMatchLiteralPattern(node /*: ESNode | Token */) /*: implies node is MatchLiteralPattern */ {
|
|
816
838
|
return node.type === 'MatchLiteralPattern';
|
|
817
839
|
}
|
|
@@ -882,6 +904,11 @@ export function isMixedTypeAnnotation(node /*: ESNode | Token */) /*: implies no
|
|
|
882
904
|
}
|
|
883
905
|
|
|
884
906
|
|
|
907
|
+
export function isNeverTypeAnnotation(node /*: ESNode | Token */) /*: implies node is NeverTypeAnnotation */ {
|
|
908
|
+
return node.type === 'NeverTypeAnnotation';
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
|
|
885
912
|
export function isNewExpression(node /*: ESNode | Token */) /*: implies node is NewExpression */ {
|
|
886
913
|
return node.type === 'NewExpression';
|
|
887
914
|
}
|
|
@@ -992,6 +1019,41 @@ export function isQualifiedTypeofIdentifier(node /*: ESNode | Token */) /*: impl
|
|
|
992
1019
|
}
|
|
993
1020
|
|
|
994
1021
|
|
|
1022
|
+
export function isRecordDeclaration(node /*: ESNode | Token */) /*: implies node is RecordDeclaration */ {
|
|
1023
|
+
return node.type === 'RecordDeclaration';
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
export function isRecordDeclarationBody(node /*: ESNode | Token */) /*: implies node is RecordDeclarationBody */ {
|
|
1028
|
+
return node.type === 'RecordDeclarationBody';
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
export function isRecordDeclarationImplements(node /*: ESNode | Token */) /*: implies node is RecordDeclarationImplements */ {
|
|
1033
|
+
return node.type === 'RecordDeclarationImplements';
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
export function isRecordDeclarationProperty(node /*: ESNode | Token */) /*: implies node is RecordDeclarationProperty */ {
|
|
1038
|
+
return node.type === 'RecordDeclarationProperty';
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
export function isRecordDeclarationStaticProperty(node /*: ESNode | Token */) /*: implies node is RecordDeclarationStaticProperty */ {
|
|
1043
|
+
return node.type === 'RecordDeclarationStaticProperty';
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
export function isRecordExpression(node /*: ESNode | Token */) /*: implies node is RecordExpression */ {
|
|
1048
|
+
return node.type === 'RecordExpression';
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
export function isRecordExpressionProperties(node /*: ESNode | Token */) /*: implies node is RecordExpressionProperties */ {
|
|
1053
|
+
return node.type === 'RecordExpressionProperties';
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
|
|
995
1057
|
export function isRestElement(node /*: ESNode | Token */) /*: implies node is RestElement */ {
|
|
996
1058
|
return node.type === 'RestElement';
|
|
997
1059
|
}
|
|
@@ -1147,11 +1209,21 @@ export function isUnaryExpression(node /*: ESNode | Token */) /*: implies node i
|
|
|
1147
1209
|
}
|
|
1148
1210
|
|
|
1149
1211
|
|
|
1212
|
+
export function isUndefinedTypeAnnotation(node /*: ESNode | Token */) /*: implies node is UndefinedTypeAnnotation */ {
|
|
1213
|
+
return node.type === 'UndefinedTypeAnnotation';
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
|
|
1150
1217
|
export function isUnionTypeAnnotation(node /*: ESNode | Token */) /*: implies node is UnionTypeAnnotation */ {
|
|
1151
1218
|
return node.type === 'UnionTypeAnnotation';
|
|
1152
1219
|
}
|
|
1153
1220
|
|
|
1154
1221
|
|
|
1222
|
+
export function isUnknownTypeAnnotation(node /*: ESNode | Token */) /*: implies node is UnknownTypeAnnotation */ {
|
|
1223
|
+
return node.type === 'UnknownTypeAnnotation';
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
|
|
1155
1227
|
export function isUpdateExpression(node /*: ESNode | Token */) /*: implies node is UpdateExpression */ {
|
|
1156
1228
|
return node.type === 'UpdateExpression';
|
|
1157
1229
|
}
|
package/dist/predicates.js
CHANGED
|
@@ -237,8 +237,7 @@ function isExpression(node
|
|
|
237
237
|
)
|
|
238
238
|
/*: implies node is Expression */
|
|
239
239
|
{
|
|
240
|
-
return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || node.type === 'ObjectExpression' ||
|
|
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';
|
|
240
|
+
return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || 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' || node.type === 'MatchExpression' || node.type === 'RecordExpression';
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
function isStatement(node
|
|
@@ -246,5 +245,5 @@ function isStatement(node
|
|
|
246
245
|
)
|
|
247
246
|
/*: implies node is Statement */
|
|
248
247
|
{
|
|
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';
|
|
248
|
+
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 === 'MatchStatement' || node.type === 'OpaqueType' || node.type === 'RecordDeclaration' || 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
249
|
}
|
package/dist/predicates.js.flow
CHANGED
|
@@ -134,8 +134,6 @@ export function isExpression(node /*: ESNode */) /*: implies node is Expression
|
|
|
134
134
|
node.type === 'ThisExpression' ||
|
|
135
135
|
node.type === 'ArrayExpression' ||
|
|
136
136
|
node.type === 'ObjectExpression' ||
|
|
137
|
-
// $FlowFixMe[incompatible-type]
|
|
138
|
-
node.type === 'ObjectExpression' ||
|
|
139
137
|
node.type === 'FunctionExpression' ||
|
|
140
138
|
node.type === 'ArrowFunctionExpression' ||
|
|
141
139
|
node.type === 'YieldExpression' ||
|
|
@@ -162,7 +160,9 @@ export function isExpression(node /*: ESNode */) /*: implies node is Expression
|
|
|
162
160
|
node.type === 'AsExpression' ||
|
|
163
161
|
node.type === 'AsConstExpression' ||
|
|
164
162
|
node.type === 'JSXFragment' ||
|
|
165
|
-
node.type === 'JSXElement'
|
|
163
|
+
node.type === 'JSXElement' ||
|
|
164
|
+
node.type === 'MatchExpression' ||
|
|
165
|
+
node.type === 'RecordExpression'
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -191,7 +191,9 @@ export function isStatement(node /*: ESNode */) /*: implies node is Statement */
|
|
|
191
191
|
node.type === 'IfStatement' ||
|
|
192
192
|
node.type === 'InterfaceDeclaration' ||
|
|
193
193
|
node.type === 'LabeledStatement' ||
|
|
194
|
+
node.type === 'MatchStatement' ||
|
|
194
195
|
node.type === 'OpaqueType' ||
|
|
196
|
+
node.type === 'RecordDeclaration' ||
|
|
195
197
|
node.type === 'ReturnStatement' ||
|
|
196
198
|
node.type === 'SwitchStatement' ||
|
|
197
199
|
node.type === 'ThrowStatement' ||
|
|
@@ -147,6 +147,8 @@ import type {
|
|
|
147
147
|
MatchExpression,
|
|
148
148
|
MatchExpressionCase,
|
|
149
149
|
MatchIdentifierPattern,
|
|
150
|
+
MatchInstanceObjectPattern,
|
|
151
|
+
MatchInstancePattern,
|
|
150
152
|
MatchLiteralPattern,
|
|
151
153
|
MatchMemberPattern,
|
|
152
154
|
MatchObjectPattern,
|
|
@@ -161,6 +163,7 @@ import type {
|
|
|
161
163
|
MetaProperty,
|
|
162
164
|
MethodDefinition,
|
|
163
165
|
MixedTypeAnnotation,
|
|
166
|
+
NeverTypeAnnotation,
|
|
164
167
|
NewExpression,
|
|
165
168
|
NullableTypeAnnotation,
|
|
166
169
|
NullLiteralTypeAnnotation,
|
|
@@ -183,6 +186,13 @@ import type {
|
|
|
183
186
|
PropertyDefinition,
|
|
184
187
|
QualifiedTypeIdentifier,
|
|
185
188
|
QualifiedTypeofIdentifier,
|
|
189
|
+
RecordDeclaration,
|
|
190
|
+
RecordDeclarationBody,
|
|
191
|
+
RecordDeclarationImplements,
|
|
192
|
+
RecordDeclarationProperty,
|
|
193
|
+
RecordDeclarationStaticProperty,
|
|
194
|
+
RecordExpression,
|
|
195
|
+
RecordExpressionProperties,
|
|
186
196
|
RestElement,
|
|
187
197
|
ReturnStatement,
|
|
188
198
|
SequenceExpression,
|
|
@@ -214,7 +224,9 @@ import type {
|
|
|
214
224
|
TypeParameterInstantiation,
|
|
215
225
|
TypePredicate,
|
|
216
226
|
UnaryExpression,
|
|
227
|
+
UndefinedTypeAnnotation,
|
|
217
228
|
UnionTypeAnnotation,
|
|
229
|
+
UnknownTypeAnnotation,
|
|
218
230
|
UpdateExpression,
|
|
219
231
|
VariableDeclaration,
|
|
220
232
|
VariableDeclarator,
|
|
@@ -421,6 +433,8 @@ exports.isMatchBindingPattern = isMatchBindingPattern;
|
|
|
421
433
|
exports.isMatchExpression = isMatchExpression;
|
|
422
434
|
exports.isMatchExpressionCase = isMatchExpressionCase;
|
|
423
435
|
exports.isMatchIdentifierPattern = isMatchIdentifierPattern;
|
|
436
|
+
exports.isMatchInstanceObjectPattern = isMatchInstanceObjectPattern;
|
|
437
|
+
exports.isMatchInstancePattern = isMatchInstancePattern;
|
|
424
438
|
exports.isMatchLiteralPattern = isMatchLiteralPattern;
|
|
425
439
|
exports.isMatchMemberPattern = isMatchMemberPattern;
|
|
426
440
|
exports.isMatchObjectPattern = isMatchObjectPattern;
|
|
@@ -439,6 +453,7 @@ exports.isMinusToken = isMinusToken;
|
|
|
439
453
|
exports.isMixedTypeAnnotation = isMixedTypeAnnotation;
|
|
440
454
|
exports.isModuleKeyword = isModuleKeyword;
|
|
441
455
|
exports.isMultiplyEqualToken = isMultiplyEqualToken;
|
|
456
|
+
exports.isNeverTypeAnnotation = isNeverTypeAnnotation;
|
|
442
457
|
exports.isNewExpression = isNewExpression;
|
|
443
458
|
exports.isNewToken = isNewToken;
|
|
444
459
|
exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
|
|
@@ -473,6 +488,13 @@ exports.isPropertyDefinition = isPropertyDefinition;
|
|
|
473
488
|
exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
|
|
474
489
|
exports.isQualifiedTypeofIdentifier = isQualifiedTypeofIdentifier;
|
|
475
490
|
exports.isQuestionMarkToken = isQuestionMarkToken;
|
|
491
|
+
exports.isRecordDeclaration = isRecordDeclaration;
|
|
492
|
+
exports.isRecordDeclarationBody = isRecordDeclarationBody;
|
|
493
|
+
exports.isRecordDeclarationImplements = isRecordDeclarationImplements;
|
|
494
|
+
exports.isRecordDeclarationProperty = isRecordDeclarationProperty;
|
|
495
|
+
exports.isRecordDeclarationStaticProperty = isRecordDeclarationStaticProperty;
|
|
496
|
+
exports.isRecordExpression = isRecordExpression;
|
|
497
|
+
exports.isRecordExpressionProperties = isRecordExpressionProperties;
|
|
476
498
|
exports.isRemainderEqualToken = isRemainderEqualToken;
|
|
477
499
|
exports.isRestElement = isRestElement;
|
|
478
500
|
exports.isReturnStatement = isReturnStatement;
|
|
@@ -519,8 +541,10 @@ exports.isTypePredicate = isTypePredicate;
|
|
|
519
541
|
exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
|
|
520
542
|
exports.isUnaryExpression = isUnaryExpression;
|
|
521
543
|
exports.isUnaryNegationToken = isUnaryNegationToken;
|
|
544
|
+
exports.isUndefinedTypeAnnotation = isUndefinedTypeAnnotation;
|
|
522
545
|
exports.isUnionTypeAnnotation = isUnionTypeAnnotation;
|
|
523
546
|
exports.isUnionTypeToken = isUnionTypeToken;
|
|
547
|
+
exports.isUnknownTypeAnnotation = isUnknownTypeAnnotation;
|
|
524
548
|
exports.isUpdateExpression = isUpdateExpression;
|
|
525
549
|
exports.isVarToken = isVarToken;
|
|
526
550
|
exports.isVariableDeclaration = isVariableDeclaration;
|
|
@@ -1463,6 +1487,22 @@ function isMatchIdentifierPattern(node
|
|
|
1463
1487
|
return node.type === 'MatchIdentifierPattern';
|
|
1464
1488
|
}
|
|
1465
1489
|
|
|
1490
|
+
function isMatchInstanceObjectPattern(node
|
|
1491
|
+
/*: ESNode | Token */
|
|
1492
|
+
)
|
|
1493
|
+
/*: implies node is MatchInstanceObjectPattern */
|
|
1494
|
+
{
|
|
1495
|
+
return node.type === 'MatchInstanceObjectPattern';
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
function isMatchInstancePattern(node
|
|
1499
|
+
/*: ESNode | Token */
|
|
1500
|
+
)
|
|
1501
|
+
/*: implies node is MatchInstancePattern */
|
|
1502
|
+
{
|
|
1503
|
+
return node.type === 'MatchInstancePattern';
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1466
1506
|
function isMatchLiteralPattern(node
|
|
1467
1507
|
/*: ESNode | Token */
|
|
1468
1508
|
)
|
|
@@ -1575,6 +1615,14 @@ function isMixedTypeAnnotation(node
|
|
|
1575
1615
|
return node.type === 'MixedTypeAnnotation';
|
|
1576
1616
|
}
|
|
1577
1617
|
|
|
1618
|
+
function isNeverTypeAnnotation(node
|
|
1619
|
+
/*: ESNode | Token */
|
|
1620
|
+
)
|
|
1621
|
+
/*: implies node is NeverTypeAnnotation */
|
|
1622
|
+
{
|
|
1623
|
+
return node.type === 'NeverTypeAnnotation';
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1578
1626
|
function isNewExpression(node
|
|
1579
1627
|
/*: ESNode | Token */
|
|
1580
1628
|
)
|
|
@@ -1751,6 +1799,62 @@ function isQualifiedTypeofIdentifier(node
|
|
|
1751
1799
|
return node.type === 'QualifiedTypeofIdentifier';
|
|
1752
1800
|
}
|
|
1753
1801
|
|
|
1802
|
+
function isRecordDeclaration(node
|
|
1803
|
+
/*: ESNode | Token */
|
|
1804
|
+
)
|
|
1805
|
+
/*: implies node is RecordDeclaration */
|
|
1806
|
+
{
|
|
1807
|
+
return node.type === 'RecordDeclaration';
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
function isRecordDeclarationBody(node
|
|
1811
|
+
/*: ESNode | Token */
|
|
1812
|
+
)
|
|
1813
|
+
/*: implies node is RecordDeclarationBody */
|
|
1814
|
+
{
|
|
1815
|
+
return node.type === 'RecordDeclarationBody';
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
function isRecordDeclarationImplements(node
|
|
1819
|
+
/*: ESNode | Token */
|
|
1820
|
+
)
|
|
1821
|
+
/*: implies node is RecordDeclarationImplements */
|
|
1822
|
+
{
|
|
1823
|
+
return node.type === 'RecordDeclarationImplements';
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
function isRecordDeclarationProperty(node
|
|
1827
|
+
/*: ESNode | Token */
|
|
1828
|
+
)
|
|
1829
|
+
/*: implies node is RecordDeclarationProperty */
|
|
1830
|
+
{
|
|
1831
|
+
return node.type === 'RecordDeclarationProperty';
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
function isRecordDeclarationStaticProperty(node
|
|
1835
|
+
/*: ESNode | Token */
|
|
1836
|
+
)
|
|
1837
|
+
/*: implies node is RecordDeclarationStaticProperty */
|
|
1838
|
+
{
|
|
1839
|
+
return node.type === 'RecordDeclarationStaticProperty';
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
function isRecordExpression(node
|
|
1843
|
+
/*: ESNode | Token */
|
|
1844
|
+
)
|
|
1845
|
+
/*: implies node is RecordExpression */
|
|
1846
|
+
{
|
|
1847
|
+
return node.type === 'RecordExpression';
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
function isRecordExpressionProperties(node
|
|
1851
|
+
/*: ESNode | Token */
|
|
1852
|
+
)
|
|
1853
|
+
/*: implies node is RecordExpressionProperties */
|
|
1854
|
+
{
|
|
1855
|
+
return node.type === 'RecordExpressionProperties';
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1754
1858
|
function isRestElement(node
|
|
1755
1859
|
/*: ESNode | Token */
|
|
1756
1860
|
)
|
|
@@ -1999,6 +2103,14 @@ function isUnaryExpression(node
|
|
|
1999
2103
|
return node.type === 'UnaryExpression';
|
|
2000
2104
|
}
|
|
2001
2105
|
|
|
2106
|
+
function isUndefinedTypeAnnotation(node
|
|
2107
|
+
/*: ESNode | Token */
|
|
2108
|
+
)
|
|
2109
|
+
/*: implies node is UndefinedTypeAnnotation */
|
|
2110
|
+
{
|
|
2111
|
+
return node.type === 'UndefinedTypeAnnotation';
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2002
2114
|
function isUnionTypeAnnotation(node
|
|
2003
2115
|
/*: ESNode | Token */
|
|
2004
2116
|
)
|
|
@@ -2007,6 +2119,14 @@ function isUnionTypeAnnotation(node
|
|
|
2007
2119
|
return node.type === 'UnionTypeAnnotation';
|
|
2008
2120
|
}
|
|
2009
2121
|
|
|
2122
|
+
function isUnknownTypeAnnotation(node
|
|
2123
|
+
/*: ESNode | Token */
|
|
2124
|
+
)
|
|
2125
|
+
/*: implies node is UnknownTypeAnnotation */
|
|
2126
|
+
{
|
|
2127
|
+
return node.type === 'UnknownTypeAnnotation';
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2010
2130
|
function isUpdateExpression(node
|
|
2011
2131
|
/*: ESNode | Token */
|
|
2012
2132
|
)
|
package/dist/src/predicates.js
CHANGED
|
@@ -237,8 +237,7 @@ function isExpression(node
|
|
|
237
237
|
)
|
|
238
238
|
/*: implies node is Expression */
|
|
239
239
|
{
|
|
240
|
-
return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || node.type === 'ObjectExpression' ||
|
|
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';
|
|
240
|
+
return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || 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' || node.type === 'MatchExpression' || node.type === 'RecordExpression';
|
|
242
241
|
}
|
|
243
242
|
|
|
244
243
|
function isStatement(node
|
|
@@ -246,5 +245,5 @@ function isStatement(node
|
|
|
246
245
|
)
|
|
247
246
|
/*: implies node is Statement */
|
|
248
247
|
{
|
|
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';
|
|
248
|
+
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 === 'MatchStatement' || node.type === 'OpaqueType' || node.type === 'RecordDeclaration' || 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
249
|
}
|
package/dist/types.js.flow
CHANGED
|
@@ -207,8 +207,17 @@ export type ESNode =
|
|
|
207
207
|
| MatchPattern
|
|
208
208
|
| MatchRestPattern
|
|
209
209
|
| MatchObjectPatternProperty
|
|
210
|
+
| MatchInstanceObjectPattern
|
|
210
211
|
| MatchExpressionCase
|
|
211
212
|
| MatchStatementCase
|
|
213
|
+
// Records
|
|
214
|
+
| RecordDeclaration
|
|
215
|
+
| RecordDeclarationImplements
|
|
216
|
+
| RecordDeclarationBody
|
|
217
|
+
| RecordDeclarationProperty
|
|
218
|
+
| RecordDeclarationStaticProperty
|
|
219
|
+
| RecordExpression
|
|
220
|
+
| RecordExpressionProperties
|
|
212
221
|
// JSX
|
|
213
222
|
| JSXNode;
|
|
214
223
|
|
|
@@ -276,7 +285,8 @@ export type Statement =
|
|
|
276
285
|
| VariableDeclaration
|
|
277
286
|
| WhileStatement
|
|
278
287
|
| WithStatement
|
|
279
|
-
| MatchStatement
|
|
288
|
+
| MatchStatement
|
|
289
|
+
| RecordDeclaration;
|
|
280
290
|
|
|
281
291
|
// nodes that can be the direct parent of a statement
|
|
282
292
|
export type StatementParentSingle =
|
|
@@ -486,6 +496,7 @@ export type Expression =
|
|
|
486
496
|
| AsExpression
|
|
487
497
|
| AsConstExpression
|
|
488
498
|
| MatchExpression
|
|
499
|
+
| RecordExpression
|
|
489
500
|
| JSXFragment
|
|
490
501
|
| JSXElement;
|
|
491
502
|
|
|
@@ -510,19 +521,25 @@ export interface ObjectExpression extends BaseNode {
|
|
|
510
521
|
// and object desturcturing properties.
|
|
511
522
|
export type Property = ObjectProperty | DestructuringObjectProperty;
|
|
512
523
|
|
|
524
|
+
export type ObjectPropertyKey =
|
|
525
|
+
| Identifier
|
|
526
|
+
| StringLiteral
|
|
527
|
+
| NumericLiteral
|
|
528
|
+
| BigIntLiteral;
|
|
529
|
+
|
|
513
530
|
export type ObjectProperty =
|
|
514
531
|
| ObjectPropertyWithNonShorthandStaticName
|
|
515
532
|
| ObjectPropertyWithShorthandStaticName
|
|
516
533
|
| ObjectPropertyWithComputedName;
|
|
517
534
|
interface ObjectPropertyBase extends BaseNode {
|
|
518
|
-
+parent: ObjectExpression | ObjectPattern;
|
|
535
|
+
+parent: ObjectExpression | ObjectPattern | RecordExpressionProperties;
|
|
519
536
|
}
|
|
520
537
|
export interface ObjectPropertyWithNonShorthandStaticName
|
|
521
538
|
extends ObjectPropertyBase {
|
|
522
539
|
+type: 'Property';
|
|
523
540
|
+computed: false;
|
|
524
541
|
// non-computed, non-shorthand names are constrained significantly
|
|
525
|
-
+key:
|
|
542
|
+
+key: ObjectPropertyKey;
|
|
526
543
|
+value: Expression;
|
|
527
544
|
+kind: 'init' | 'get' | 'set';
|
|
528
545
|
+method: boolean;
|
|
@@ -568,7 +585,7 @@ export interface DestructuringObjectPropertyWithNonShorthandStaticName
|
|
|
568
585
|
+type: 'Property';
|
|
569
586
|
+computed: false;
|
|
570
587
|
// non-computed, non-shorthand names are constrained significantly
|
|
571
|
-
+key:
|
|
588
|
+
+key: ObjectPropertyKey;
|
|
572
589
|
// destructuring properties cannot have any value
|
|
573
590
|
+value: DestructuringPattern;
|
|
574
591
|
+shorthand: false;
|
|
@@ -914,7 +931,7 @@ interface BaseClass extends BaseNode {
|
|
|
914
931
|
+body: ClassBody;
|
|
915
932
|
|
|
916
933
|
+typeParameters: null | TypeParameterDeclaration;
|
|
917
|
-
+
|
|
934
|
+
+superTypeArguments: null | TypeParameterInstantiation;
|
|
918
935
|
+implements: $ReadOnlyArray<ClassImplements>;
|
|
919
936
|
+decorators: $ReadOnlyArray<Decorator>;
|
|
920
937
|
}
|
|
@@ -925,8 +942,7 @@ export type PropertyName =
|
|
|
925
942
|
export type ClassPropertyNameComputed = Expression;
|
|
926
943
|
export type ClassPropertyNameNonComputed =
|
|
927
944
|
| PrivateIdentifier
|
|
928
|
-
|
|
|
929
|
-
| StringLiteral;
|
|
945
|
+
| ObjectPropertyKey;
|
|
930
946
|
|
|
931
947
|
export type ClassMember = PropertyDefinition | MethodDefinition | StaticBlock;
|
|
932
948
|
export type ClassMemberWithNonComputedName =
|
|
@@ -1090,7 +1106,8 @@ export type NamedDeclaration =
|
|
|
1090
1106
|
| TypeAlias
|
|
1091
1107
|
| OpaqueType
|
|
1092
1108
|
| InterfaceDeclaration
|
|
1093
|
-
| EnumDeclaration
|
|
1109
|
+
| EnumDeclaration
|
|
1110
|
+
| RecordDeclaration;
|
|
1094
1111
|
|
|
1095
1112
|
interface ExportNamedDeclarationBase extends BaseNode {
|
|
1096
1113
|
+type: 'ExportNamedDeclaration';
|
|
@@ -1156,6 +1173,9 @@ export type TypeAnnotationType =
|
|
|
1156
1173
|
| ThisTypeAnnotation
|
|
1157
1174
|
| MixedTypeAnnotation
|
|
1158
1175
|
| VoidTypeAnnotation
|
|
1176
|
+
| UnknownTypeAnnotation
|
|
1177
|
+
| NeverTypeAnnotation
|
|
1178
|
+
| UndefinedTypeAnnotation
|
|
1159
1179
|
| StringLiteralTypeAnnotation
|
|
1160
1180
|
| NumberLiteralTypeAnnotation
|
|
1161
1181
|
| BigIntLiteralTypeAnnotation
|
|
@@ -1250,6 +1270,15 @@ export interface MixedTypeAnnotation extends BaseNode {
|
|
|
1250
1270
|
export interface VoidTypeAnnotation extends BaseNode {
|
|
1251
1271
|
+type: 'VoidTypeAnnotation';
|
|
1252
1272
|
}
|
|
1273
|
+
export interface UnknownTypeAnnotation extends BaseNode {
|
|
1274
|
+
+type: 'UnknownTypeAnnotation';
|
|
1275
|
+
}
|
|
1276
|
+
export interface NeverTypeAnnotation extends BaseNode {
|
|
1277
|
+
+type: 'NeverTypeAnnotation';
|
|
1278
|
+
}
|
|
1279
|
+
export interface UndefinedTypeAnnotation extends BaseNode {
|
|
1280
|
+
+type: 'UndefinedTypeAnnotation';
|
|
1281
|
+
}
|
|
1253
1282
|
export interface StringLiteralTypeAnnotation extends BaseNode {
|
|
1254
1283
|
+type: 'StringLiteralTypeAnnotation';
|
|
1255
1284
|
+value: string;
|
|
@@ -1308,7 +1337,7 @@ export interface KeyofTypeAnnotation extends BaseNode {
|
|
|
1308
1337
|
}
|
|
1309
1338
|
export interface TupleTypeAnnotation extends BaseNode {
|
|
1310
1339
|
+type: 'TupleTypeAnnotation';
|
|
1311
|
-
+
|
|
1340
|
+
+elementTypes: $ReadOnlyArray<TypeAnnotationType>;
|
|
1312
1341
|
+inexact: boolean;
|
|
1313
1342
|
}
|
|
1314
1343
|
export interface TupleTypeSpreadElement extends BaseNode {
|
|
@@ -1457,7 +1486,7 @@ export interface ObjectTypeAnnotation extends BaseNode {
|
|
|
1457
1486
|
}
|
|
1458
1487
|
interface ObjectTypePropertyBase extends BaseNode {
|
|
1459
1488
|
+type: 'ObjectTypeProperty';
|
|
1460
|
-
+key:
|
|
1489
|
+
+key: ObjectPropertyKey;
|
|
1461
1490
|
+value: TypeAnnotationType;
|
|
1462
1491
|
+method: boolean;
|
|
1463
1492
|
+optional: boolean;
|
|
@@ -2054,6 +2083,7 @@ export type MatchPattern =
|
|
|
2054
2083
|
| MatchMemberPattern
|
|
2055
2084
|
| MatchBindingPattern
|
|
2056
2085
|
| MatchObjectPattern
|
|
2086
|
+
| MatchInstancePattern
|
|
2057
2087
|
| MatchArrayPattern;
|
|
2058
2088
|
|
|
2059
2089
|
export interface MatchOrPattern extends BaseNode {
|
|
@@ -2098,10 +2128,20 @@ export interface MatchObjectPattern extends BaseNode {
|
|
|
2098
2128
|
}
|
|
2099
2129
|
export interface MatchObjectPatternProperty extends BaseNode {
|
|
2100
2130
|
+type: 'MatchObjectPatternProperty';
|
|
2101
|
-
+key:
|
|
2131
|
+
+key: ObjectPropertyKey;
|
|
2102
2132
|
+pattern: MatchPattern;
|
|
2103
2133
|
+shorthand: boolean;
|
|
2104
2134
|
}
|
|
2135
|
+
export interface MatchInstancePattern extends BaseNode {
|
|
2136
|
+
+type: 'MatchInstancePattern';
|
|
2137
|
+
+targetConstructor: MatchIdentifierPattern | MatchMemberPattern;
|
|
2138
|
+
+properties: MatchInstanceObjectPattern;
|
|
2139
|
+
}
|
|
2140
|
+
export interface MatchInstanceObjectPattern extends BaseNode {
|
|
2141
|
+
+type: 'MatchInstanceObjectPattern';
|
|
2142
|
+
+properties: $ReadOnlyArray<MatchObjectPatternProperty>;
|
|
2143
|
+
+rest: MatchRestPattern | null;
|
|
2144
|
+
}
|
|
2105
2145
|
export interface MatchArrayPattern extends BaseNode {
|
|
2106
2146
|
+type: 'MatchArrayPattern';
|
|
2107
2147
|
+elements: $ReadOnlyArray<MatchPattern>;
|
|
@@ -2112,6 +2152,58 @@ export interface MatchRestPattern extends BaseNode {
|
|
|
2112
2152
|
+argument: MatchBindingPattern | null;
|
|
2113
2153
|
}
|
|
2114
2154
|
|
|
2155
|
+
/***********
|
|
2156
|
+
* Records *
|
|
2157
|
+
***********/
|
|
2158
|
+
export interface RecordDeclaration extends BaseNode {
|
|
2159
|
+
+type: 'RecordDeclaration';
|
|
2160
|
+
+id: Identifier;
|
|
2161
|
+
+typeParameters: TypeParameterDeclaration | null;
|
|
2162
|
+
+implements: $ReadOnlyArray<RecordDeclarationImplements>;
|
|
2163
|
+
+body: RecordDeclarationBody;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
export interface RecordDeclarationImplements extends BaseNode {
|
|
2167
|
+
+type: 'RecordDeclarationImplements';
|
|
2168
|
+
+id: Identifier;
|
|
2169
|
+
+typeArguments: TypeParameterInstantiation | null;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
export interface RecordDeclarationBody extends BaseNode {
|
|
2173
|
+
+type: 'RecordDeclarationBody';
|
|
2174
|
+
+elements: $ReadOnlyArray<
|
|
2175
|
+
| RecordDeclarationProperty
|
|
2176
|
+
| RecordDeclarationStaticProperty
|
|
2177
|
+
| MethodDefinition,
|
|
2178
|
+
>;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
export interface RecordDeclarationProperty extends BaseNode {
|
|
2182
|
+
+type: 'RecordDeclarationProperty';
|
|
2183
|
+
+key: ObjectPropertyKey;
|
|
2184
|
+
+typeAnnotation: TypeAnnotation;
|
|
2185
|
+
+defaultValue: Expression | null;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
export interface RecordDeclarationStaticProperty extends BaseNode {
|
|
2189
|
+
+type: 'RecordDeclarationStaticProperty';
|
|
2190
|
+
+key: ObjectPropertyKey;
|
|
2191
|
+
+typeAnnotation: TypeAnnotation;
|
|
2192
|
+
+value: Expression;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
export interface RecordExpression extends BaseNode {
|
|
2196
|
+
+type: 'RecordExpression';
|
|
2197
|
+
+recordConstructor: Expression;
|
|
2198
|
+
+typeArguments: TypeParameterInstantiation | null;
|
|
2199
|
+
+properties: RecordExpressionProperties;
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
export interface RecordExpressionProperties extends BaseNode {
|
|
2203
|
+
+type: 'RecordExpressionProperties';
|
|
2204
|
+
+properties: $ReadOnlyArray<ObjectProperty | SpreadElement>;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2115
2207
|
/******************************************************
|
|
2116
2208
|
* Deprecated spec nodes awaiting migration by Hermes *
|
|
2117
2209
|
******************************************************/
|