source: trip-planner-front/node_modules/@angular/compiler-cli/src/ngtsc/shims/api.d.ts@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/// <amd-module name="@angular/compiler-cli/src/ngtsc/shims/api" />
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9import * as ts from 'typescript';
10import { AbsoluteFsPath } from '../file_system';
11/**
12 * Generates a single shim file for the entire program.
13 */
14export interface TopLevelShimGenerator {
15 /**
16 * Whether this shim should be emitted during TypeScript emit.
17 */
18 readonly shouldEmit: boolean;
19 /**
20 * Create a `ts.SourceFile` representing the shim, with the correct filename.
21 */
22 makeTopLevelShim(): ts.SourceFile;
23}
24/**
25 * Generates a shim file for each original `ts.SourceFile` in the user's program, with a file
26 * extension prefix.
27 */
28export interface PerFileShimGenerator {
29 /**
30 * The extension prefix which will be used for the shim.
31 *
32 * Knowing this allows the `ts.CompilerHost` implementation which is consuming this shim generator
33 * to predict the shim filename, which is useful when a previous `ts.Program` already includes a
34 * generated version of the shim.
35 */
36 readonly extensionPrefix: string;
37 /**
38 * Whether shims produced by this generator should be emitted during TypeScript emit.
39 */
40 readonly shouldEmit: boolean;
41 /**
42 * Generate the shim for a given original `ts.SourceFile`, with the given filename.
43 */
44 generateShimForFile(sf: ts.SourceFile, genFilePath: AbsoluteFsPath, priorShimSf: ts.SourceFile | null): ts.SourceFile;
45}
46/**
47 * Maintains a mapping of which symbols in a .ngfactory file have been used.
48 *
49 * .ngfactory files are generated with one symbol per defined class in the source file, regardless
50 * of whether the classes in the source files are NgModules (because that isn't known at the time
51 * the factory files are generated). A `FactoryTracker` supports removing factory symbols which
52 * didn't end up being NgModules, by tracking the ones which are.
53 */
54export interface FactoryTracker {
55 readonly sourceInfo: Map<string, FactoryInfo>;
56 track(sf: ts.SourceFile, moduleInfo: ModuleInfo): void;
57}
58export interface FactoryInfo {
59 sourceFilePath: string;
60 moduleSymbols: Map<string, ModuleInfo>;
61}
62export interface ModuleInfo {
63 name: string;
64 hasId: boolean;
65}
Note: See TracBrowser for help on using the repository browser.