Skip to content

Commit 083289f

Browse files
committed
fix(typescript.ts): add importKind fields
1 parent f1c8ff5 commit 083289f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

def/typescript.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ export default function (fork: Fork) {
3535
def("Identifier"),
3636
def("TSQualifiedName")
3737
);
38+
39+
40+
def("ImportDeclaration")
41+
.field("importKind", or("value", "type", "typeof"), () => "value");
42+
43+
def("ImportSpecifier")
44+
.field("importKind", or("value", "type", "typeof"), defaults["null"]);
3845

3946
def("TSTypeReference")
4047
.bases("TSType", "TSHasOptionalTypeParameterInstantiation")

gen/builders.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ export interface NewExpressionBuilder {
580580
callee: K.ExpressionKind,
581581
comments?: K.CommentKind[] | null,
582582
loc?: K.SourceLocationKind | null,
583-
typeArguments?: null | K.TypeParameterInstantiationKind
583+
typeArguments?: null | K.TypeParameterInstantiationKind,
584+
typeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null
584585
}
585586
): namedTypes.NewExpression;
586587
}
@@ -597,7 +598,8 @@ export interface CallExpressionBuilder {
597598
comments?: K.CommentKind[] | null,
598599
loc?: K.SourceLocationKind | null,
599600
optional?: boolean,
600-
typeArguments?: null | K.TypeParameterInstantiationKind
601+
typeArguments?: null | K.TypeParameterInstantiationKind,
602+
typeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null
601603
}
602604
): namedTypes.CallExpression;
603605
}
@@ -1194,7 +1196,8 @@ export interface OptionalCallExpressionBuilder {
11941196
comments?: K.CommentKind[] | null,
11951197
loc?: K.SourceLocationKind | null,
11961198
optional?: boolean,
1197-
typeArguments?: null | K.TypeParameterInstantiationKind
1199+
typeArguments?: null | K.TypeParameterInstantiationKind,
1200+
typeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null
11981201
}
11991202
): namedTypes.OptionalCallExpression;
12001203
}

gen/namedTypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,15 @@ export namespace namedTypes {
298298
type: "NewExpression";
299299
callee: K.ExpressionKind;
300300
arguments: (K.ExpressionKind | K.SpreadElementKind)[];
301+
typeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null;
301302
typeArguments?: null | K.TypeParameterInstantiationKind;
302303
}
303304

304305
export interface CallExpression extends Omit<Expression, "type">, Omit<ChainElement, "type"> {
305306
type: "CallExpression";
306307
callee: K.ExpressionKind;
307308
arguments: (K.ExpressionKind | K.SpreadElementKind)[];
309+
typeParameters?: K.TypeParameterInstantiationKind | K.TSTypeParameterInstantiationKind | null;
308310
typeArguments?: null | K.TypeParameterInstantiationKind;
309311
}
310312

0 commit comments

Comments
 (0)