ast-types 0.14.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +1 -1
- package/README.md +1 -1
- package/def/babel-core.js +48 -28
- package/def/babel.js +15 -2
- package/def/core.js +8 -26
- package/def/es-proposals.js +32 -4
- package/def/es2016.js +6 -12
- package/def/es2017.js +3 -3
- package/def/es2018.js +3 -3
- package/def/es2019.js +3 -3
- package/def/es2020.js +23 -12
- package/def/{es7.d.ts → es2021.d.ts} +0 -0
- package/def/es2021.js +13 -0
- package/def/es2022.d.ts +2 -0
- package/def/es2022.js +16 -0
- package/def/es6.js +3 -3
- package/def/esprima.js +4 -4
- package/def/flow.js +15 -4
- package/def/jsx.js +4 -4
- package/def/operators/core.d.ts +5 -0
- package/def/operators/core.js +25 -0
- package/def/operators/es2016.d.ts +5 -0
- package/def/operators/es2016.js +19 -0
- package/def/operators/es2020.d.ts +5 -0
- package/def/operators/es2020.js +15 -0
- package/def/operators/es2021.d.ts +5 -0
- package/def/operators/es2021.js +18 -0
- package/def/type-annotations.js +2 -2
- package/def/typescript.js +11 -4
- package/fork.d.ts +3 -2
- package/fork.js +7 -7
- package/gen/builders.d.ts +200 -100
- package/gen/kinds.d.ts +28 -15
- package/gen/namedTypes.d.ts +143 -49
- package/gen/visitor.d.ts +18 -5
- package/lib/equiv.js +1 -1
- package/lib/node-path.js +3 -3
- package/lib/path-visitor.js +2 -2
- package/lib/path.d.ts +3 -3
- package/lib/path.js +1 -1
- package/lib/scope.d.ts +3 -2
- package/lib/scope.js +63 -26
- package/lib/shared.js +1 -1
- package/lib/types.d.ts +1 -0
- package/lib/types.js +10 -6
- package/main.d.ts +1 -0
- package/main.js +9 -25
- package/package.json +15 -15
- package/types.d.ts +0 -1
- package/def/core-operators.d.ts +0 -3
- package/def/core-operators.js +0 -20
- package/def/es7.js +0 -34
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var es2020_1 = (0, tslib_1.__importDefault)(require("./es2020"));
|
|
5
|
+
function default_1(fork) {
|
|
6
|
+
var result = fork.use(es2020_1.default);
|
|
7
|
+
// Logical assignment operators. Must run before AssignmentOperators is used.
|
|
8
|
+
// https://github.com/tc39/proposal-logical-assignment
|
|
9
|
+
result.LogicalOperators.forEach(function (op) {
|
|
10
|
+
var assignOp = op + "=";
|
|
11
|
+
if (result.AssignmentOperators.indexOf(assignOp) < 0) {
|
|
12
|
+
result.AssignmentOperators.push(assignOp);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
exports.default = default_1;
|
|
18
|
+
module.exports = exports["default"];
|
package/def/type-annotations.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
var tslib_1 = require("tslib");
|
|
9
|
-
var types_1 = tslib_1.__importDefault(require("../lib/types"));
|
|
10
|
-
var shared_1 = tslib_1.__importDefault(require("../lib/shared"));
|
|
9
|
+
var types_1 = (0, tslib_1.__importDefault)(require("../lib/types"));
|
|
10
|
+
var shared_1 = (0, tslib_1.__importDefault)(require("../lib/shared"));
|
|
11
11
|
function default_1(fork) {
|
|
12
12
|
var types = fork.use(types_1.default);
|
|
13
13
|
var def = types.Type.def;
|
package/def/typescript.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";;
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
var babel_core_1 = tslib_1.__importDefault(require("./babel-core"));
|
|
5
|
-
var type_annotations_1 = tslib_1.__importDefault(require("./type-annotations"));
|
|
6
|
-
var types_1 = tslib_1.__importDefault(require("../lib/types"));
|
|
7
|
-
var shared_1 = tslib_1.__importDefault(require("../lib/shared"));
|
|
4
|
+
var babel_core_1 = (0, tslib_1.__importDefault)(require("./babel-core"));
|
|
5
|
+
var type_annotations_1 = (0, tslib_1.__importDefault)(require("./type-annotations"));
|
|
6
|
+
var types_1 = (0, tslib_1.__importDefault)(require("../lib/types"));
|
|
7
|
+
var shared_1 = (0, tslib_1.__importDefault)(require("../lib/shared"));
|
|
8
8
|
function default_1(fork) {
|
|
9
9
|
// Since TypeScript is parsed by Babylon, include the core Babylon types
|
|
10
10
|
// but omit the Flow-related types.
|
|
@@ -74,6 +74,7 @@ function default_1(fork) {
|
|
|
74
74
|
"TSUndefinedKeyword",
|
|
75
75
|
"TSUnknownKeyword",
|
|
76
76
|
"TSVoidKeyword",
|
|
77
|
+
"TSIntrinsicKeyword",
|
|
77
78
|
"TSThisType",
|
|
78
79
|
].forEach(function (keywordType) {
|
|
79
80
|
def(keywordType)
|
|
@@ -88,6 +89,12 @@ function default_1(fork) {
|
|
|
88
89
|
.bases("TSType")
|
|
89
90
|
.build("literal")
|
|
90
91
|
.field("literal", or(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression")));
|
|
92
|
+
def("TemplateLiteral")
|
|
93
|
+
// The TemplateLiteral type appears to be reused for TypeScript template
|
|
94
|
+
// literal types (instead of introducing a new TSTemplateLiteralType type),
|
|
95
|
+
// so we allow the templateLiteral.expressions array to be either all
|
|
96
|
+
// expressions or all TypeScript types.
|
|
97
|
+
.field("expressions", or([def("Expression")], [def("TSType")]));
|
|
91
98
|
["TSUnionType",
|
|
92
99
|
"TSIntersectionType",
|
|
93
100
|
].forEach(function (typeName) {
|
package/fork.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function (
|
|
1
|
+
import { Plugin } from "./types";
|
|
2
|
+
export default function (plugins: Plugin<any>[]): {
|
|
3
3
|
Type: {
|
|
4
4
|
or(...types: any[]): import("./lib/types").Type<any>;
|
|
5
5
|
from<T>(value: any, name?: string | undefined): import("./lib/types").Type<T>;
|
|
@@ -19,6 +19,7 @@ export default function (defs: Def[]): {
|
|
|
19
19
|
boolean: import("./lib/types").Type<boolean>;
|
|
20
20
|
null: import("./lib/types").Type<null>;
|
|
21
21
|
undefined: import("./lib/types").Type<undefined>;
|
|
22
|
+
BigInt: import("./lib/types").Type<BigInt>;
|
|
22
23
|
};
|
|
23
24
|
namedTypes: import("./gen/namedTypes").NamedTypes;
|
|
24
25
|
builders: import("./gen/builders").builders;
|
package/fork.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";;
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
-
var types_1 = tslib_1.__importDefault(require("./lib/types"));
|
|
5
|
-
var path_visitor_1 = tslib_1.__importDefault(require("./lib/path-visitor"));
|
|
6
|
-
var equiv_1 = tslib_1.__importDefault(require("./lib/equiv"));
|
|
7
|
-
var path_1 = tslib_1.__importDefault(require("./lib/path"));
|
|
8
|
-
var node_path_1 = tslib_1.__importDefault(require("./lib/node-path"));
|
|
9
|
-
function default_1(
|
|
4
|
+
var types_1 = (0, tslib_1.__importDefault)(require("./lib/types"));
|
|
5
|
+
var path_visitor_1 = (0, tslib_1.__importDefault)(require("./lib/path-visitor"));
|
|
6
|
+
var equiv_1 = (0, tslib_1.__importDefault)(require("./lib/equiv"));
|
|
7
|
+
var path_1 = (0, tslib_1.__importDefault)(require("./lib/path"));
|
|
8
|
+
var node_path_1 = (0, tslib_1.__importDefault)(require("./lib/node-path"));
|
|
9
|
+
function default_1(plugins) {
|
|
10
10
|
var fork = createFork();
|
|
11
11
|
var types = fork.use(types_1.default);
|
|
12
|
-
|
|
12
|
+
plugins.forEach(fork.use);
|
|
13
13
|
types.finalize();
|
|
14
14
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
15
15
|
return {
|
package/gen/builders.d.ts
CHANGED
|
@@ -292,15 +292,11 @@ export interface PropertyBuilder {
|
|
|
292
292
|
}): namedTypes.Property;
|
|
293
293
|
}
|
|
294
294
|
export interface LiteralBuilder {
|
|
295
|
-
(value: string | boolean | null | number | RegExp): namedTypes.Literal;
|
|
295
|
+
(value: string | boolean | null | number | RegExp | BigInt): namedTypes.Literal;
|
|
296
296
|
from(params: {
|
|
297
297
|
comments?: K.CommentKind[] | null;
|
|
298
298
|
loc?: K.SourceLocationKind | null;
|
|
299
|
-
|
|
300
|
-
pattern: string;
|
|
301
|
-
flags: string;
|
|
302
|
-
} | null;
|
|
303
|
-
value: string | boolean | null | number | RegExp;
|
|
299
|
+
value: string | boolean | null | number | RegExp | BigInt;
|
|
304
300
|
}): namedTypes.Literal;
|
|
305
301
|
}
|
|
306
302
|
export interface SequenceExpressionBuilder {
|
|
@@ -332,12 +328,12 @@ export interface BinaryExpressionBuilder {
|
|
|
332
328
|
}): namedTypes.BinaryExpression;
|
|
333
329
|
}
|
|
334
330
|
export interface AssignmentExpressionBuilder {
|
|
335
|
-
(operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=", left: K.PatternKind | K.MemberExpressionKind, right: K.ExpressionKind): namedTypes.AssignmentExpression;
|
|
331
|
+
(operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??=", left: K.PatternKind | K.MemberExpressionKind, right: K.ExpressionKind): namedTypes.AssignmentExpression;
|
|
336
332
|
from(params: {
|
|
337
333
|
comments?: K.CommentKind[] | null;
|
|
338
334
|
left: K.PatternKind | K.MemberExpressionKind;
|
|
339
335
|
loc?: K.SourceLocationKind | null;
|
|
340
|
-
operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=";
|
|
336
|
+
operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??=";
|
|
341
337
|
right: K.ExpressionKind;
|
|
342
338
|
}): namedTypes.AssignmentExpression;
|
|
343
339
|
}
|
|
@@ -348,6 +344,7 @@ export interface MemberExpressionBuilder {
|
|
|
348
344
|
computed?: boolean;
|
|
349
345
|
loc?: K.SourceLocationKind | null;
|
|
350
346
|
object: K.ExpressionKind;
|
|
347
|
+
optional?: boolean;
|
|
351
348
|
property: K.IdentifierKind | K.ExpressionKind;
|
|
352
349
|
}): namedTypes.MemberExpression;
|
|
353
350
|
}
|
|
@@ -398,6 +395,7 @@ export interface CallExpressionBuilder {
|
|
|
398
395
|
callee: K.ExpressionKind;
|
|
399
396
|
comments?: K.CommentKind[] | null;
|
|
400
397
|
loc?: K.SourceLocationKind | null;
|
|
398
|
+
optional?: boolean;
|
|
401
399
|
typeArguments?: null | K.TypeParameterInstantiationKind;
|
|
402
400
|
}): namedTypes.CallExpression;
|
|
403
401
|
}
|
|
@@ -669,6 +667,7 @@ export interface ImportNamespaceSpecifierBuilder {
|
|
|
669
667
|
export interface ImportDeclarationBuilder {
|
|
670
668
|
(specifiers: (K.ImportSpecifierKind | K.ImportNamespaceSpecifierKind | K.ImportDefaultSpecifierKind)[] | undefined, source: K.LiteralKind, importKind?: "value" | "type" | "typeof"): namedTypes.ImportDeclaration;
|
|
671
669
|
from(params: {
|
|
670
|
+
assertions?: K.ImportAttributeKind[];
|
|
672
671
|
comments?: K.CommentKind[] | null;
|
|
673
672
|
importKind?: "value" | "type" | "typeof";
|
|
674
673
|
loc?: K.SourceLocationKind | null;
|
|
@@ -679,6 +678,7 @@ export interface ImportDeclarationBuilder {
|
|
|
679
678
|
export interface ExportNamedDeclarationBuilder {
|
|
680
679
|
(declaration: K.DeclarationKind | null, specifiers?: K.ExportSpecifierKind[], source?: K.LiteralKind | null): namedTypes.ExportNamedDeclaration;
|
|
681
680
|
from(params: {
|
|
681
|
+
assertions?: K.ImportAttributeKind[];
|
|
682
682
|
comments?: K.CommentKind[] | null;
|
|
683
683
|
declaration: K.DeclarationKind | null;
|
|
684
684
|
loc?: K.SourceLocationKind | null;
|
|
@@ -708,6 +708,7 @@ export interface ExportDefaultDeclarationBuilder {
|
|
|
708
708
|
export interface ExportAllDeclarationBuilder {
|
|
709
709
|
(source: K.LiteralKind, exported: K.IdentifierKind | null): namedTypes.ExportAllDeclaration;
|
|
710
710
|
from(params: {
|
|
711
|
+
assertions?: K.ImportAttributeKind[];
|
|
711
712
|
comments?: K.CommentKind[] | null;
|
|
712
713
|
exported: K.IdentifierKind | null;
|
|
713
714
|
loc?: K.SourceLocationKind | null;
|
|
@@ -724,10 +725,10 @@ export interface TaggedTemplateExpressionBuilder {
|
|
|
724
725
|
}): namedTypes.TaggedTemplateExpression;
|
|
725
726
|
}
|
|
726
727
|
export interface TemplateLiteralBuilder {
|
|
727
|
-
(quasis: K.TemplateElementKind[], expressions: K.ExpressionKind[]): namedTypes.TemplateLiteral;
|
|
728
|
+
(quasis: K.TemplateElementKind[], expressions: K.ExpressionKind[] | K.TSTypeKind[]): namedTypes.TemplateLiteral;
|
|
728
729
|
from(params: {
|
|
729
730
|
comments?: K.CommentKind[] | null;
|
|
730
|
-
expressions: K.ExpressionKind[];
|
|
731
|
+
expressions: K.ExpressionKind[] | K.TSTypeKind[];
|
|
731
732
|
loc?: K.SourceLocationKind | null;
|
|
732
733
|
quasis: K.TemplateElementKind[];
|
|
733
734
|
}): namedTypes.TemplateLiteral;
|
|
@@ -789,16 +790,13 @@ export interface ImportExpressionBuilder {
|
|
|
789
790
|
source: K.ExpressionKind;
|
|
790
791
|
}): namedTypes.ImportExpression;
|
|
791
792
|
}
|
|
792
|
-
export interface
|
|
793
|
-
(
|
|
793
|
+
export interface ChainExpressionBuilder {
|
|
794
|
+
(expression: K.ChainElementKind): namedTypes.ChainExpression;
|
|
794
795
|
from(params: {
|
|
795
796
|
comments?: K.CommentKind[] | null;
|
|
796
|
-
|
|
797
|
+
expression: K.ChainElementKind;
|
|
797
798
|
loc?: K.SourceLocationKind | null;
|
|
798
|
-
|
|
799
|
-
optional?: boolean;
|
|
800
|
-
property: K.IdentifierKind | K.ExpressionKind;
|
|
801
|
-
}): namedTypes.OptionalMemberExpression;
|
|
799
|
+
}): namedTypes.ChainExpression;
|
|
802
800
|
}
|
|
803
801
|
export interface OptionalCallExpressionBuilder {
|
|
804
802
|
(callee: K.ExpressionKind, argumentsParam: (K.ExpressionKind | K.SpreadElementKind)[], optional?: boolean): namedTypes.OptionalCallExpression;
|
|
@@ -811,6 +809,111 @@ export interface OptionalCallExpressionBuilder {
|
|
|
811
809
|
typeArguments?: null | K.TypeParameterInstantiationKind;
|
|
812
810
|
}): namedTypes.OptionalCallExpression;
|
|
813
811
|
}
|
|
812
|
+
export interface OptionalMemberExpressionBuilder {
|
|
813
|
+
(object: K.ExpressionKind, property: K.IdentifierKind | K.ExpressionKind, computed?: boolean, optional?: boolean): namedTypes.OptionalMemberExpression;
|
|
814
|
+
from(params: {
|
|
815
|
+
comments?: K.CommentKind[] | null;
|
|
816
|
+
computed?: boolean;
|
|
817
|
+
loc?: K.SourceLocationKind | null;
|
|
818
|
+
object: K.ExpressionKind;
|
|
819
|
+
optional?: boolean;
|
|
820
|
+
property: K.IdentifierKind | K.ExpressionKind;
|
|
821
|
+
}): namedTypes.OptionalMemberExpression;
|
|
822
|
+
}
|
|
823
|
+
export interface StaticBlockBuilder {
|
|
824
|
+
(body: K.StatementKind[]): namedTypes.StaticBlock;
|
|
825
|
+
from(params: {
|
|
826
|
+
body: K.StatementKind[];
|
|
827
|
+
comments?: K.CommentKind[] | null;
|
|
828
|
+
loc?: K.SourceLocationKind | null;
|
|
829
|
+
}): namedTypes.StaticBlock;
|
|
830
|
+
}
|
|
831
|
+
export interface DecoratorBuilder {
|
|
832
|
+
(expression: K.ExpressionKind): namedTypes.Decorator;
|
|
833
|
+
from(params: {
|
|
834
|
+
comments?: K.CommentKind[] | null;
|
|
835
|
+
expression: K.ExpressionKind;
|
|
836
|
+
loc?: K.SourceLocationKind | null;
|
|
837
|
+
}): namedTypes.Decorator;
|
|
838
|
+
}
|
|
839
|
+
export interface PrivateNameBuilder {
|
|
840
|
+
(id: K.IdentifierKind): namedTypes.PrivateName;
|
|
841
|
+
from(params: {
|
|
842
|
+
comments?: K.CommentKind[] | null;
|
|
843
|
+
id: K.IdentifierKind;
|
|
844
|
+
loc?: K.SourceLocationKind | null;
|
|
845
|
+
}): namedTypes.PrivateName;
|
|
846
|
+
}
|
|
847
|
+
export interface ClassPrivatePropertyBuilder {
|
|
848
|
+
(key: K.PrivateNameKind, value?: K.ExpressionKind | null): namedTypes.ClassPrivateProperty;
|
|
849
|
+
from(params: {
|
|
850
|
+
access?: "public" | "private" | "protected" | undefined;
|
|
851
|
+
comments?: K.CommentKind[] | null;
|
|
852
|
+
computed?: boolean;
|
|
853
|
+
key: K.PrivateNameKind;
|
|
854
|
+
loc?: K.SourceLocationKind | null;
|
|
855
|
+
static?: boolean;
|
|
856
|
+
typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null;
|
|
857
|
+
value?: K.ExpressionKind | null;
|
|
858
|
+
variance?: K.VarianceKind | "plus" | "minus" | null;
|
|
859
|
+
}): namedTypes.ClassPrivateProperty;
|
|
860
|
+
}
|
|
861
|
+
export interface ImportAttributeBuilder {
|
|
862
|
+
(key: K.IdentifierKind | K.LiteralKind, value: K.ExpressionKind): namedTypes.ImportAttribute;
|
|
863
|
+
from(params: {
|
|
864
|
+
comments?: K.CommentKind[] | null;
|
|
865
|
+
key: K.IdentifierKind | K.LiteralKind;
|
|
866
|
+
loc?: K.SourceLocationKind | null;
|
|
867
|
+
value: K.ExpressionKind;
|
|
868
|
+
}): namedTypes.ImportAttribute;
|
|
869
|
+
}
|
|
870
|
+
export interface RecordExpressionBuilder {
|
|
871
|
+
(properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[]): namedTypes.RecordExpression;
|
|
872
|
+
from(params: {
|
|
873
|
+
comments?: K.CommentKind[] | null;
|
|
874
|
+
loc?: K.SourceLocationKind | null;
|
|
875
|
+
properties: (K.ObjectPropertyKind | K.ObjectMethodKind | K.SpreadElementKind)[];
|
|
876
|
+
}): namedTypes.RecordExpression;
|
|
877
|
+
}
|
|
878
|
+
export interface ObjectMethodBuilder {
|
|
879
|
+
(kind: "method" | "get" | "set", key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, params: K.PatternKind[], body: K.BlockStatementKind, computed?: boolean): namedTypes.ObjectMethod;
|
|
880
|
+
from(params: {
|
|
881
|
+
accessibility?: K.LiteralKind | null;
|
|
882
|
+
async?: boolean;
|
|
883
|
+
body: K.BlockStatementKind;
|
|
884
|
+
comments?: K.CommentKind[] | null;
|
|
885
|
+
computed?: boolean;
|
|
886
|
+
decorators?: K.DecoratorKind[] | null;
|
|
887
|
+
defaults?: (K.ExpressionKind | null)[];
|
|
888
|
+
expression?: boolean;
|
|
889
|
+
generator?: boolean;
|
|
890
|
+
id?: K.IdentifierKind | null;
|
|
891
|
+
key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind;
|
|
892
|
+
kind: "method" | "get" | "set";
|
|
893
|
+
loc?: K.SourceLocationKind | null;
|
|
894
|
+
params: K.PatternKind[];
|
|
895
|
+
predicate?: K.FlowPredicateKind | null;
|
|
896
|
+
rest?: K.IdentifierKind | null;
|
|
897
|
+
returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null;
|
|
898
|
+
typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null;
|
|
899
|
+
}): namedTypes.ObjectMethod;
|
|
900
|
+
}
|
|
901
|
+
export interface TupleExpressionBuilder {
|
|
902
|
+
(elements: (K.ExpressionKind | K.SpreadElementKind | null)[]): namedTypes.TupleExpression;
|
|
903
|
+
from(params: {
|
|
904
|
+
comments?: K.CommentKind[] | null;
|
|
905
|
+
elements: (K.ExpressionKind | K.SpreadElementKind | null)[];
|
|
906
|
+
loc?: K.SourceLocationKind | null;
|
|
907
|
+
}): namedTypes.TupleExpression;
|
|
908
|
+
}
|
|
909
|
+
export interface ModuleExpressionBuilder {
|
|
910
|
+
(body: K.ProgramKind): namedTypes.ModuleExpression;
|
|
911
|
+
from(params: {
|
|
912
|
+
body: K.ProgramKind;
|
|
913
|
+
comments?: K.CommentKind[] | null;
|
|
914
|
+
loc?: K.SourceLocationKind | null;
|
|
915
|
+
}): namedTypes.ModuleExpression;
|
|
916
|
+
}
|
|
814
917
|
export interface JSXAttributeBuilder {
|
|
815
918
|
(name: K.JSXIdentifierKind | K.JSXNamespacedNameKind, value?: K.LiteralKind | K.JSXExpressionContainerKind | K.JSXElementKind | K.JSXFragmentKind | null): namedTypes.JSXAttribute;
|
|
816
919
|
from(params: {
|
|
@@ -877,6 +980,7 @@ export interface JSXMemberExpressionBuilder {
|
|
|
877
980
|
computed?: boolean;
|
|
878
981
|
loc?: K.SourceLocationKind | null;
|
|
879
982
|
object: K.JSXIdentifierKind | K.JSXMemberExpressionKind;
|
|
983
|
+
optional?: boolean;
|
|
880
984
|
property: K.JSXIdentifierKind;
|
|
881
985
|
}): namedTypes.JSXMemberExpression;
|
|
882
986
|
}
|
|
@@ -901,10 +1005,6 @@ export interface JSXTextBuilder {
|
|
|
901
1005
|
comments?: K.CommentKind[] | null;
|
|
902
1006
|
loc?: K.SourceLocationKind | null;
|
|
903
1007
|
raw?: string;
|
|
904
|
-
regex?: {
|
|
905
|
-
pattern: string;
|
|
906
|
-
flags: string;
|
|
907
|
-
} | null;
|
|
908
1008
|
value: string;
|
|
909
1009
|
}): namedTypes.JSXText;
|
|
910
1010
|
}
|
|
@@ -948,36 +1048,6 @@ export interface JSXClosingFragmentBuilder {
|
|
|
948
1048
|
loc?: K.SourceLocationKind | null;
|
|
949
1049
|
}): namedTypes.JSXClosingFragment;
|
|
950
1050
|
}
|
|
951
|
-
export interface DecoratorBuilder {
|
|
952
|
-
(expression: K.ExpressionKind): namedTypes.Decorator;
|
|
953
|
-
from(params: {
|
|
954
|
-
comments?: K.CommentKind[] | null;
|
|
955
|
-
expression: K.ExpressionKind;
|
|
956
|
-
loc?: K.SourceLocationKind | null;
|
|
957
|
-
}): namedTypes.Decorator;
|
|
958
|
-
}
|
|
959
|
-
export interface PrivateNameBuilder {
|
|
960
|
-
(id: K.IdentifierKind): namedTypes.PrivateName;
|
|
961
|
-
from(params: {
|
|
962
|
-
comments?: K.CommentKind[] | null;
|
|
963
|
-
id: K.IdentifierKind;
|
|
964
|
-
loc?: K.SourceLocationKind | null;
|
|
965
|
-
}): namedTypes.PrivateName;
|
|
966
|
-
}
|
|
967
|
-
export interface ClassPrivatePropertyBuilder {
|
|
968
|
-
(key: K.PrivateNameKind, value?: K.ExpressionKind | null): namedTypes.ClassPrivateProperty;
|
|
969
|
-
from(params: {
|
|
970
|
-
access?: "public" | "private" | "protected" | undefined;
|
|
971
|
-
comments?: K.CommentKind[] | null;
|
|
972
|
-
computed?: boolean;
|
|
973
|
-
key: K.PrivateNameKind;
|
|
974
|
-
loc?: K.SourceLocationKind | null;
|
|
975
|
-
static?: boolean;
|
|
976
|
-
typeAnnotation?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null;
|
|
977
|
-
value?: K.ExpressionKind | null;
|
|
978
|
-
variance?: K.VarianceKind | "plus" | "minus" | null;
|
|
979
|
-
}): namedTypes.ClassPrivateProperty;
|
|
980
|
-
}
|
|
981
1051
|
export interface TypeParameterDeclarationBuilder {
|
|
982
1052
|
(params: K.TypeParameterKind[]): namedTypes.TypeParameterDeclaration;
|
|
983
1053
|
from(params: {
|
|
@@ -1309,6 +1379,25 @@ export interface MemberTypeAnnotationBuilder {
|
|
|
1309
1379
|
property: K.MemberTypeAnnotationKind | K.GenericTypeAnnotationKind;
|
|
1310
1380
|
}): namedTypes.MemberTypeAnnotation;
|
|
1311
1381
|
}
|
|
1382
|
+
export interface IndexedAccessTypeBuilder {
|
|
1383
|
+
(objectType: K.FlowTypeKind, indexType: K.FlowTypeKind): namedTypes.IndexedAccessType;
|
|
1384
|
+
from(params: {
|
|
1385
|
+
comments?: K.CommentKind[] | null;
|
|
1386
|
+
indexType: K.FlowTypeKind;
|
|
1387
|
+
loc?: K.SourceLocationKind | null;
|
|
1388
|
+
objectType: K.FlowTypeKind;
|
|
1389
|
+
}): namedTypes.IndexedAccessType;
|
|
1390
|
+
}
|
|
1391
|
+
export interface OptionalIndexedAccessTypeBuilder {
|
|
1392
|
+
(objectType: K.FlowTypeKind, indexType: K.FlowTypeKind, optional: boolean): namedTypes.OptionalIndexedAccessType;
|
|
1393
|
+
from(params: {
|
|
1394
|
+
comments?: K.CommentKind[] | null;
|
|
1395
|
+
indexType: K.FlowTypeKind;
|
|
1396
|
+
loc?: K.SourceLocationKind | null;
|
|
1397
|
+
objectType: K.FlowTypeKind;
|
|
1398
|
+
optional: boolean;
|
|
1399
|
+
}): namedTypes.OptionalIndexedAccessType;
|
|
1400
|
+
}
|
|
1312
1401
|
export interface UnionTypeAnnotationBuilder {
|
|
1313
1402
|
(types: K.FlowTypeKind[]): namedTypes.UnionTypeAnnotation;
|
|
1314
1403
|
from(params: {
|
|
@@ -1715,11 +1804,11 @@ export interface StringLiteralBuilder {
|
|
|
1715
1804
|
(value: string): namedTypes.StringLiteral;
|
|
1716
1805
|
from(params: {
|
|
1717
1806
|
comments?: K.CommentKind[] | null;
|
|
1807
|
+
extra?: {
|
|
1808
|
+
rawValue: string;
|
|
1809
|
+
raw: string;
|
|
1810
|
+
};
|
|
1718
1811
|
loc?: K.SourceLocationKind | null;
|
|
1719
|
-
regex?: {
|
|
1720
|
-
pattern: string;
|
|
1721
|
-
flags: string;
|
|
1722
|
-
} | null;
|
|
1723
1812
|
value: string;
|
|
1724
1813
|
}): namedTypes.StringLiteral;
|
|
1725
1814
|
}
|
|
@@ -1733,10 +1822,6 @@ export interface NumericLiteralBuilder {
|
|
|
1733
1822
|
};
|
|
1734
1823
|
loc?: K.SourceLocationKind | null;
|
|
1735
1824
|
raw?: string | null;
|
|
1736
|
-
regex?: {
|
|
1737
|
-
pattern: string;
|
|
1738
|
-
flags: string;
|
|
1739
|
-
} | null;
|
|
1740
1825
|
value: number;
|
|
1741
1826
|
}): namedTypes.NumericLiteral;
|
|
1742
1827
|
}
|
|
@@ -1749,22 +1834,26 @@ export interface BigIntLiteralBuilder {
|
|
|
1749
1834
|
raw: string;
|
|
1750
1835
|
};
|
|
1751
1836
|
loc?: K.SourceLocationKind | null;
|
|
1752
|
-
regex?: {
|
|
1753
|
-
pattern: string;
|
|
1754
|
-
flags: string;
|
|
1755
|
-
} | null;
|
|
1756
1837
|
value: string | number;
|
|
1757
1838
|
}): namedTypes.BigIntLiteral;
|
|
1758
1839
|
}
|
|
1840
|
+
export interface DecimalLiteralBuilder {
|
|
1841
|
+
(value: string): namedTypes.DecimalLiteral;
|
|
1842
|
+
from(params: {
|
|
1843
|
+
comments?: K.CommentKind[] | null;
|
|
1844
|
+
extra?: {
|
|
1845
|
+
rawValue: string;
|
|
1846
|
+
raw: string;
|
|
1847
|
+
};
|
|
1848
|
+
loc?: K.SourceLocationKind | null;
|
|
1849
|
+
value: string;
|
|
1850
|
+
}): namedTypes.DecimalLiteral;
|
|
1851
|
+
}
|
|
1759
1852
|
export interface NullLiteralBuilder {
|
|
1760
1853
|
(): namedTypes.NullLiteral;
|
|
1761
1854
|
from(params: {
|
|
1762
1855
|
comments?: K.CommentKind[] | null;
|
|
1763
1856
|
loc?: K.SourceLocationKind | null;
|
|
1764
|
-
regex?: {
|
|
1765
|
-
pattern: string;
|
|
1766
|
-
flags: string;
|
|
1767
|
-
} | null;
|
|
1768
1857
|
value?: null;
|
|
1769
1858
|
}): namedTypes.NullLiteral;
|
|
1770
1859
|
}
|
|
@@ -1773,10 +1862,6 @@ export interface BooleanLiteralBuilder {
|
|
|
1773
1862
|
from(params: {
|
|
1774
1863
|
comments?: K.CommentKind[] | null;
|
|
1775
1864
|
loc?: K.SourceLocationKind | null;
|
|
1776
|
-
regex?: {
|
|
1777
|
-
pattern: string;
|
|
1778
|
-
flags: string;
|
|
1779
|
-
} | null;
|
|
1780
1865
|
value: boolean;
|
|
1781
1866
|
}): namedTypes.BooleanLiteral;
|
|
1782
1867
|
}
|
|
@@ -1784,39 +1869,20 @@ export interface RegExpLiteralBuilder {
|
|
|
1784
1869
|
(pattern: string, flags: string): namedTypes.RegExpLiteral;
|
|
1785
1870
|
from(params: {
|
|
1786
1871
|
comments?: K.CommentKind[] | null;
|
|
1872
|
+
extra?: {
|
|
1873
|
+
rawValue: RegExp | undefined;
|
|
1874
|
+
raw: string;
|
|
1875
|
+
};
|
|
1787
1876
|
flags: string;
|
|
1788
1877
|
loc?: K.SourceLocationKind | null;
|
|
1789
1878
|
pattern: string;
|
|
1790
1879
|
regex?: {
|
|
1791
1880
|
pattern: string;
|
|
1792
1881
|
flags: string;
|
|
1793
|
-
}
|
|
1882
|
+
};
|
|
1794
1883
|
value?: RegExp;
|
|
1795
1884
|
}): namedTypes.RegExpLiteral;
|
|
1796
1885
|
}
|
|
1797
|
-
export interface ObjectMethodBuilder {
|
|
1798
|
-
(kind: "method" | "get" | "set", key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, params: K.PatternKind[], body: K.BlockStatementKind, computed?: boolean): namedTypes.ObjectMethod;
|
|
1799
|
-
from(params: {
|
|
1800
|
-
accessibility?: K.LiteralKind | null;
|
|
1801
|
-
async?: boolean;
|
|
1802
|
-
body: K.BlockStatementKind;
|
|
1803
|
-
comments?: K.CommentKind[] | null;
|
|
1804
|
-
computed?: boolean;
|
|
1805
|
-
decorators?: K.DecoratorKind[] | null;
|
|
1806
|
-
defaults?: (K.ExpressionKind | null)[];
|
|
1807
|
-
expression?: boolean;
|
|
1808
|
-
generator?: boolean;
|
|
1809
|
-
id?: K.IdentifierKind | null;
|
|
1810
|
-
key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind;
|
|
1811
|
-
kind: "method" | "get" | "set";
|
|
1812
|
-
loc?: K.SourceLocationKind | null;
|
|
1813
|
-
params: K.PatternKind[];
|
|
1814
|
-
predicate?: K.FlowPredicateKind | null;
|
|
1815
|
-
rest?: K.IdentifierKind | null;
|
|
1816
|
-
returnType?: K.TypeAnnotationKind | K.TSTypeAnnotationKind | null;
|
|
1817
|
-
typeParameters?: K.TypeParameterDeclarationKind | K.TSTypeParameterDeclarationKind | null;
|
|
1818
|
-
}): namedTypes.ObjectMethod;
|
|
1819
|
-
}
|
|
1820
1886
|
export interface ClassMethodBuilder {
|
|
1821
1887
|
(kind: "get" | "set" | "method" | "constructor" | undefined, key: K.LiteralKind | K.IdentifierKind | K.ExpressionKind, params: K.PatternKind[], body: K.BlockStatementKind, computed?: boolean, staticParam?: boolean | null): namedTypes.ClassMethod;
|
|
1822
1888
|
from(params: {
|
|
@@ -1896,6 +1962,21 @@ export interface ImportBuilder {
|
|
|
1896
1962
|
loc?: K.SourceLocationKind | null;
|
|
1897
1963
|
}): namedTypes.Import;
|
|
1898
1964
|
}
|
|
1965
|
+
export interface V8IntrinsicIdentifierBuilder {
|
|
1966
|
+
(name: string): namedTypes.V8IntrinsicIdentifier;
|
|
1967
|
+
from(params: {
|
|
1968
|
+
comments?: K.CommentKind[] | null;
|
|
1969
|
+
loc?: K.SourceLocationKind | null;
|
|
1970
|
+
name: string;
|
|
1971
|
+
}): namedTypes.V8IntrinsicIdentifier;
|
|
1972
|
+
}
|
|
1973
|
+
export interface TopicReferenceBuilder {
|
|
1974
|
+
(): namedTypes.TopicReference;
|
|
1975
|
+
from(params: {
|
|
1976
|
+
comments?: K.CommentKind[] | null;
|
|
1977
|
+
loc?: K.SourceLocationKind | null;
|
|
1978
|
+
}): namedTypes.TopicReference;
|
|
1979
|
+
}
|
|
1899
1980
|
export interface TSQualifiedNameBuilder {
|
|
1900
1981
|
(left: K.IdentifierKind | K.TSQualifiedNameKind, right: K.IdentifierKind | K.TSQualifiedNameKind): namedTypes.TSQualifiedName;
|
|
1901
1982
|
from(params: {
|
|
@@ -2018,6 +2099,13 @@ export interface TSVoidKeywordBuilder {
|
|
|
2018
2099
|
loc?: K.SourceLocationKind | null;
|
|
2019
2100
|
}): namedTypes.TSVoidKeyword;
|
|
2020
2101
|
}
|
|
2102
|
+
export interface TSIntrinsicKeywordBuilder {
|
|
2103
|
+
(): namedTypes.TSIntrinsicKeyword;
|
|
2104
|
+
from(params: {
|
|
2105
|
+
comments?: K.CommentKind[] | null;
|
|
2106
|
+
loc?: K.SourceLocationKind | null;
|
|
2107
|
+
}): namedTypes.TSIntrinsicKeyword;
|
|
2108
|
+
}
|
|
2021
2109
|
export interface TSThisTypeBuilder {
|
|
2022
2110
|
(): namedTypes.TSThisType;
|
|
2023
2111
|
from(params: {
|
|
@@ -2514,8 +2602,18 @@ export interface builders {
|
|
|
2514
2602
|
spreadProperty: SpreadPropertyBuilder;
|
|
2515
2603
|
spreadPropertyPattern: SpreadPropertyPatternBuilder;
|
|
2516
2604
|
importExpression: ImportExpressionBuilder;
|
|
2517
|
-
|
|
2605
|
+
chainExpression: ChainExpressionBuilder;
|
|
2518
2606
|
optionalCallExpression: OptionalCallExpressionBuilder;
|
|
2607
|
+
optionalMemberExpression: OptionalMemberExpressionBuilder;
|
|
2608
|
+
staticBlock: StaticBlockBuilder;
|
|
2609
|
+
decorator: DecoratorBuilder;
|
|
2610
|
+
privateName: PrivateNameBuilder;
|
|
2611
|
+
classPrivateProperty: ClassPrivatePropertyBuilder;
|
|
2612
|
+
importAttribute: ImportAttributeBuilder;
|
|
2613
|
+
recordExpression: RecordExpressionBuilder;
|
|
2614
|
+
objectMethod: ObjectMethodBuilder;
|
|
2615
|
+
tupleExpression: TupleExpressionBuilder;
|
|
2616
|
+
moduleExpression: ModuleExpressionBuilder;
|
|
2519
2617
|
jsxAttribute: JSXAttributeBuilder;
|
|
2520
2618
|
jsxIdentifier: JSXIdentifierBuilder;
|
|
2521
2619
|
jsxNamespacedName: JSXNamespacedNameBuilder;
|
|
@@ -2531,9 +2629,6 @@ export interface builders {
|
|
|
2531
2629
|
jsxClosingElement: JSXClosingElementBuilder;
|
|
2532
2630
|
jsxOpeningFragment: JSXOpeningFragmentBuilder;
|
|
2533
2631
|
jsxClosingFragment: JSXClosingFragmentBuilder;
|
|
2534
|
-
decorator: DecoratorBuilder;
|
|
2535
|
-
privateName: PrivateNameBuilder;
|
|
2536
|
-
classPrivateProperty: ClassPrivatePropertyBuilder;
|
|
2537
2632
|
typeParameterDeclaration: TypeParameterDeclarationBuilder;
|
|
2538
2633
|
tsTypeParameterDeclaration: TSTypeParameterDeclarationBuilder;
|
|
2539
2634
|
typeParameterInstantiation: TypeParameterInstantiationBuilder;
|
|
@@ -2573,6 +2668,8 @@ export interface builders {
|
|
|
2573
2668
|
qualifiedTypeIdentifier: QualifiedTypeIdentifierBuilder;
|
|
2574
2669
|
genericTypeAnnotation: GenericTypeAnnotationBuilder;
|
|
2575
2670
|
memberTypeAnnotation: MemberTypeAnnotationBuilder;
|
|
2671
|
+
indexedAccessType: IndexedAccessTypeBuilder;
|
|
2672
|
+
optionalIndexedAccessType: OptionalIndexedAccessTypeBuilder;
|
|
2576
2673
|
unionTypeAnnotation: UnionTypeAnnotationBuilder;
|
|
2577
2674
|
intersectionTypeAnnotation: IntersectionTypeAnnotationBuilder;
|
|
2578
2675
|
typeofTypeAnnotation: TypeofTypeAnnotationBuilder;
|
|
@@ -2623,15 +2720,17 @@ export interface builders {
|
|
|
2623
2720
|
stringLiteral: StringLiteralBuilder;
|
|
2624
2721
|
numericLiteral: NumericLiteralBuilder;
|
|
2625
2722
|
bigIntLiteral: BigIntLiteralBuilder;
|
|
2723
|
+
decimalLiteral: DecimalLiteralBuilder;
|
|
2626
2724
|
nullLiteral: NullLiteralBuilder;
|
|
2627
2725
|
booleanLiteral: BooleanLiteralBuilder;
|
|
2628
2726
|
regExpLiteral: RegExpLiteralBuilder;
|
|
2629
|
-
objectMethod: ObjectMethodBuilder;
|
|
2630
2727
|
classMethod: ClassMethodBuilder;
|
|
2631
2728
|
classPrivateMethod: ClassPrivateMethodBuilder;
|
|
2632
2729
|
restProperty: RestPropertyBuilder;
|
|
2633
2730
|
forAwaitStatement: ForAwaitStatementBuilder;
|
|
2634
2731
|
import: ImportBuilder;
|
|
2732
|
+
v8IntrinsicIdentifier: V8IntrinsicIdentifierBuilder;
|
|
2733
|
+
topicReference: TopicReferenceBuilder;
|
|
2635
2734
|
tsQualifiedName: TSQualifiedNameBuilder;
|
|
2636
2735
|
tsTypeReference: TSTypeReferenceBuilder;
|
|
2637
2736
|
tsAsExpression: TSAsExpressionBuilder;
|
|
@@ -2648,6 +2747,7 @@ export interface builders {
|
|
|
2648
2747
|
tsUndefinedKeyword: TSUndefinedKeywordBuilder;
|
|
2649
2748
|
tsUnknownKeyword: TSUnknownKeywordBuilder;
|
|
2650
2749
|
tsVoidKeyword: TSVoidKeywordBuilder;
|
|
2750
|
+
tsIntrinsicKeyword: TSIntrinsicKeywordBuilder;
|
|
2651
2751
|
tsThisType: TSThisTypeBuilder;
|
|
2652
2752
|
tsArrayType: TSArrayTypeBuilder;
|
|
2653
2753
|
tsLiteralType: TSLiteralTypeBuilder;
|