1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Summary, SummaryResolver } from '../summary_resolver';
|
---|
9 | import { StaticSymbol, StaticSymbolCache } from './static_symbol';
|
---|
10 | export interface AotSummaryResolverHost {
|
---|
11 | /**
|
---|
12 | * Loads an NgModule/Directive/Pipe summary file
|
---|
13 | */
|
---|
14 | loadSummary(filePath: string): string | null;
|
---|
15 | /**
|
---|
16 | * Returns whether a file is a source file or not.
|
---|
17 | */
|
---|
18 | isSourceFile(sourceFilePath: string): boolean;
|
---|
19 | /**
|
---|
20 | * Converts a file name into a representation that should be stored in a summary file.
|
---|
21 | * This has to include changing the suffix as well.
|
---|
22 | * E.g.
|
---|
23 | * `some_file.ts` -> `some_file.d.ts`
|
---|
24 | *
|
---|
25 | * @param referringSrcFileName the soure file that refers to fileName
|
---|
26 | */
|
---|
27 | toSummaryFileName(fileName: string, referringSrcFileName: string): string;
|
---|
28 | /**
|
---|
29 | * Converts a fileName that was processed by `toSummaryFileName` back into a real fileName
|
---|
30 | * given the fileName of the library that is referrig to it.
|
---|
31 | */
|
---|
32 | fromSummaryFileName(fileName: string, referringLibFileName: string): string;
|
---|
33 | }
|
---|
34 | export declare class AotSummaryResolver implements SummaryResolver<StaticSymbol> {
|
---|
35 | private host;
|
---|
36 | private staticSymbolCache;
|
---|
37 | private summaryCache;
|
---|
38 | private loadedFilePaths;
|
---|
39 | private importAs;
|
---|
40 | private knownFileNameToModuleNames;
|
---|
41 | constructor(host: AotSummaryResolverHost, staticSymbolCache: StaticSymbolCache);
|
---|
42 | isLibraryFile(filePath: string): boolean;
|
---|
43 | toSummaryFileName(filePath: string, referringSrcFileName: string): string;
|
---|
44 | fromSummaryFileName(fileName: string, referringLibFileName: string): string;
|
---|
45 | resolveSummary(staticSymbol: StaticSymbol): Summary<StaticSymbol> | null;
|
---|
46 | getSymbolsOf(filePath: string): StaticSymbol[] | null;
|
---|
47 | getImportAs(staticSymbol: StaticSymbol): StaticSymbol;
|
---|
48 | /**
|
---|
49 | * Converts a file path to a module name that can be used as an `import`.
|
---|
50 | */
|
---|
51 | getKnownModuleName(importedFilePath: string): string | null;
|
---|
52 | addSummary(summary: Summary<StaticSymbol>): void;
|
---|
53 | private _loadSummaryFile;
|
---|
54 | }
|
---|