Skip to content

Commit 2c010fc

Browse files
committed
public api tweaks
1 parent d4cf3f9 commit 2c010fc

File tree

4 files changed

+203
-190
lines changed

4 files changed

+203
-190
lines changed

_packages/api/src/node.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ export class RemoteNode extends RemoteNodeBase implements Node {
544544
get isTypeOnly(): boolean | undefined {
545545
switch (this.kind) {
546546
case SyntaxKind.ImportSpecifier:
547-
case SyntaxKind.ImportClause:
548547
case SyntaxKind.ExportSpecifier:
549548
case SyntaxKind.ImportEqualsDeclaration:
550549
case SyntaxKind.ExportDeclaration:
@@ -921,6 +920,18 @@ export class RemoteNode extends RemoteNodeBase implements Node {
921920
}
922921
}
923922

923+
get phaseModifier(): SyntaxKind {
924+
switch (this.kind) {
925+
case SyntaxKind.ImportClause:
926+
const flags = (this.data & (1 << 24 | 1 << 25)) >> 24;
927+
if (flags & 1) return SyntaxKind.TypeKeyword;
928+
if (flags & 2) return SyntaxKind.DeferKeyword;
929+
// fallthrough
930+
default:
931+
return SyntaxKind.Unknown;
932+
}
933+
}
934+
924935
get token(): SyntaxKind | undefined {
925936
switch (this.kind) {
926937
case SyntaxKind.ImportAttributes:

_packages/ast/src/syntaxKind.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export enum SyntaxKind {
165165
BigIntKeyword,
166166
OverrideKeyword,
167167
OfKeyword,
168+
DeferKeyword,
168169
QualifiedName,
169170
ComputedPropertyName,
170171
TypeParameter,

0 commit comments

Comments
 (0)