From 24ac46577b1fa7587e3741b827339f18711f2bc6 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Tue, 26 Apr 2022 18:22:00 -0700 Subject: [PATCH] Add importKind to ImportSpecifier for Flow Flow accepts `type` or `typeof` on an individual import specifier, as well as on the whole import statement. --- def/flow.ts | 3 +++ gen/builders.ts | 1 + gen/namedTypes.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/def/flow.ts b/def/flow.ts index 7df97cf8..e6cb8374 100644 --- a/def/flow.ts +++ b/def/flow.ts @@ -405,6 +405,9 @@ export default function (fork: Fork) { def("ImportDeclaration") .field("importKind", or("value", "type", "typeof"), () => "value"); + def("ImportSpecifier") + .field("importKind", or("value", "type", "typeof"), () => "value"); + def("FlowPredicate").bases("Flow"); def("InferredPredicate") diff --git a/gen/builders.ts b/gen/builders.ts index 3f5254ba..63dd6215 100644 --- a/gen/builders.ts +++ b/gen/builders.ts @@ -957,6 +957,7 @@ export interface ImportSpecifierBuilder { params: { comments?: K.CommentKind[] | null, id?: K.IdentifierKind | null, + importKind?: "value" | "type" | "typeof", imported: K.IdentifierKind, loc?: K.SourceLocationKind | null, local?: K.IdentifierKind | null, diff --git a/gen/namedTypes.ts b/gen/namedTypes.ts index a520ef45..b170f182 100644 --- a/gen/namedTypes.ts +++ b/gen/namedTypes.ts @@ -476,6 +476,7 @@ export namespace namedTypes { export interface ImportSpecifier extends Omit { type: "ImportSpecifier"; imported: K.IdentifierKind; + importKind?: "value" | "type" | "typeof"; } export interface ImportDefaultSpecifier extends Omit {