refactor(ivy): use a named type for ImportManager import structures (#25445)

Previously we were using an anonymous type `{specifier: string; qualifier: string;}`
throughout the code base. This commit gives this type a name and ensures it
is only defined in one place.

PR Close #25445
This commit is contained in:
Pete Bacon Darwin
2019-04-28 20:48:33 +01:00
committed by Jason Aden
parent 8e201f713a
commit 95c5b1a7f6
6 changed files with 31 additions and 14 deletions

View File

@ -9,6 +9,7 @@ import MagicString from 'magic-string';
import * as ts from 'typescript';
import {fromObject, generateMapFileComment} from 'convert-source-map';
import {AbsoluteFsPath} from '../../../src/ngtsc/path';
import {Import} from '../../../src/ngtsc/translator';
import {CompiledClass, DecorationAnalyzer} from '../../src/analysis/decoration_analyzer';
import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry';
import {ModuleWithProvidersAnalyzer} from '../../src/analysis/module_with_providers_analyzer';
@ -31,8 +32,7 @@ class TestRenderer extends Renderer {
bundle: EntryPointBundle) {
super(fs, logger, host, isCore, bundle);
}
addImports(
output: MagicString, imports: {specifier: string, qualifier: string}[], sf: ts.SourceFile) {
addImports(output: MagicString, imports: Import[], sf: ts.SourceFile) {
output.prepend('\n// ADD IMPORTS\n');
}
addExports(output: MagicString, baseEntryPointPath: string, exports: {