UNPKG

2.32 kBTypeScriptView Raw
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 */
8import * as ts from 'typescript';
9import { NgccProcessor } from '../ngcc_processor';
10import { WebpackResourceLoader } from '../resource_loader';
11export declare function augmentHostWithResources(host: ts.CompilerHost, resourceLoader: WebpackResourceLoader, options?: {
12 directTemplateLoading?: boolean;
13 inlineStyleFileExtension?: string;
14}): void;
15/**
16 * Augments a TypeScript Compiler Host's resolveModuleNames function to collect dependencies
17 * of the containing file passed to the resolveModuleNames function. This process assumes
18 * that consumers of the Compiler Host will only call resolveModuleNames with modules that are
19 * actually present in a containing file.
20 * This process is a workaround for gathering a TypeScript SourceFile's dependencies as there
21 * is no currently exposed public method to do so. A BuilderProgram does have a `getAllDependencies`
22 * function. However, that function returns all transitive dependencies as well which can cause
23 * excessive Webpack rebuilds.
24 *
25 * @param host The CompilerHost to augment.
26 * @param dependencies A Map which will be used to store file dependencies.
27 * @param moduleResolutionCache An optional resolution cache to use when the host resolves a module.
28 */
29export declare function augmentHostWithDependencyCollection(host: ts.CompilerHost, dependencies: Map<string, Set<string>>, moduleResolutionCache?: ts.ModuleResolutionCache): void;
30export declare function augmentHostWithNgcc(host: ts.CompilerHost, ngcc: NgccProcessor, moduleResolutionCache?: ts.ModuleResolutionCache): void;
31export declare function augmentHostWithReplacements(host: ts.CompilerHost, replacements: Record<string, string>, moduleResolutionCache?: ts.ModuleResolutionCache): void;
32export declare function augmentHostWithSubstitutions(host: ts.CompilerHost, substitutions: Record<string, string>): void;
33export declare function augmentHostWithVersioning(host: ts.CompilerHost): void;
34export declare function augmentProgramWithVersioning(program: ts.Program): void;
35export declare function augmentHostWithCaching(host: ts.CompilerHost, cache: Map<string, ts.SourceFile>): void;