hermes-estree 0.16.0 → 0.17.1
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.
|
@@ -28,6 +28,7 @@ import type {
|
|
|
28
28
|
ArrayPattern,
|
|
29
29
|
ArrayTypeAnnotation,
|
|
30
30
|
ArrowFunctionExpression,
|
|
31
|
+
AsExpression,
|
|
31
32
|
AssignmentExpression,
|
|
32
33
|
AssignmentPattern,
|
|
33
34
|
AwaitExpression,
|
|
@@ -236,6 +237,12 @@ interface ArrowFunctionExpression_With_expression
|
|
|
236
237
|
interface ArrowFunctionExpression_With_async extends ArrowFunctionExpression {
|
|
237
238
|
+async: $NonMaybeType<ArrowFunctionExpression['async']>;
|
|
238
239
|
}
|
|
240
|
+
interface AsExpression_With_expression extends AsExpression {
|
|
241
|
+
+expression: $NonMaybeType<AsExpression['expression']>;
|
|
242
|
+
}
|
|
243
|
+
interface AsExpression_With_typeAnnotation extends AsExpression {
|
|
244
|
+
+typeAnnotation: $NonMaybeType<AsExpression['typeAnnotation']>;
|
|
245
|
+
}
|
|
239
246
|
interface AssignmentExpression_With_operator extends AssignmentExpression {
|
|
240
247
|
+operator: $NonMaybeType<AssignmentExpression['operator']>;
|
|
241
248
|
}
|
|
@@ -1445,6 +1452,7 @@ type ExpressionSpecialSelector =
|
|
|
1445
1452
|
| MetaProperty
|
|
1446
1453
|
| ArrayExpression
|
|
1447
1454
|
| ArrowFunctionExpression
|
|
1455
|
+
| AsExpression
|
|
1448
1456
|
| AssignmentExpression
|
|
1449
1457
|
| AwaitExpression
|
|
1450
1458
|
| BinaryExpression
|
|
@@ -1514,6 +1522,11 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1514
1522
|
+'ArrowFunctionExpression[async]'?: (
|
|
1515
1523
|
node: ArrowFunctionExpression_With_async,
|
|
1516
1524
|
) => void,
|
|
1525
|
+
+AsExpression?: (node: AsExpression) => void,
|
|
1526
|
+
+'AsExpression[expression]'?: (node: AsExpression_With_expression) => void,
|
|
1527
|
+
+'AsExpression[typeAnnotation]'?: (
|
|
1528
|
+
node: AsExpression_With_typeAnnotation,
|
|
1529
|
+
) => void,
|
|
1517
1530
|
+AssignmentExpression?: (node: AssignmentExpression) => void,
|
|
1518
1531
|
+'AssignmentExpression[operator]'?: (
|
|
1519
1532
|
node: AssignmentExpression_With_operator,
|
|
@@ -2496,6 +2509,13 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2496
2509
|
+'ArrowFunctionExpression[async]:exit'?: (
|
|
2497
2510
|
node: ArrowFunctionExpression_With_async,
|
|
2498
2511
|
) => void,
|
|
2512
|
+
+'AsExpression:exit'?: (node: AsExpression) => void,
|
|
2513
|
+
+'AsExpression[expression]:exit'?: (
|
|
2514
|
+
node: AsExpression_With_expression,
|
|
2515
|
+
) => void,
|
|
2516
|
+
+'AsExpression[typeAnnotation]:exit'?: (
|
|
2517
|
+
node: AsExpression_With_typeAnnotation,
|
|
2518
|
+
) => void,
|
|
2499
2519
|
+'AssignmentExpression:exit'?: (node: AssignmentExpression) => void,
|
|
2500
2520
|
+'AssignmentExpression[operator]:exit'?: (
|
|
2501
2521
|
node: AssignmentExpression_With_operator,
|
|
@@ -29,6 +29,7 @@ exports.isArrayExpression = isArrayExpression;
|
|
|
29
29
|
exports.isArrayPattern = isArrayPattern;
|
|
30
30
|
exports.isArrayTypeAnnotation = isArrayTypeAnnotation;
|
|
31
31
|
exports.isArrowFunctionExpression = isArrowFunctionExpression;
|
|
32
|
+
exports.isAsExpression = isAsExpression;
|
|
32
33
|
exports.isAsKeyword = isAsKeyword;
|
|
33
34
|
exports.isAssignmentExpression = isAssignmentExpression;
|
|
34
35
|
exports.isAssignmentPattern = isAssignmentPattern;
|
|
@@ -320,6 +321,10 @@ function isArrowFunctionExpression(node) {
|
|
|
320
321
|
return node.type === 'ArrowFunctionExpression';
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
function isAsExpression(node) {
|
|
325
|
+
return node.type === 'AsExpression';
|
|
326
|
+
}
|
|
327
|
+
|
|
323
328
|
function isAssignmentExpression(node) {
|
|
324
329
|
return node.type === 'AssignmentExpression';
|
|
325
330
|
}
|
|
@@ -45,6 +45,10 @@ export function isArrowFunctionExpression(
|
|
|
45
45
|
return node.type === 'ArrowFunctionExpression';
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function isAsExpression(node: ESNode | Token): boolean %checks {
|
|
49
|
+
return node.type === 'AsExpression';
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
export function isAssignmentExpression(node: ESNode | Token): boolean %checks {
|
|
49
53
|
return node.type === 'AssignmentExpression';
|
|
50
54
|
}
|
package/dist/types.js.flow
CHANGED
|
@@ -398,7 +398,7 @@ export interface ComponentDeclaration extends BaseNode {
|
|
|
398
398
|
+body: BlockStatement;
|
|
399
399
|
+id: Identifier;
|
|
400
400
|
+params: $ReadOnlyArray<ComponentParameterAndRestElement>;
|
|
401
|
-
+rendersType: null |
|
|
401
|
+
+rendersType: null | RendersType;
|
|
402
402
|
+typeParameters: null | TypeParameterDeclaration;
|
|
403
403
|
}
|
|
404
404
|
|
|
@@ -451,6 +451,7 @@ export type Expression =
|
|
|
451
451
|
| ImportExpression
|
|
452
452
|
| ChainExpression
|
|
453
453
|
| TypeCastExpression
|
|
454
|
+
| AsExpression
|
|
454
455
|
| JSXFragment
|
|
455
456
|
| JSXElement;
|
|
456
457
|
|
|
@@ -1321,12 +1322,32 @@ export interface ConditionalTypeAnnotation extends BaseNode {
|
|
|
1321
1322
|
+falseType: TypeAnnotationType;
|
|
1322
1323
|
}
|
|
1323
1324
|
|
|
1324
|
-
export
|
|
1325
|
+
export type TypeOperator =
|
|
1326
|
+
| RendersTypeOperator
|
|
1327
|
+
| RendersStarTypeOperator
|
|
1328
|
+
| RendersQuestionTypeOperator;
|
|
1329
|
+
|
|
1330
|
+
export type RendersType =
|
|
1331
|
+
| RendersTypeOperator
|
|
1332
|
+
| RendersStarTypeOperator
|
|
1333
|
+
| RendersQuestionTypeOperator;
|
|
1334
|
+
|
|
1335
|
+
interface TypeOperatorBase extends BaseNode {
|
|
1325
1336
|
+type: 'TypeOperator';
|
|
1326
|
-
// Supported type operators, currently only "renders".
|
|
1327
|
-
+operator: 'renders';
|
|
1328
1337
|
+typeAnnotation: TypeAnnotationType;
|
|
1329
1338
|
}
|
|
1339
|
+
export interface RendersTypeOperator extends TypeOperatorBase {
|
|
1340
|
+
+type: 'TypeOperator';
|
|
1341
|
+
+operator: 'renders';
|
|
1342
|
+
}
|
|
1343
|
+
export interface RendersStarTypeOperator extends TypeOperatorBase {
|
|
1344
|
+
+type: 'TypeOperator';
|
|
1345
|
+
+operator: 'renders*';
|
|
1346
|
+
}
|
|
1347
|
+
export interface RendersQuestionTypeOperator extends TypeOperatorBase {
|
|
1348
|
+
+type: 'TypeOperator';
|
|
1349
|
+
+operator: 'renders?';
|
|
1350
|
+
}
|
|
1330
1351
|
|
|
1331
1352
|
export interface TypePredicate extends BaseNode {
|
|
1332
1353
|
+type: 'TypePredicate';
|
|
@@ -1357,7 +1378,7 @@ export interface ComponentTypeAnnotation extends BaseNode {
|
|
|
1357
1378
|
+params: $ReadOnlyArray<ComponentTypeParameter>;
|
|
1358
1379
|
+rest: null | ComponentTypeParameter;
|
|
1359
1380
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1360
|
-
+rendersType: null |
|
|
1381
|
+
+rendersType: null | RendersType;
|
|
1361
1382
|
}
|
|
1362
1383
|
export interface ComponentTypeParameter extends BaseNode {
|
|
1363
1384
|
+type: 'ComponentTypeParameter';
|
|
@@ -1487,6 +1508,11 @@ export interface TypeCastExpression extends BaseNode {
|
|
|
1487
1508
|
+expression: Expression;
|
|
1488
1509
|
+typeAnnotation: TypeAnnotation;
|
|
1489
1510
|
}
|
|
1511
|
+
export interface AsExpression extends BaseNode {
|
|
1512
|
+
+type: 'AsExpression';
|
|
1513
|
+
+expression: Expression;
|
|
1514
|
+
+typeAnnotation: TypeAnnotationType;
|
|
1515
|
+
}
|
|
1490
1516
|
|
|
1491
1517
|
interface BaseInterfaceNode extends BaseNode {
|
|
1492
1518
|
+body: ObjectTypeAnnotation;
|
|
@@ -1655,7 +1681,7 @@ export interface DeclareComponent extends BaseNode {
|
|
|
1655
1681
|
+params: Array<ComponentTypeParameter>;
|
|
1656
1682
|
+rest: null | ComponentTypeParameter;
|
|
1657
1683
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1658
|
-
+rendersType: null |
|
|
1684
|
+
+rendersType: null | RendersType;
|
|
1659
1685
|
}
|
|
1660
1686
|
|
|
1661
1687
|
export interface DeclareVariable extends BaseNode {
|