hermes-estree 0.33.2 → 0.34.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.
@@ -70,6 +70,7 @@ import type {
70
70
  DeclareOpaqueType,
71
71
  DeclareTypeAlias,
72
72
  DeclareVariable,
73
+ Decorator,
73
74
  DoWhileStatement,
74
75
  EmptyStatement,
75
76
  EmptyTypeAnnotation,
@@ -412,6 +413,9 @@ interface ComponentDeclaration_With_typeParameters
412
413
  interface ComponentDeclaration_With_rendersType extends ComponentDeclaration {
413
414
  +rendersType: $NonMaybeType<ComponentDeclaration['rendersType']>;
414
415
  }
416
+ interface ComponentDeclaration_With_async extends ComponentDeclaration {
417
+ +async: $NonMaybeType<ComponentDeclaration['async']>;
418
+ }
415
419
  interface ComponentParameter_With_name extends ComponentParameter {
416
420
  +name: $NonMaybeType<ComponentParameter['name']>;
417
421
  }
@@ -605,6 +609,9 @@ interface DeclareVariable_With_id extends DeclareVariable {
605
609
  interface DeclareVariable_With_kind extends DeclareVariable {
606
610
  +kind: $NonMaybeType<DeclareVariable['kind']>;
607
611
  }
612
+ interface Decorator_With_expression extends Decorator {
613
+ +expression: $NonMaybeType<Decorator['expression']>;
614
+ }
608
615
  interface DoWhileStatement_With_body extends DoWhileStatement {
609
616
  +body: $NonMaybeType<DoWhileStatement['body']>;
610
617
  }
@@ -855,6 +862,9 @@ interface HookDeclaration_With_typeParameters extends HookDeclaration {
855
862
  interface HookDeclaration_With_returnType extends HookDeclaration {
856
863
  +returnType: $NonMaybeType<HookDeclaration['returnType']>;
857
864
  }
865
+ interface HookDeclaration_With_async extends HookDeclaration {
866
+ +async: $NonMaybeType<HookDeclaration['async']>;
867
+ }
858
868
  interface HookTypeAnnotation_With_params extends HookTypeAnnotation {
859
869
  +params: $NonMaybeType<HookTypeAnnotation['params']>;
860
870
  }
@@ -897,8 +907,8 @@ interface ImportDeclaration_With_specifiers extends ImportDeclaration {
897
907
  interface ImportDeclaration_With_source extends ImportDeclaration {
898
908
  +source: $NonMaybeType<ImportDeclaration['source']>;
899
909
  }
900
- interface ImportDeclaration_With_assertions extends ImportDeclaration {
901
- +assertions: $NonMaybeType<ImportDeclaration['assertions']>;
910
+ interface ImportDeclaration_With_attributes extends ImportDeclaration {
911
+ +attributes: $NonMaybeType<ImportDeclaration['attributes']>;
902
912
  }
903
913
  interface ImportDeclaration_With_importKind extends ImportDeclaration {
904
914
  +importKind: $NonMaybeType<ImportDeclaration['importKind']>;
@@ -1185,6 +1195,9 @@ interface MethodDefinition_With_computed extends MethodDefinition {
1185
1195
  interface MethodDefinition_With_static extends MethodDefinition {
1186
1196
  +static: $NonMaybeType<MethodDefinition['static']>;
1187
1197
  }
1198
+ interface MethodDefinition_With_decorators extends MethodDefinition {
1199
+ +decorators: $NonMaybeType<MethodDefinition['decorators']>;
1200
+ }
1188
1201
  interface NewExpression_With_callee extends NewExpression {
1189
1202
  +callee: $NonMaybeType<NewExpression['callee']>;
1190
1203
  }
@@ -1384,6 +1397,9 @@ interface PropertyDefinition_With_computed extends PropertyDefinition {
1384
1397
  interface PropertyDefinition_With_static extends PropertyDefinition {
1385
1398
  +static: $NonMaybeType<PropertyDefinition['static']>;
1386
1399
  }
1400
+ interface PropertyDefinition_With_decorators extends PropertyDefinition {
1401
+ +decorators: $NonMaybeType<PropertyDefinition['decorators']>;
1402
+ }
1387
1403
  interface PropertyDefinition_With_declare extends PropertyDefinition {
1388
1404
  +declare: $NonMaybeType<PropertyDefinition['declare']>;
1389
1405
  }
@@ -1936,6 +1952,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
1936
1952
  +'ComponentDeclaration[rendersType]'?: (
1937
1953
  node: ComponentDeclaration_With_rendersType,
1938
1954
  ) => void,
1955
+ +'ComponentDeclaration[async]'?: (
1956
+ node: ComponentDeclaration_With_async,
1957
+ ) => void,
1939
1958
  +ComponentParameter?: (node: ComponentParameter) => void,
1940
1959
  +'ComponentParameter[name]'?: (node: ComponentParameter_With_name) => void,
1941
1960
  +'ComponentParameter[local]'?: (node: ComponentParameter_With_local) => void,
@@ -2082,6 +2101,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
2082
2101
  +DeclareVariable?: (node: DeclareVariable) => void,
2083
2102
  +'DeclareVariable[id]'?: (node: DeclareVariable_With_id) => void,
2084
2103
  +'DeclareVariable[kind]'?: (node: DeclareVariable_With_kind) => void,
2104
+ +Decorator?: (node: Decorator) => void,
2105
+ +'Decorator[expression]'?: (node: Decorator_With_expression) => void,
2085
2106
  +DoWhileStatement?: (node: DoWhileStatement) => void,
2086
2107
  +'DoWhileStatement[body]'?: (node: DoWhileStatement_With_body) => void,
2087
2108
  +'DoWhileStatement[test]'?: (node: DoWhileStatement_With_test) => void,
@@ -2272,6 +2293,7 @@ export type ESQueryNodeSelectorsWithoutFallback = {
2272
2293
  +'HookDeclaration[returnType]'?: (
2273
2294
  node: HookDeclaration_With_returnType,
2274
2295
  ) => void,
2296
+ +'HookDeclaration[async]'?: (node: HookDeclaration_With_async) => void,
2275
2297
  +HookTypeAnnotation?: (node: HookTypeAnnotation) => void,
2276
2298
  +'HookTypeAnnotation[params]'?: (
2277
2299
  node: HookTypeAnnotation_With_params,
@@ -2301,8 +2323,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
2301
2323
  node: ImportDeclaration_With_specifiers,
2302
2324
  ) => void,
2303
2325
  +'ImportDeclaration[source]'?: (node: ImportDeclaration_With_source) => void,
2304
- +'ImportDeclaration[assertions]'?: (
2305
- node: ImportDeclaration_With_assertions,
2326
+ +'ImportDeclaration[attributes]'?: (
2327
+ node: ImportDeclaration_With_attributes,
2306
2328
  ) => void,
2307
2329
  +'ImportDeclaration[importKind]'?: (
2308
2330
  node: ImportDeclaration_With_importKind,
@@ -2546,6 +2568,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
2546
2568
  node: MethodDefinition_With_computed,
2547
2569
  ) => void,
2548
2570
  +'MethodDefinition[static]'?: (node: MethodDefinition_With_static) => void,
2571
+ +'MethodDefinition[decorators]'?: (
2572
+ node: MethodDefinition_With_decorators,
2573
+ ) => void,
2549
2574
  +MixedTypeAnnotation?: (node: MixedTypeAnnotation) => void,
2550
2575
  +NeverTypeAnnotation?: (node: NeverTypeAnnotation) => void,
2551
2576
  +NewExpression?: (node: NewExpression) => void,
@@ -2702,6 +2727,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
2702
2727
  +'PropertyDefinition[static]'?: (
2703
2728
  node: PropertyDefinition_With_static,
2704
2729
  ) => void,
2730
+ +'PropertyDefinition[decorators]'?: (
2731
+ node: PropertyDefinition_With_decorators,
2732
+ ) => void,
2705
2733
  +'PropertyDefinition[declare]'?: (
2706
2734
  node: PropertyDefinition_With_declare,
2707
2735
  ) => void,
@@ -3138,6 +3166,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3138
3166
  +'ComponentDeclaration[rendersType]:exit'?: (
3139
3167
  node: ComponentDeclaration_With_rendersType,
3140
3168
  ) => void,
3169
+ +'ComponentDeclaration[async]:exit'?: (
3170
+ node: ComponentDeclaration_With_async,
3171
+ ) => void,
3141
3172
  +'ComponentParameter:exit'?: (node: ComponentParameter) => void,
3142
3173
  +'ComponentParameter[name]:exit'?: (
3143
3174
  node: ComponentParameter_With_name,
@@ -3300,6 +3331,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3300
3331
  +'DeclareVariable:exit'?: (node: DeclareVariable) => void,
3301
3332
  +'DeclareVariable[id]:exit'?: (node: DeclareVariable_With_id) => void,
3302
3333
  +'DeclareVariable[kind]:exit'?: (node: DeclareVariable_With_kind) => void,
3334
+ +'Decorator:exit'?: (node: Decorator) => void,
3335
+ +'Decorator[expression]:exit'?: (node: Decorator_With_expression) => void,
3303
3336
  +'DoWhileStatement:exit'?: (node: DoWhileStatement) => void,
3304
3337
  +'DoWhileStatement[body]:exit'?: (node: DoWhileStatement_With_body) => void,
3305
3338
  +'DoWhileStatement[test]:exit'?: (node: DoWhileStatement_With_test) => void,
@@ -3502,6 +3535,7 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3502
3535
  +'HookDeclaration[returnType]:exit'?: (
3503
3536
  node: HookDeclaration_With_returnType,
3504
3537
  ) => void,
3538
+ +'HookDeclaration[async]:exit'?: (node: HookDeclaration_With_async) => void,
3505
3539
  +'HookTypeAnnotation:exit'?: (node: HookTypeAnnotation) => void,
3506
3540
  +'HookTypeAnnotation[params]:exit'?: (
3507
3541
  node: HookTypeAnnotation_With_params,
@@ -3535,8 +3569,8 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3535
3569
  +'ImportDeclaration[source]:exit'?: (
3536
3570
  node: ImportDeclaration_With_source,
3537
3571
  ) => void,
3538
- +'ImportDeclaration[assertions]:exit'?: (
3539
- node: ImportDeclaration_With_assertions,
3572
+ +'ImportDeclaration[attributes]:exit'?: (
3573
+ node: ImportDeclaration_With_attributes,
3540
3574
  ) => void,
3541
3575
  +'ImportDeclaration[importKind]:exit'?: (
3542
3576
  node: ImportDeclaration_With_importKind,
@@ -3818,6 +3852,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3818
3852
  +'MethodDefinition[static]:exit'?: (
3819
3853
  node: MethodDefinition_With_static,
3820
3854
  ) => void,
3855
+ +'MethodDefinition[decorators]:exit'?: (
3856
+ node: MethodDefinition_With_decorators,
3857
+ ) => void,
3821
3858
  +'MixedTypeAnnotation:exit'?: (node: MixedTypeAnnotation) => void,
3822
3859
  +'NeverTypeAnnotation:exit'?: (node: NeverTypeAnnotation) => void,
3823
3860
  +'NewExpression:exit'?: (node: NewExpression) => void,
@@ -3994,6 +4031,9 @@ export type ESQueryNodeSelectorsWithoutFallback = {
3994
4031
  +'PropertyDefinition[static]:exit'?: (
3995
4032
  node: PropertyDefinition_With_static,
3996
4033
  ) => void,
4034
+ +'PropertyDefinition[decorators]:exit'?: (
4035
+ node: PropertyDefinition_With_decorators,
4036
+ ) => void,
3997
4037
  +'PropertyDefinition[declare]:exit'?: (
3998
4038
  node: PropertyDefinition_With_declare,
3999
4039
  ) => void,
@@ -81,6 +81,7 @@ import type {
81
81
  DeclareOpaqueType,
82
82
  DeclareTypeAlias,
83
83
  DeclareVariable,
84
+ Decorator,
84
85
  DoWhileStatement,
85
86
  EmptyStatement,
86
87
  EmptyTypeAnnotation,
@@ -322,6 +323,7 @@ exports.isDeclareOpaqueType = isDeclareOpaqueType;
322
323
  exports.isDeclareTypeAlias = isDeclareTypeAlias;
323
324
  exports.isDeclareVariable = isDeclareVariable;
324
325
  exports.isDeclaredPredicate = isDeclaredPredicate;
326
+ exports.isDecorator = isDecorator;
325
327
  exports.isDecrementToken = isDecrementToken;
326
328
  exports.isDefaultToken = isDefaultToken;
327
329
  exports.isDeleteToken = isDeleteToken;
@@ -959,6 +961,14 @@ function isDeclareVariable(node
959
961
  return node.type === 'DeclareVariable';
960
962
  }
961
963
 
964
+ function isDecorator(node
965
+ /*: ESNode | Token */
966
+ )
967
+ /*: implies node is Decorator */
968
+ {
969
+ return node.type === 'Decorator';
970
+ }
971
+
962
972
  function isDoWhileStatement(node
963
973
  /*: ESNode | Token */
964
974
  )
@@ -82,6 +82,7 @@ import type {
82
82
  DeclareOpaqueType,
83
83
  DeclareTypeAlias,
84
84
  DeclareVariable,
85
+ Decorator,
85
86
  DoWhileStatement,
86
87
  EmptyStatement,
87
88
  EmptyTypeAnnotation,
@@ -494,6 +495,11 @@ export function isDeclareVariable(node /*: ESNode | Token */) /*: implies node i
494
495
  }
495
496
 
496
497
 
498
+ export function isDecorator(node /*: ESNode | Token */) /*: implies node is Decorator */ {
499
+ return node.type === 'Decorator';
500
+ }
501
+
502
+
497
503
  export function isDoWhileStatement(node /*: ESNode | Token */) /*: implies node is DoWhileStatement */ {
498
504
  return node.type === 'DoWhileStatement';
499
505
  }
@@ -81,6 +81,7 @@ import type {
81
81
  DeclareOpaqueType,
82
82
  DeclareTypeAlias,
83
83
  DeclareVariable,
84
+ Decorator,
84
85
  DoWhileStatement,
85
86
  EmptyStatement,
86
87
  EmptyTypeAnnotation,
@@ -322,6 +323,7 @@ exports.isDeclareOpaqueType = isDeclareOpaqueType;
322
323
  exports.isDeclareTypeAlias = isDeclareTypeAlias;
323
324
  exports.isDeclareVariable = isDeclareVariable;
324
325
  exports.isDeclaredPredicate = isDeclaredPredicate;
326
+ exports.isDecorator = isDecorator;
325
327
  exports.isDecrementToken = isDecrementToken;
326
328
  exports.isDefaultToken = isDefaultToken;
327
329
  exports.isDeleteToken = isDeleteToken;
@@ -959,6 +961,14 @@ function isDeclareVariable(node
959
961
  return node.type === 'DeclareVariable';
960
962
  }
961
963
 
964
+ function isDecorator(node
965
+ /*: ESNode | Token */
966
+ )
967
+ /*: implies node is Decorator */
968
+ {
969
+ return node.type === 'Decorator';
970
+ }
971
+
962
972
  function isDoWhileStatement(node
963
973
  /*: ESNode | Token */
964
974
  )
@@ -428,6 +428,7 @@ export interface ComponentParameter extends BaseNode {
428
428
 
429
429
  export interface ComponentDeclaration extends BaseNode {
430
430
  +type: 'ComponentDeclaration';
431
+ +async: boolean;
431
432
  +body: BlockStatement;
432
433
  +id: Identifier;
433
434
  +params: $ReadOnlyArray<ComponentParameterAndRestElement>;
@@ -437,6 +438,7 @@ export interface ComponentDeclaration extends BaseNode {
437
438
 
438
439
  export interface HookDeclaration extends BaseNode {
439
440
  +type: 'HookDeclaration';
441
+ +async: boolean;
440
442
  +id: Identifier;
441
443
  +body: BlockStatement;
442
444
  +params: $ReadOnlyArray<FunctionParameter>;
@@ -971,6 +973,7 @@ export interface MethodDefinitionConstructor extends MethodDefinitionBase {
971
973
  +kind: 'constructor';
972
974
  +computed: false;
973
975
  +static: false;
976
+ +decorators: $ReadOnlyArray<Decorator>;
974
977
  }
975
978
  export interface MethodDefinitionWithComputedName extends MethodDefinitionBase {
976
979
  +type: 'MethodDefinition';
@@ -978,6 +981,7 @@ export interface MethodDefinitionWithComputedName extends MethodDefinitionBase {
978
981
  +kind: 'method' | 'get' | 'set';
979
982
  +computed: true;
980
983
  +static: boolean;
984
+ +decorators: $ReadOnlyArray<Decorator>;
981
985
  }
982
986
  export interface MethodDefinitionWithNonComputedName
983
987
  extends MethodDefinitionBase {
@@ -986,6 +990,7 @@ export interface MethodDefinitionWithNonComputedName
986
990
  +kind: 'method' | 'get' | 'set';
987
991
  +computed: false;
988
992
  +static: boolean;
993
+ +decorators: $ReadOnlyArray<Decorator>;
989
994
  }
990
995
 
991
996
  // `PropertyDefinition` is the new standard for all class properties
@@ -996,6 +1001,7 @@ interface PropertyDefinitionBase extends BaseNode {
996
1001
  +value: null | Expression;
997
1002
  +typeAnnotation: null | TypeAnnotation;
998
1003
  +static: boolean;
1004
+ +decorators: $ReadOnlyArray<Decorator>;
999
1005
  +variance: null | Variance;
1000
1006
  +declare: boolean;
1001
1007
  // hermes always emit this as false
@@ -1054,7 +1060,7 @@ export interface ImportDeclaration extends BaseNode {
1054
1060
  ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier,
1055
1061
  >;
1056
1062
  +source: StringLiteral;
1057
- +assertions: $ReadOnlyArray<ImportAttribute>;
1063
+ +attributes: $ReadOnlyArray<ImportAttribute>;
1058
1064
 
1059
1065
  +importKind: 'value' | 'type' | 'typeof';
1060
1066
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-estree",
3
- "version": "0.33.2",
3
+ "version": "0.34.0",
4
4
  "description": "Flow types for the Flow-ESTree spec produced by the hermes parser",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",