1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/entry_point_finder/utils" />
|
---|
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 | */
|
---|
9 | import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
|
---|
10 | import { Logger } from '../../../src/ngtsc/logging';
|
---|
11 | import { PathMappings } from '../path_mappings';
|
---|
12 | /**
|
---|
13 | * Extract all the base-paths that we need to search for entry-points.
|
---|
14 | *
|
---|
15 | * This always contains the standard base-path (`sourceDirectory`).
|
---|
16 | * But it also parses the `paths` mappings object to guess additional base-paths.
|
---|
17 | *
|
---|
18 | * For example:
|
---|
19 | *
|
---|
20 | * ```
|
---|
21 | * getBasePaths('/node_modules', {baseUrl: '/dist', paths: {'*': ['lib/*', 'lib/generated/*']}})
|
---|
22 | * > ['/node_modules', '/dist/lib']
|
---|
23 | * ```
|
---|
24 | *
|
---|
25 | * Notice that `'/dist'` is not included as there is no `'*'` path,
|
---|
26 | * and `'/dist/lib/generated'` is not included as it is covered by `'/dist/lib'`.
|
---|
27 | *
|
---|
28 | * @param sourceDirectory The standard base-path (e.g. node_modules).
|
---|
29 | * @param pathMappings Path mapping configuration, from which to extract additional base-paths.
|
---|
30 | */
|
---|
31 | export declare function getBasePaths(logger: Logger, sourceDirectory: AbsoluteFsPath, pathMappings: PathMappings | undefined): AbsoluteFsPath[];
|
---|
32 | /**
|
---|
33 | * Run a task and track how long it takes.
|
---|
34 | *
|
---|
35 | * @param task The task whose duration we are tracking.
|
---|
36 | * @param log The function to call with the duration of the task.
|
---|
37 | * @returns The result of calling `task`.
|
---|
38 | */
|
---|
39 | export declare function trackDuration<T = void>(task: () => T extends Promise<unknown> ? never : T, log: (duration: number) => void): T;
|
---|