From 9e95da4eaa85bbd91f0eee020acb4922a6cab133 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Wed, 19 Dec 2018 09:57:27 +0000 Subject: [PATCH] Added type-level mapping between aliases and nodes that have that alias. (#9110) --- scripts/generators/typescript.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/generators/typescript.js b/scripts/generators/typescript.js index ae93bee0b2..5b4ea4fe3e 100644 --- a/scripts/generators/typescript.js +++ b/scripts/generators/typescript.js @@ -160,6 +160,13 @@ for (const type in t.FLIPPED_ALIAS_KEYS) { .map(type => `${type}`) .join(" | ")};\n`; } +code += "\n"; + +code += "export interface Aliases {\n"; +for (const type in t.FLIPPED_ALIAS_KEYS) { + code += ` ${type}: ${type};\n`; +} +code += "}\n\n"; code += lines.join("\n") + "\n";