/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Type} from '@angular/core'; import {CompileTypeSummary} from './compile_metadata'; import {CompilerInjectable} from './injectable'; export interface Summary { symbol: T; metadata: any; type?: CompileTypeSummary; } export abstract class SummaryResolver { abstract isLibraryFile(fileName: string): boolean; abstract getLibraryFileName(fileName: string): string|null; abstract resolveSummary(reference: T): Summary|null; abstract getSymbolsOf(filePath: string): T[]; abstract getImportAs(reference: T): T; abstract addSummary(summary: Summary): void; } @CompilerInjectable() export class JitSummaryResolver implements SummaryResolver> { private _summaries = new Map, Summary>>(); isLibraryFile(fileName: string): boolean { return false; }; getLibraryFileName(fileName: string): string|null { return null; } resolveSummary(reference: Type): Summary>|null { return this._summaries.get(reference) || null; }; getSymbolsOf(filePath: string): Type[] { return []; } getImportAs(reference: Type): Type { return reference; } addSummary(summary: Summary>) { this._summaries.set(summary.symbol, summary); }; }