summaryrefslogtreecommitdiff
path: root/tools/ts_library_builder/build_library.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ts_library_builder/build_library.ts')
-rw-r--r--tools/ts_library_builder/build_library.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/ts_library_builder/build_library.ts b/tools/ts_library_builder/build_library.ts
index af3fb599d..e1a64215f 100644
--- a/tools/ts_library_builder/build_library.ts
+++ b/tools/ts_library_builder/build_library.ts
@@ -21,7 +21,8 @@ import {
loadFiles,
logDiagnostics,
namespaceSourceFile,
- normalizeSlashes
+ normalizeSlashes,
+ addTypeAlias
} from "./ast_util";
export interface BuildLibraryOptions {
@@ -216,6 +217,16 @@ export function mergeGlobal({
addInterfaceProperty(interfaceDeclaration, property, type);
}
+ // We need to copy over any type aliases
+ for (const typeAlias of sourceFile.getTypeAliases()) {
+ addTypeAlias(
+ targetSourceFile,
+ typeAlias.getName(),
+ typeAlias.getType().getText(sourceFile),
+ true
+ );
+ }
+
// We need to ensure that we only namespace each source file once, so we
// will use this map for tracking that.
const sourceFileMap = new Map<SourceFile, string>();