UNPKG

1.56 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google Inc. 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 */
8import { AngularCompilerOptions, ModuleMetadata } from '@angular/tsc-wrapped';
9import * as ts from 'typescript';
10import { ReflectorHost, ReflectorHostContext } from './reflector_host';
11/**
12 * This version of the reflector host expects that the program will be compiled
13 * and executed with a "path mapped" directory structure, where generated files
14 * are in a parallel tree with the sources, and imported using a `./` relative
15 * import. This requires using TS `rootDirs` option and also teaching the module
16 * loader what to do.
17 */
18export declare class PathMappedReflectorHost extends ReflectorHost {
19 constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: ReflectorHostContext);
20 getCanonicalFileName(fileName: string): string;
21 protected resolve(m: string, containingFile: string): string;
22 /**
23 * We want a moduleId that will appear in import statements in the generated code.
24 * These need to be in a form that system.js can load, so absolute file paths don't work.
25 * Relativize the paths by checking candidate prefixes of the absolute path, to see if
26 * they are resolvable by the moduleResolution strategy from the CompilerHost.
27 */
28 getImportPath(containingFile: string, importedFile: string): string;
29 getMetadataFor(filePath: string): ModuleMetadata;
30}