hermes-transform 0.32.1 → 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/TransformCloneSignatures.js.flow +132 -0
- package/dist/generated/TransformModifySignatures.js.flow +84 -0
- package/dist/generated/TransformReplaceSignatures.js.flow +84 -0
- package/dist/generated/node-types.js +140 -2
- package/dist/generated/node-types.js.flow +269 -6
- package/dist/generated/special-case-node-types/misc.js +1 -1
- package/dist/generated/special-case-node-types/misc.js.flow +3 -3
- package/dist/src/generated/node-types.js +140 -2
- package/dist/src/generated/special-case-node-types/misc.js +1 -1
- package/package.json +4 -4
|
@@ -133,6 +133,8 @@ var _exportNames = {
|
|
|
133
133
|
MatchExpression: true,
|
|
134
134
|
MatchExpressionCase: true,
|
|
135
135
|
MatchIdentifierPattern: true,
|
|
136
|
+
MatchInstanceObjectPattern: true,
|
|
137
|
+
MatchInstancePattern: true,
|
|
136
138
|
MatchLiteralPattern: true,
|
|
137
139
|
MatchMemberPattern: true,
|
|
138
140
|
MatchObjectPattern: true,
|
|
@@ -146,6 +148,7 @@ var _exportNames = {
|
|
|
146
148
|
MetaProperty: true,
|
|
147
149
|
MethodDefinition: true,
|
|
148
150
|
MixedTypeAnnotation: true,
|
|
151
|
+
NeverTypeAnnotation: true,
|
|
149
152
|
NewExpression: true,
|
|
150
153
|
NullableTypeAnnotation: true,
|
|
151
154
|
NullLiteralTypeAnnotation: true,
|
|
@@ -166,6 +169,13 @@ var _exportNames = {
|
|
|
166
169
|
PropertyDefinition: true,
|
|
167
170
|
QualifiedTypeIdentifier: true,
|
|
168
171
|
QualifiedTypeofIdentifier: true,
|
|
172
|
+
RecordDeclaration: true,
|
|
173
|
+
RecordDeclarationBody: true,
|
|
174
|
+
RecordDeclarationImplements: true,
|
|
175
|
+
RecordDeclarationProperty: true,
|
|
176
|
+
RecordDeclarationStaticProperty: true,
|
|
177
|
+
RecordExpression: true,
|
|
178
|
+
RecordExpressionProperties: true,
|
|
169
179
|
RestElement: true,
|
|
170
180
|
ReturnStatement: true,
|
|
171
181
|
SequenceExpression: true,
|
|
@@ -196,7 +206,9 @@ var _exportNames = {
|
|
|
196
206
|
TypeParameterInstantiation: true,
|
|
197
207
|
TypePredicate: true,
|
|
198
208
|
UnaryExpression: true,
|
|
209
|
+
UndefinedTypeAnnotation: true,
|
|
199
210
|
UnionTypeAnnotation: true,
|
|
211
|
+
UnknownTypeAnnotation: true,
|
|
200
212
|
UpdateExpression: true,
|
|
201
213
|
VariableDeclaration: true,
|
|
202
214
|
VariableDeclarator: true,
|
|
@@ -314,6 +326,8 @@ exports.MatchBindingPattern = MatchBindingPattern;
|
|
|
314
326
|
exports.MatchExpression = MatchExpression;
|
|
315
327
|
exports.MatchExpressionCase = MatchExpressionCase;
|
|
316
328
|
exports.MatchIdentifierPattern = MatchIdentifierPattern;
|
|
329
|
+
exports.MatchInstanceObjectPattern = MatchInstanceObjectPattern;
|
|
330
|
+
exports.MatchInstancePattern = MatchInstancePattern;
|
|
317
331
|
exports.MatchLiteralPattern = MatchLiteralPattern;
|
|
318
332
|
exports.MatchMemberPattern = MatchMemberPattern;
|
|
319
333
|
exports.MatchObjectPattern = MatchObjectPattern;
|
|
@@ -327,6 +341,7 @@ exports.MatchWildcardPattern = MatchWildcardPattern;
|
|
|
327
341
|
exports.MetaProperty = MetaProperty;
|
|
328
342
|
exports.MethodDefinition = MethodDefinition;
|
|
329
343
|
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
|
344
|
+
exports.NeverTypeAnnotation = NeverTypeAnnotation;
|
|
330
345
|
exports.NewExpression = NewExpression;
|
|
331
346
|
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
|
332
347
|
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
|
@@ -347,6 +362,13 @@ exports.Property = Property;
|
|
|
347
362
|
exports.PropertyDefinition = PropertyDefinition;
|
|
348
363
|
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
|
349
364
|
exports.QualifiedTypeofIdentifier = QualifiedTypeofIdentifier;
|
|
365
|
+
exports.RecordDeclaration = RecordDeclaration;
|
|
366
|
+
exports.RecordDeclarationBody = RecordDeclarationBody;
|
|
367
|
+
exports.RecordDeclarationImplements = RecordDeclarationImplements;
|
|
368
|
+
exports.RecordDeclarationProperty = RecordDeclarationProperty;
|
|
369
|
+
exports.RecordDeclarationStaticProperty = RecordDeclarationStaticProperty;
|
|
370
|
+
exports.RecordExpression = RecordExpression;
|
|
371
|
+
exports.RecordExpressionProperties = RecordExpressionProperties;
|
|
350
372
|
exports.RestElement = RestElement;
|
|
351
373
|
exports.ReturnStatement = ReturnStatement;
|
|
352
374
|
exports.SequenceExpression = SequenceExpression;
|
|
@@ -377,7 +399,9 @@ exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
|
|
377
399
|
exports.TypePredicate = TypePredicate;
|
|
378
400
|
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
|
379
401
|
exports.UnaryExpression = UnaryExpression;
|
|
402
|
+
exports.UndefinedTypeAnnotation = UndefinedTypeAnnotation;
|
|
380
403
|
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
|
404
|
+
exports.UnknownTypeAnnotation = UnknownTypeAnnotation;
|
|
381
405
|
exports.UpdateExpression = UpdateExpression;
|
|
382
406
|
exports.VariableDeclaration = VariableDeclaration;
|
|
383
407
|
exports.VariableDeclarator = VariableDeclarator;
|
|
@@ -581,7 +605,7 @@ function ClassExpression(props) {
|
|
|
581
605
|
id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
|
|
582
606
|
typeParameters: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeParameters),
|
|
583
607
|
superClass: (0, _detachedNode.asDetachedNodeForCodeGen)(props.superClass),
|
|
584
|
-
|
|
608
|
+
superTypeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.superTypeArguments),
|
|
585
609
|
implements: props.implements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
|
|
586
610
|
decorators: props.decorators.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
|
|
587
611
|
body: (0, _detachedNode.asDetachedNodeForCodeGen)(props.body)
|
|
@@ -1498,6 +1522,26 @@ function MatchIdentifierPattern(props) {
|
|
|
1498
1522
|
return node;
|
|
1499
1523
|
}
|
|
1500
1524
|
|
|
1525
|
+
function MatchInstanceObjectPattern(props) {
|
|
1526
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1527
|
+
type: 'MatchInstanceObjectPattern',
|
|
1528
|
+
properties: props.properties.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
|
|
1529
|
+
rest: (0, _detachedNode.asDetachedNodeForCodeGen)(props.rest)
|
|
1530
|
+
});
|
|
1531
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1532
|
+
return node;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
function MatchInstancePattern(props) {
|
|
1536
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1537
|
+
type: 'MatchInstancePattern',
|
|
1538
|
+
targetConstructor: (0, _detachedNode.asDetachedNodeForCodeGen)(props.targetConstructor),
|
|
1539
|
+
properties: (0, _detachedNode.asDetachedNodeForCodeGen)(props.properties)
|
|
1540
|
+
});
|
|
1541
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1542
|
+
return node;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1501
1545
|
function MatchLiteralPattern(props) {
|
|
1502
1546
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1503
1547
|
type: 'MatchLiteralPattern',
|
|
@@ -1624,6 +1668,13 @@ function MixedTypeAnnotation(props = { ...null
|
|
|
1624
1668
|
});
|
|
1625
1669
|
}
|
|
1626
1670
|
|
|
1671
|
+
function NeverTypeAnnotation(props = { ...null
|
|
1672
|
+
}) {
|
|
1673
|
+
return (0, _detachedNode.detachedProps)(props.parent, {
|
|
1674
|
+
type: 'NeverTypeAnnotation'
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1627
1678
|
function NewExpression(props) {
|
|
1628
1679
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1629
1680
|
type: 'NewExpression',
|
|
@@ -1843,6 +1894,79 @@ function QualifiedTypeofIdentifier(props) {
|
|
|
1843
1894
|
return node;
|
|
1844
1895
|
}
|
|
1845
1896
|
|
|
1897
|
+
function RecordDeclaration(props) {
|
|
1898
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1899
|
+
type: 'RecordDeclaration',
|
|
1900
|
+
id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
|
|
1901
|
+
typeParameters: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeParameters),
|
|
1902
|
+
implements: props.implements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
|
|
1903
|
+
body: (0, _detachedNode.asDetachedNodeForCodeGen)(props.body)
|
|
1904
|
+
});
|
|
1905
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1906
|
+
return node;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
function RecordDeclarationBody(props) {
|
|
1910
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1911
|
+
type: 'RecordDeclarationBody',
|
|
1912
|
+
elements: props.elements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n))
|
|
1913
|
+
});
|
|
1914
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1915
|
+
return node;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
function RecordDeclarationImplements(props) {
|
|
1919
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1920
|
+
type: 'RecordDeclarationImplements',
|
|
1921
|
+
id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
|
|
1922
|
+
typeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeArguments)
|
|
1923
|
+
});
|
|
1924
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1925
|
+
return node;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
function RecordDeclarationProperty(props) {
|
|
1929
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1930
|
+
type: 'RecordDeclarationProperty',
|
|
1931
|
+
key: (0, _detachedNode.asDetachedNodeForCodeGen)(props.key),
|
|
1932
|
+
typeAnnotation: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeAnnotation),
|
|
1933
|
+
defaultValue: (0, _detachedNode.asDetachedNodeForCodeGen)(props.defaultValue)
|
|
1934
|
+
});
|
|
1935
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1936
|
+
return node;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
function RecordDeclarationStaticProperty(props) {
|
|
1940
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1941
|
+
type: 'RecordDeclarationStaticProperty',
|
|
1942
|
+
key: (0, _detachedNode.asDetachedNodeForCodeGen)(props.key),
|
|
1943
|
+
typeAnnotation: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeAnnotation),
|
|
1944
|
+
value: (0, _detachedNode.asDetachedNodeForCodeGen)(props.value)
|
|
1945
|
+
});
|
|
1946
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1947
|
+
return node;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
function RecordExpression(props) {
|
|
1951
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1952
|
+
type: 'RecordExpression',
|
|
1953
|
+
recordConstructor: (0, _detachedNode.asDetachedNodeForCodeGen)(props.recordConstructor),
|
|
1954
|
+
typeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeArguments),
|
|
1955
|
+
properties: (0, _detachedNode.asDetachedNodeForCodeGen)(props.properties)
|
|
1956
|
+
});
|
|
1957
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1958
|
+
return node;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
function RecordExpressionProperties(props) {
|
|
1962
|
+
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1963
|
+
type: 'RecordExpressionProperties',
|
|
1964
|
+
properties: props.properties.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n))
|
|
1965
|
+
});
|
|
1966
|
+
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
1967
|
+
return node;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1846
1970
|
function RestElement(props) {
|
|
1847
1971
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1848
1972
|
type: 'RestElement',
|
|
@@ -1996,7 +2120,7 @@ function TryStatement(props) {
|
|
|
1996
2120
|
function TupleTypeAnnotation(props) {
|
|
1997
2121
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
1998
2122
|
type: 'TupleTypeAnnotation',
|
|
1999
|
-
|
|
2123
|
+
elementTypes: props.elementTypes.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
|
|
2000
2124
|
inexact: props.inexact
|
|
2001
2125
|
});
|
|
2002
2126
|
(0, _detachedNode.setParentPointersInDirectChildren)(node);
|
|
@@ -2129,6 +2253,13 @@ function UnaryExpression(props) {
|
|
|
2129
2253
|
return node;
|
|
2130
2254
|
}
|
|
2131
2255
|
|
|
2256
|
+
function UndefinedTypeAnnotation(props = { ...null
|
|
2257
|
+
}) {
|
|
2258
|
+
return (0, _detachedNode.detachedProps)(props.parent, {
|
|
2259
|
+
type: 'UndefinedTypeAnnotation'
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2132
2263
|
function UnionTypeAnnotation(props) {
|
|
2133
2264
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
2134
2265
|
type: 'UnionTypeAnnotation',
|
|
@@ -2138,6 +2269,13 @@ function UnionTypeAnnotation(props) {
|
|
|
2138
2269
|
return node;
|
|
2139
2270
|
}
|
|
2140
2271
|
|
|
2272
|
+
function UnknownTypeAnnotation(props = { ...null
|
|
2273
|
+
}) {
|
|
2274
|
+
return (0, _detachedNode.detachedProps)(props.parent, {
|
|
2275
|
+
type: 'UnknownTypeAnnotation'
|
|
2276
|
+
});
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2141
2279
|
function UpdateExpression(props) {
|
|
2142
2280
|
const node = (0, _detachedNode.detachedProps)(props.parent, {
|
|
2143
2281
|
type: 'UpdateExpression',
|
|
@@ -131,6 +131,8 @@ import type {
|
|
|
131
131
|
MatchExpression as MatchExpressionType,
|
|
132
132
|
MatchExpressionCase as MatchExpressionCaseType,
|
|
133
133
|
MatchIdentifierPattern as MatchIdentifierPatternType,
|
|
134
|
+
MatchInstanceObjectPattern as MatchInstanceObjectPatternType,
|
|
135
|
+
MatchInstancePattern as MatchInstancePatternType,
|
|
134
136
|
MatchLiteralPattern as MatchLiteralPatternType,
|
|
135
137
|
MatchMemberPattern as MatchMemberPatternType,
|
|
136
138
|
MatchObjectPattern as MatchObjectPatternType,
|
|
@@ -144,6 +146,7 @@ import type {
|
|
|
144
146
|
MetaProperty as MetaPropertyType,
|
|
145
147
|
MethodDefinition as MethodDefinitionType,
|
|
146
148
|
MixedTypeAnnotation as MixedTypeAnnotationType,
|
|
149
|
+
NeverTypeAnnotation as NeverTypeAnnotationType,
|
|
147
150
|
NewExpression as NewExpressionType,
|
|
148
151
|
NullableTypeAnnotation as NullableTypeAnnotationType,
|
|
149
152
|
NullLiteralTypeAnnotation as NullLiteralTypeAnnotationType,
|
|
@@ -164,6 +167,13 @@ import type {
|
|
|
164
167
|
PropertyDefinition as PropertyDefinitionType,
|
|
165
168
|
QualifiedTypeIdentifier as QualifiedTypeIdentifierType,
|
|
166
169
|
QualifiedTypeofIdentifier as QualifiedTypeofIdentifierType,
|
|
170
|
+
RecordDeclaration as RecordDeclarationType,
|
|
171
|
+
RecordDeclarationBody as RecordDeclarationBodyType,
|
|
172
|
+
RecordDeclarationImplements as RecordDeclarationImplementsType,
|
|
173
|
+
RecordDeclarationProperty as RecordDeclarationPropertyType,
|
|
174
|
+
RecordDeclarationStaticProperty as RecordDeclarationStaticPropertyType,
|
|
175
|
+
RecordExpression as RecordExpressionType,
|
|
176
|
+
RecordExpressionProperties as RecordExpressionPropertiesType,
|
|
167
177
|
RestElement as RestElementType,
|
|
168
178
|
ReturnStatement as ReturnStatementType,
|
|
169
179
|
SequenceExpression as SequenceExpressionType,
|
|
@@ -194,7 +204,9 @@ import type {
|
|
|
194
204
|
TypeParameterInstantiation as TypeParameterInstantiationType,
|
|
195
205
|
TypePredicate as TypePredicateType,
|
|
196
206
|
UnaryExpression as UnaryExpressionType,
|
|
207
|
+
UndefinedTypeAnnotation as UndefinedTypeAnnotationType,
|
|
197
208
|
UnionTypeAnnotation as UnionTypeAnnotationType,
|
|
209
|
+
UnknownTypeAnnotation as UnknownTypeAnnotationType,
|
|
198
210
|
UpdateExpression as UpdateExpressionType,
|
|
199
211
|
VariableDeclaration as VariableDeclarationType,
|
|
200
212
|
VariableDeclarator as VariableDeclaratorType,
|
|
@@ -304,8 +316,8 @@ export type ClassExpressionProps = {
|
|
|
304
316
|
+id?: ?MaybeDetachedNode<ClassExpressionType['id']>,
|
|
305
317
|
+typeParameters?: ?MaybeDetachedNode<ClassExpressionType['typeParameters']>,
|
|
306
318
|
+superClass?: ?MaybeDetachedNode<ClassExpressionType['superClass']>,
|
|
307
|
-
+
|
|
308
|
-
ClassExpressionType['
|
|
319
|
+
+superTypeArguments?: ?MaybeDetachedNode<
|
|
320
|
+
ClassExpressionType['superTypeArguments'],
|
|
309
321
|
>,
|
|
310
322
|
+implements: $ReadOnlyArray<
|
|
311
323
|
MaybeDetachedNode<ClassExpressionType['implements'][number]>,
|
|
@@ -856,6 +868,20 @@ export type MatchIdentifierPatternProps = {
|
|
|
856
868
|
+id: MaybeDetachedNode<MatchIdentifierPatternType['id']>,
|
|
857
869
|
};
|
|
858
870
|
|
|
871
|
+
export type MatchInstanceObjectPatternProps = {
|
|
872
|
+
+properties: $ReadOnlyArray<
|
|
873
|
+
MaybeDetachedNode<MatchInstanceObjectPatternType['properties'][number]>,
|
|
874
|
+
>,
|
|
875
|
+
+rest?: ?MaybeDetachedNode<MatchInstanceObjectPatternType['rest']>,
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
export type MatchInstancePatternProps = {
|
|
879
|
+
+targetConstructor: MaybeDetachedNode<
|
|
880
|
+
MatchInstancePatternType['targetConstructor'],
|
|
881
|
+
>,
|
|
882
|
+
+properties: MaybeDetachedNode<MatchInstancePatternType['properties']>,
|
|
883
|
+
};
|
|
884
|
+
|
|
859
885
|
export type MatchLiteralPatternProps = {
|
|
860
886
|
+literal: MaybeDetachedNode<MatchLiteralPatternType['literal']>,
|
|
861
887
|
};
|
|
@@ -923,6 +949,8 @@ export type MethodDefinitionProps = {
|
|
|
923
949
|
|
|
924
950
|
export type MixedTypeAnnotationProps = {};
|
|
925
951
|
|
|
952
|
+
export type NeverTypeAnnotationProps = {};
|
|
953
|
+
|
|
926
954
|
export type NewExpressionProps = {
|
|
927
955
|
+callee: MaybeDetachedNode<NewExpressionType['callee']>,
|
|
928
956
|
+typeArguments?: ?MaybeDetachedNode<NewExpressionType['typeArguments']>,
|
|
@@ -1066,6 +1094,60 @@ export type QualifiedTypeofIdentifierProps = {
|
|
|
1066
1094
|
+id: MaybeDetachedNode<QualifiedTypeofIdentifierType['id']>,
|
|
1067
1095
|
};
|
|
1068
1096
|
|
|
1097
|
+
export type RecordDeclarationProps = {
|
|
1098
|
+
+id: MaybeDetachedNode<RecordDeclarationType['id']>,
|
|
1099
|
+
+typeParameters?: ?MaybeDetachedNode<RecordDeclarationType['typeParameters']>,
|
|
1100
|
+
+implements: $ReadOnlyArray<
|
|
1101
|
+
MaybeDetachedNode<RecordDeclarationType['implements'][number]>,
|
|
1102
|
+
>,
|
|
1103
|
+
+body: MaybeDetachedNode<RecordDeclarationType['body']>,
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
export type RecordDeclarationBodyProps = {
|
|
1107
|
+
+elements: $ReadOnlyArray<
|
|
1108
|
+
MaybeDetachedNode<RecordDeclarationBodyType['elements'][number]>,
|
|
1109
|
+
>,
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
export type RecordDeclarationImplementsProps = {
|
|
1113
|
+
+id: MaybeDetachedNode<RecordDeclarationImplementsType['id']>,
|
|
1114
|
+
+typeArguments?: ?MaybeDetachedNode<
|
|
1115
|
+
RecordDeclarationImplementsType['typeArguments'],
|
|
1116
|
+
>,
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
export type RecordDeclarationPropertyProps = {
|
|
1120
|
+
+key: MaybeDetachedNode<RecordDeclarationPropertyType['key']>,
|
|
1121
|
+
+typeAnnotation: MaybeDetachedNode<
|
|
1122
|
+
RecordDeclarationPropertyType['typeAnnotation'],
|
|
1123
|
+
>,
|
|
1124
|
+
+defaultValue?: ?MaybeDetachedNode<
|
|
1125
|
+
RecordDeclarationPropertyType['defaultValue'],
|
|
1126
|
+
>,
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
export type RecordDeclarationStaticPropertyProps = {
|
|
1130
|
+
+key: MaybeDetachedNode<RecordDeclarationStaticPropertyType['key']>,
|
|
1131
|
+
+typeAnnotation: MaybeDetachedNode<
|
|
1132
|
+
RecordDeclarationStaticPropertyType['typeAnnotation'],
|
|
1133
|
+
>,
|
|
1134
|
+
+value: MaybeDetachedNode<RecordDeclarationStaticPropertyType['value']>,
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
export type RecordExpressionProps = {
|
|
1138
|
+
+recordConstructor: MaybeDetachedNode<
|
|
1139
|
+
RecordExpressionType['recordConstructor'],
|
|
1140
|
+
>,
|
|
1141
|
+
+typeArguments?: ?MaybeDetachedNode<RecordExpressionType['typeArguments']>,
|
|
1142
|
+
+properties: MaybeDetachedNode<RecordExpressionType['properties']>,
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
export type RecordExpressionPropertiesProps = {
|
|
1146
|
+
+properties: $ReadOnlyArray<
|
|
1147
|
+
MaybeDetachedNode<RecordExpressionPropertiesType['properties'][number]>,
|
|
1148
|
+
>,
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1069
1151
|
export type RestElementProps = {
|
|
1070
1152
|
+argument: MaybeDetachedNode<RestElementType['argument']>,
|
|
1071
1153
|
};
|
|
@@ -1142,8 +1224,8 @@ export type TryStatementProps = {
|
|
|
1142
1224
|
};
|
|
1143
1225
|
|
|
1144
1226
|
export type TupleTypeAnnotationProps = {
|
|
1145
|
-
+
|
|
1146
|
-
MaybeDetachedNode<TupleTypeAnnotationType['
|
|
1227
|
+
+elementTypes: $ReadOnlyArray<
|
|
1228
|
+
MaybeDetachedNode<TupleTypeAnnotationType['elementTypes'][number]>,
|
|
1147
1229
|
>,
|
|
1148
1230
|
+inexact: TupleTypeAnnotationType['inexact'],
|
|
1149
1231
|
};
|
|
@@ -1222,12 +1304,16 @@ export type UnaryExpressionProps = {
|
|
|
1222
1304
|
+prefix: UnaryExpressionType['prefix'],
|
|
1223
1305
|
};
|
|
1224
1306
|
|
|
1307
|
+
export type UndefinedTypeAnnotationProps = {};
|
|
1308
|
+
|
|
1225
1309
|
export type UnionTypeAnnotationProps = {
|
|
1226
1310
|
+types: $ReadOnlyArray<
|
|
1227
1311
|
MaybeDetachedNode<UnionTypeAnnotationType['types'][number]>,
|
|
1228
1312
|
>,
|
|
1229
1313
|
};
|
|
1230
1314
|
|
|
1315
|
+
export type UnknownTypeAnnotationProps = {};
|
|
1316
|
+
|
|
1231
1317
|
export type UpdateExpressionProps = {
|
|
1232
1318
|
+operator: UpdateExpressionType['operator'],
|
|
1233
1319
|
+argument: MaybeDetachedNode<UpdateExpressionType['argument']>,
|
|
@@ -1528,7 +1614,7 @@ export function ClassExpression(props: {
|
|
|
1528
1614
|
id: asDetachedNodeForCodeGen(props.id),
|
|
1529
1615
|
typeParameters: asDetachedNodeForCodeGen(props.typeParameters),
|
|
1530
1616
|
superClass: asDetachedNodeForCodeGen(props.superClass),
|
|
1531
|
-
|
|
1617
|
+
superTypeArguments: asDetachedNodeForCodeGen(props.superTypeArguments),
|
|
1532
1618
|
implements: props.implements.map(n => asDetachedNodeForCodeGen(n)),
|
|
1533
1619
|
decorators: props.decorators.map(n => asDetachedNodeForCodeGen(n)),
|
|
1534
1620
|
body: asDetachedNodeForCodeGen(props.body),
|
|
@@ -2833,6 +2919,38 @@ export function MatchIdentifierPattern(props: {
|
|
|
2833
2919
|
return node;
|
|
2834
2920
|
}
|
|
2835
2921
|
|
|
2922
|
+
export function MatchInstanceObjectPattern(props: {
|
|
2923
|
+
...MatchInstanceObjectPatternProps,
|
|
2924
|
+
+parent?: ESNode,
|
|
2925
|
+
}): DetachedNode<MatchInstanceObjectPatternType> {
|
|
2926
|
+
const node = detachedProps<MatchInstanceObjectPatternType>(
|
|
2927
|
+
(props.parent: $FlowFixMe),
|
|
2928
|
+
{
|
|
2929
|
+
type: 'MatchInstanceObjectPattern',
|
|
2930
|
+
properties: props.properties.map(n => asDetachedNodeForCodeGen(n)),
|
|
2931
|
+
rest: asDetachedNodeForCodeGen(props.rest),
|
|
2932
|
+
},
|
|
2933
|
+
);
|
|
2934
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
2935
|
+
return node;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
export function MatchInstancePattern(props: {
|
|
2939
|
+
...MatchInstancePatternProps,
|
|
2940
|
+
+parent?: ESNode,
|
|
2941
|
+
}): DetachedNode<MatchInstancePatternType> {
|
|
2942
|
+
const node = detachedProps<MatchInstancePatternType>(
|
|
2943
|
+
(props.parent: $FlowFixMe),
|
|
2944
|
+
{
|
|
2945
|
+
type: 'MatchInstancePattern',
|
|
2946
|
+
targetConstructor: asDetachedNodeForCodeGen(props.targetConstructor),
|
|
2947
|
+
properties: asDetachedNodeForCodeGen(props.properties),
|
|
2948
|
+
},
|
|
2949
|
+
);
|
|
2950
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
2951
|
+
return node;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2836
2954
|
export function MatchLiteralPattern(props: {
|
|
2837
2955
|
...MatchLiteralPatternProps,
|
|
2838
2956
|
+parent?: ESNode,
|
|
@@ -3016,6 +3134,16 @@ export function MixedTypeAnnotation(
|
|
|
3016
3134
|
});
|
|
3017
3135
|
}
|
|
3018
3136
|
|
|
3137
|
+
export function NeverTypeAnnotation(
|
|
3138
|
+
props: {
|
|
3139
|
+
+parent?: ESNode,
|
|
3140
|
+
} = {...null},
|
|
3141
|
+
): DetachedNode<NeverTypeAnnotationType> {
|
|
3142
|
+
return detachedProps<NeverTypeAnnotationType>((props.parent: $FlowFixMe), {
|
|
3143
|
+
type: 'NeverTypeAnnotation',
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3019
3147
|
export function NewExpression(props: {
|
|
3020
3148
|
...NewExpressionProps,
|
|
3021
3149
|
+parent?: ESNode,
|
|
@@ -3339,6 +3467,118 @@ export function QualifiedTypeofIdentifier(props: {
|
|
|
3339
3467
|
return node;
|
|
3340
3468
|
}
|
|
3341
3469
|
|
|
3470
|
+
export function RecordDeclaration(props: {
|
|
3471
|
+
...RecordDeclarationProps,
|
|
3472
|
+
+parent?: ESNode,
|
|
3473
|
+
}): DetachedNode<RecordDeclarationType> {
|
|
3474
|
+
const node = detachedProps<RecordDeclarationType>(
|
|
3475
|
+
(props.parent: $FlowFixMe),
|
|
3476
|
+
{
|
|
3477
|
+
type: 'RecordDeclaration',
|
|
3478
|
+
id: asDetachedNodeForCodeGen(props.id),
|
|
3479
|
+
typeParameters: asDetachedNodeForCodeGen(props.typeParameters),
|
|
3480
|
+
implements: props.implements.map(n => asDetachedNodeForCodeGen(n)),
|
|
3481
|
+
body: asDetachedNodeForCodeGen(props.body),
|
|
3482
|
+
},
|
|
3483
|
+
);
|
|
3484
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3485
|
+
return node;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
export function RecordDeclarationBody(props: {
|
|
3489
|
+
...RecordDeclarationBodyProps,
|
|
3490
|
+
+parent?: ESNode,
|
|
3491
|
+
}): DetachedNode<RecordDeclarationBodyType> {
|
|
3492
|
+
const node = detachedProps<RecordDeclarationBodyType>(
|
|
3493
|
+
(props.parent: $FlowFixMe),
|
|
3494
|
+
{
|
|
3495
|
+
type: 'RecordDeclarationBody',
|
|
3496
|
+
elements: props.elements.map(n => asDetachedNodeForCodeGen(n)),
|
|
3497
|
+
},
|
|
3498
|
+
);
|
|
3499
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3500
|
+
return node;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
export function RecordDeclarationImplements(props: {
|
|
3504
|
+
...RecordDeclarationImplementsProps,
|
|
3505
|
+
+parent?: ESNode,
|
|
3506
|
+
}): DetachedNode<RecordDeclarationImplementsType> {
|
|
3507
|
+
const node = detachedProps<RecordDeclarationImplementsType>(
|
|
3508
|
+
(props.parent: $FlowFixMe),
|
|
3509
|
+
{
|
|
3510
|
+
type: 'RecordDeclarationImplements',
|
|
3511
|
+
id: asDetachedNodeForCodeGen(props.id),
|
|
3512
|
+
typeArguments: asDetachedNodeForCodeGen(props.typeArguments),
|
|
3513
|
+
},
|
|
3514
|
+
);
|
|
3515
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3516
|
+
return node;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3519
|
+
export function RecordDeclarationProperty(props: {
|
|
3520
|
+
...RecordDeclarationPropertyProps,
|
|
3521
|
+
+parent?: ESNode,
|
|
3522
|
+
}): DetachedNode<RecordDeclarationPropertyType> {
|
|
3523
|
+
const node = detachedProps<RecordDeclarationPropertyType>(
|
|
3524
|
+
(props.parent: $FlowFixMe),
|
|
3525
|
+
{
|
|
3526
|
+
type: 'RecordDeclarationProperty',
|
|
3527
|
+
key: asDetachedNodeForCodeGen(props.key),
|
|
3528
|
+
typeAnnotation: asDetachedNodeForCodeGen(props.typeAnnotation),
|
|
3529
|
+
defaultValue: asDetachedNodeForCodeGen(props.defaultValue),
|
|
3530
|
+
},
|
|
3531
|
+
);
|
|
3532
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3533
|
+
return node;
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
export function RecordDeclarationStaticProperty(props: {
|
|
3537
|
+
...RecordDeclarationStaticPropertyProps,
|
|
3538
|
+
+parent?: ESNode,
|
|
3539
|
+
}): DetachedNode<RecordDeclarationStaticPropertyType> {
|
|
3540
|
+
const node = detachedProps<RecordDeclarationStaticPropertyType>(
|
|
3541
|
+
(props.parent: $FlowFixMe),
|
|
3542
|
+
{
|
|
3543
|
+
type: 'RecordDeclarationStaticProperty',
|
|
3544
|
+
key: asDetachedNodeForCodeGen(props.key),
|
|
3545
|
+
typeAnnotation: asDetachedNodeForCodeGen(props.typeAnnotation),
|
|
3546
|
+
value: asDetachedNodeForCodeGen(props.value),
|
|
3547
|
+
},
|
|
3548
|
+
);
|
|
3549
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3550
|
+
return node;
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
export function RecordExpression(props: {
|
|
3554
|
+
...RecordExpressionProps,
|
|
3555
|
+
+parent?: ESNode,
|
|
3556
|
+
}): DetachedNode<RecordExpressionType> {
|
|
3557
|
+
const node = detachedProps<RecordExpressionType>((props.parent: $FlowFixMe), {
|
|
3558
|
+
type: 'RecordExpression',
|
|
3559
|
+
recordConstructor: asDetachedNodeForCodeGen(props.recordConstructor),
|
|
3560
|
+
typeArguments: asDetachedNodeForCodeGen(props.typeArguments),
|
|
3561
|
+
properties: asDetachedNodeForCodeGen(props.properties),
|
|
3562
|
+
});
|
|
3563
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3564
|
+
return node;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
export function RecordExpressionProperties(props: {
|
|
3568
|
+
...RecordExpressionPropertiesProps,
|
|
3569
|
+
+parent?: ESNode,
|
|
3570
|
+
}): DetachedNode<RecordExpressionPropertiesType> {
|
|
3571
|
+
const node = detachedProps<RecordExpressionPropertiesType>(
|
|
3572
|
+
(props.parent: $FlowFixMe),
|
|
3573
|
+
{
|
|
3574
|
+
type: 'RecordExpressionProperties',
|
|
3575
|
+
properties: props.properties.map(n => asDetachedNodeForCodeGen(n)),
|
|
3576
|
+
},
|
|
3577
|
+
);
|
|
3578
|
+
setParentPointersInDirectChildren((node: $FlowFixMe));
|
|
3579
|
+
return node;
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3342
3582
|
export function RestElement(props: {
|
|
3343
3583
|
...RestElementProps,
|
|
3344
3584
|
+parent?: ESNode,
|
|
@@ -3557,7 +3797,7 @@ export function TupleTypeAnnotation(props: {
|
|
|
3557
3797
|
(props.parent: $FlowFixMe),
|
|
3558
3798
|
{
|
|
3559
3799
|
type: 'TupleTypeAnnotation',
|
|
3560
|
-
|
|
3800
|
+
elementTypes: props.elementTypes.map(n => asDetachedNodeForCodeGen(n)),
|
|
3561
3801
|
inexact: props.inexact,
|
|
3562
3802
|
},
|
|
3563
3803
|
);
|
|
@@ -3745,6 +3985,19 @@ export function UnaryExpression(props: {
|
|
|
3745
3985
|
return node;
|
|
3746
3986
|
}
|
|
3747
3987
|
|
|
3988
|
+
export function UndefinedTypeAnnotation(
|
|
3989
|
+
props: {
|
|
3990
|
+
+parent?: ESNode,
|
|
3991
|
+
} = {...null},
|
|
3992
|
+
): DetachedNode<UndefinedTypeAnnotationType> {
|
|
3993
|
+
return detachedProps<UndefinedTypeAnnotationType>(
|
|
3994
|
+
(props.parent: $FlowFixMe),
|
|
3995
|
+
{
|
|
3996
|
+
type: 'UndefinedTypeAnnotation',
|
|
3997
|
+
},
|
|
3998
|
+
);
|
|
3999
|
+
}
|
|
4000
|
+
|
|
3748
4001
|
export function UnionTypeAnnotation(props: {
|
|
3749
4002
|
...UnionTypeAnnotationProps,
|
|
3750
4003
|
+parent?: ESNode,
|
|
@@ -3760,6 +4013,16 @@ export function UnionTypeAnnotation(props: {
|
|
|
3760
4013
|
return node;
|
|
3761
4014
|
}
|
|
3762
4015
|
|
|
4016
|
+
export function UnknownTypeAnnotation(
|
|
4017
|
+
props: {
|
|
4018
|
+
+parent?: ESNode,
|
|
4019
|
+
} = {...null},
|
|
4020
|
+
): DetachedNode<UnknownTypeAnnotationType> {
|
|
4021
|
+
return detachedProps<UnknownTypeAnnotationType>((props.parent: $FlowFixMe), {
|
|
4022
|
+
type: 'UnknownTypeAnnotation',
|
|
4023
|
+
});
|
|
4024
|
+
}
|
|
4025
|
+
|
|
3763
4026
|
export function UpdateExpression(props: {
|
|
3764
4027
|
...UpdateExpressionProps,
|
|
3765
4028
|
+parent?: ESNode,
|
|
@@ -55,7 +55,7 @@ function ClassDeclaration(props) {
|
|
|
55
55
|
// $FlowFixMe[incompatible-type]
|
|
56
56
|
superClass: (0, _detachedNode.asDetachedNode)(props.superClass),
|
|
57
57
|
// $FlowFixMe[incompatible-type]
|
|
58
|
-
|
|
58
|
+
superTypeArguments: (0, _detachedNode.asDetachedNode)(props.superTypeArguments),
|
|
59
59
|
decorators: ((_props$decorators = props.decorators) != null ? _props$decorators : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
|
|
60
60
|
implements: ((_props$implements = props.implements) != null ? _props$implements : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
|
|
61
61
|
body: (0, _detachedNode.asDetachedNode)(props.body)
|
|
@@ -81,8 +81,8 @@ export type ClassDeclarationProps = {
|
|
|
81
81
|
+id?: ?MaybeDetachedNode<ClassDeclarationType['id']>,
|
|
82
82
|
+typeParameters?: ?MaybeDetachedNode<ClassDeclarationType['typeParameters']>,
|
|
83
83
|
+superClass?: ?MaybeDetachedNode<ClassDeclarationType['superClass']>,
|
|
84
|
-
+
|
|
85
|
-
ClassDeclarationType['
|
|
84
|
+
+superTypeArguments?: ?MaybeDetachedNode<
|
|
85
|
+
ClassDeclarationType['superTypeArguments'],
|
|
86
86
|
>,
|
|
87
87
|
// make this optional as it's rarer that people would want to include them
|
|
88
88
|
+implements?: $ReadOnlyArray<
|
|
@@ -107,7 +107,7 @@ export function ClassDeclaration(props: {
|
|
|
107
107
|
// $FlowFixMe[incompatible-type]
|
|
108
108
|
superClass: asDetachedNode(props.superClass),
|
|
109
109
|
// $FlowFixMe[incompatible-type]
|
|
110
|
-
|
|
110
|
+
superTypeArguments: asDetachedNode(props.superTypeArguments),
|
|
111
111
|
decorators: (props.decorators ?? []).map(n => asDetachedNode(n)),
|
|
112
112
|
implements: (props.implements ?? []).map(n => asDetachedNode(n)),
|
|
113
113
|
body: asDetachedNode(props.body),
|