@angular/compiler-cli 15.2.1 → 16.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-IJECERTO.js → chunk-6PDKXFWN.js} +110 -152
- package/bundles/chunk-6PDKXFWN.js.map +6 -0
- package/bundles/{chunk-2NLFVEGY.js → chunk-EKTJ7622.js} +1 -2
- package/bundles/{chunk-RMPM4VAI.js → chunk-IE2WWKOE.js} +393 -618
- package/bundles/chunk-IE2WWKOE.js.map +6 -0
- package/bundles/{chunk-7GNUPQOI.js → chunk-JEQIMWEA.js} +5 -5
- package/bundles/{chunk-TGEKDMUX.js → chunk-JKV3J53A.js} +3 -3
- package/bundles/{chunk-TGEKDMUX.js.map → chunk-JKV3J53A.js.map} +1 -1
- package/bundles/{chunk-YZWN2KWE.js → chunk-N6MSUQVH.js} +1 -2
- package/bundles/{chunk-5WBIJMZH.js → chunk-Q2TY6LB3.js} +2 -2
- package/bundles/{chunk-ZF3IVDQ2.js → chunk-QQGJEWBQ.js} +1 -10
- package/bundles/chunk-QQGJEWBQ.js.map +6 -0
- package/bundles/{chunk-IYYB2HTK.js → chunk-TK3GHMT6.js} +1 -6
- package/bundles/chunk-TK3GHMT6.js.map +6 -0
- package/bundles/{chunk-P5LISIUG.js → chunk-XS6XKZQP.js} +12 -22
- package/bundles/chunk-XS6XKZQP.js.map +6 -0
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +8 -8
- package/bundles/linker/index.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +1 -1
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +7 -7
- package/bundles/src/bin/ngc.js +7 -7
- package/bundles_metadata.json +1 -1
- package/package.json +4 -17
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
- package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
- package/src/ngtsc/core/api/src/options.d.ts +2 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
- package/src/ngtsc/core/src/host.d.ts +6 -6
- package/src/ngtsc/incremental/semantic_graph/src/graph.d.ts +1 -1
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +3 -1
- package/src/ngtsc/shims/api.d.ts +0 -19
- package/src/ngtsc/shims/index.d.ts +0 -2
- package/src/ngtsc/transform/src/compilation.d.ts +1 -1
- package/src/transformers/api.d.ts +0 -5
- package/bundles/chunk-B57SP4JB.js +0 -29
- package/bundles/chunk-B57SP4JB.js.map +0 -6
- package/bundles/chunk-IJECERTO.js.map +0 -6
- package/bundles/chunk-IYYB2HTK.js.map +0 -6
- package/bundles/chunk-K7P4IHT5.js +0 -115
- package/bundles/chunk-K7P4IHT5.js.map +0 -6
- package/bundles/chunk-P5LISIUG.js.map +0 -6
- package/bundles/chunk-PKXB2WOZ.js +0 -2187
- package/bundles/chunk-PKXB2WOZ.js.map +0 -6
- package/bundles/chunk-RMPM4VAI.js.map +0 -6
- package/bundles/chunk-WN75SNW4.js +0 -5265
- package/bundles/chunk-WN75SNW4.js.map +0 -6
- package/bundles/chunk-ZF3IVDQ2.js.map +0 -6
- package/bundles/ngcc/index.js +0 -52
- package/bundles/ngcc/index.js.map +0 -6
- package/bundles/ngcc/main-ngcc.js +0 -49
- package/bundles/ngcc/main-ngcc.js.map +0 -6
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -114
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
- package/ngcc/index.d.ts +0 -19
- package/ngcc/main-ngcc.d.ts +0 -2
- package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
- package/ngcc/src/analysis/migration_host.d.ts +0 -22
- package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
- package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
- package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
- package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
- package/ngcc/src/analysis/types.d.ts +0 -29
- package/ngcc/src/analysis/util.d.ts +0 -11
- package/ngcc/src/command_line_options.d.ts +0 -3
- package/ngcc/src/constants.d.ts +0 -9
- package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
- package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
- package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
- package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
- package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
- package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
- package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
- package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
- package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
- package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
- package/ngcc/src/execution/api.d.ts +0 -27
- package/ngcc/src/execution/cluster/api.d.ts +0 -51
- package/ngcc/src/execution/cluster/executor.d.ts +0 -29
- package/ngcc/src/execution/cluster/master.d.ts +0 -57
- package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
- package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
- package/ngcc/src/execution/cluster/utils.d.ts +0 -44
- package/ngcc/src/execution/cluster/worker.d.ts +0 -10
- package/ngcc/src/execution/create_compile_function.d.ts +0 -10
- package/ngcc/src/execution/single_process_executor.d.ts +0 -34
- package/ngcc/src/execution/tasks/api.d.ts +0 -141
- package/ngcc/src/execution/tasks/completion.d.ts +0 -41
- package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
- package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
- package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
- package/ngcc/src/execution/tasks/utils.d.ts +0 -57
- package/ngcc/src/host/commonjs_host.d.ts +0 -69
- package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
- package/ngcc/src/host/delegating_host.d.ts +0 -43
- package/ngcc/src/host/esm2015_host.d.ts +0 -935
- package/ngcc/src/host/esm5_host.d.ts +0 -299
- package/ngcc/src/host/ngcc_host.d.ts +0 -87
- package/ngcc/src/host/umd_host.d.ts +0 -85
- package/ngcc/src/host/utils.d.ts +0 -9
- package/ngcc/src/locking/async_locker.d.ts +0 -34
- package/ngcc/src/locking/lock_file.d.ts +0 -31
- package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
- package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
- package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
- package/ngcc/src/locking/sync_locker.d.ts +0 -35
- package/ngcc/src/main.d.ts +0 -17
- package/ngcc/src/migrations/migration.d.ts +0 -59
- package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
- package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
- package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
- package/ngcc/src/migrations/utils.d.ts +0 -41
- package/ngcc/src/ngcc_options.d.ts +0 -155
- package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
- package/ngcc/src/packages/build_marker.d.ts +0 -44
- package/ngcc/src/packages/bundle_program.d.ts +0 -35
- package/ngcc/src/packages/configuration.d.ts +0 -222
- package/ngcc/src/packages/entry_point.d.ts +0 -109
- package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
- package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
- package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
- package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
- package/ngcc/src/packages/source_file_cache.d.ts +0 -97
- package/ngcc/src/packages/transformer.d.ts +0 -70
- package/ngcc/src/path_mappings.d.ts +0 -19
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
- package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
- package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
- package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
- package/ngcc/src/rendering/renderer.d.ts +0 -72
- package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
- package/ngcc/src/rendering/source_maps.d.ts +0 -23
- package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
- package/ngcc/src/rendering/utils.d.ts +0 -24
- package/ngcc/src/utils.d.ts +0 -112
- package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
- package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
- package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
- package/ngcc/src/writing/file_writer.d.ts +0 -28
- package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
- package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
- package/ngcc/src/writing/package_json_updater.d.ts +0 -98
- package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
- package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
- package/src/ngtsc/ts_compatibility/index.d.ts +0 -8
- package/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -45
- /package/bundles/{chunk-2NLFVEGY.js.map → chunk-EKTJ7622.js.map} +0 -0
- /package/bundles/{chunk-7GNUPQOI.js.map → chunk-JEQIMWEA.js.map} +0 -0
- /package/bundles/{chunk-YZWN2KWE.js.map → chunk-N6MSUQVH.js.map} +0 -0
- /package/bundles/{chunk-5WBIJMZH.js.map → chunk-Q2TY6LB3.js.map} +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
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 ts from 'typescript';
|
|
9
|
-
import { ParsedConfiguration } from '../../..';
|
|
10
|
-
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
11
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
12
|
-
import { ModuleWithProvidersAnalyses } from '../analysis/module_with_providers_analyzer';
|
|
13
|
-
import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
|
14
|
-
import { CompiledFile } from '../analysis/types';
|
|
15
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
16
|
-
import { RenderingFormatter } from '../rendering/rendering_formatter';
|
|
17
|
-
import { FileToWrite } from '../rendering/utils';
|
|
18
|
-
import { EntryPointBundle } from './entry_point_bundle';
|
|
19
|
-
export type TransformResult = {
|
|
20
|
-
success: true;
|
|
21
|
-
diagnostics: ts.Diagnostic[];
|
|
22
|
-
transformedFiles: FileToWrite[];
|
|
23
|
-
} | {
|
|
24
|
-
success: false;
|
|
25
|
-
diagnostics: ts.Diagnostic[];
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* A Package is stored in a directory on disk and that directory can contain one or more package
|
|
29
|
-
* formats - e.g. fesm2015, UMD, etc. Additionally, each package provides typings (`.d.ts` files).
|
|
30
|
-
*
|
|
31
|
-
* Each of these formats exposes one or more entry points, which are source files that need to be
|
|
32
|
-
* parsed to identify the decorated exported classes that need to be analyzed and compiled by one or
|
|
33
|
-
* more `DecoratorHandler` objects.
|
|
34
|
-
*
|
|
35
|
-
* Each entry point to a package is identified by a `package.json` which contains properties that
|
|
36
|
-
* indicate what formatted bundles are accessible via this end-point.
|
|
37
|
-
*
|
|
38
|
-
* Each bundle is identified by a root `SourceFile` that can be parsed and analyzed to
|
|
39
|
-
* identify classes that need to be transformed; and then finally rendered and written to disk.
|
|
40
|
-
*
|
|
41
|
-
* Along with the source files, the corresponding source maps (either inline or external) and
|
|
42
|
-
* `.d.ts` files are transformed accordingly.
|
|
43
|
-
*
|
|
44
|
-
* - Flat file packages have all the classes in a single file.
|
|
45
|
-
* - Other packages may re-export classes from other non-entry point files.
|
|
46
|
-
* - Some formats may contain multiple "modules" in a single file.
|
|
47
|
-
*/
|
|
48
|
-
export declare class Transformer {
|
|
49
|
-
private fs;
|
|
50
|
-
private logger;
|
|
51
|
-
private tsConfig;
|
|
52
|
-
constructor(fs: ReadonlyFileSystem, logger: Logger, tsConfig?: ParsedConfiguration | null);
|
|
53
|
-
/**
|
|
54
|
-
* Transform the source (and typings) files of a bundle.
|
|
55
|
-
* @param bundle the bundle to transform.
|
|
56
|
-
* @returns information about the files that were transformed.
|
|
57
|
-
*/
|
|
58
|
-
transform(bundle: EntryPointBundle): TransformResult;
|
|
59
|
-
getHost(bundle: EntryPointBundle): NgccReflectionHost;
|
|
60
|
-
getRenderingFormatter(host: NgccReflectionHost, bundle: EntryPointBundle): RenderingFormatter;
|
|
61
|
-
analyzeProgram(reflectionHost: NgccReflectionHost, bundle: EntryPointBundle): ProgramAnalyses;
|
|
62
|
-
}
|
|
63
|
-
export declare function hasErrors(diagnostics: ts.Diagnostic[]): boolean;
|
|
64
|
-
interface ProgramAnalyses {
|
|
65
|
-
decorationAnalyses: Map<ts.SourceFile, CompiledFile>;
|
|
66
|
-
privateDeclarationsAnalyses: ExportInfo[];
|
|
67
|
-
moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null;
|
|
68
|
-
diagnostics: ts.Diagnostic[];
|
|
69
|
-
}
|
|
70
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { AbsoluteFsPath, PathManipulation } from '../../src/ngtsc/file_system';
|
|
9
|
-
import { ParsedConfiguration } from '../../src/perform_compile';
|
|
10
|
-
export type PathMappings = {
|
|
11
|
-
baseUrl: string;
|
|
12
|
-
paths: {
|
|
13
|
-
[key: string]: string[];
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* If `pathMappings` is not provided directly, then try getting it from `tsConfig`, if available.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getPathMappingsFromTsConfig(fs: PathManipulation, tsConfig: ParsedConfiguration | null, projectPath: AbsoluteFsPath): PathMappings | undefined;
|
|
@@ -1,34 +0,0 @@
|
|
|
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 MagicString from 'magic-string';
|
|
9
|
-
import ts from 'typescript';
|
|
10
|
-
import { PathManipulation } from '../../../src/ngtsc/file_system';
|
|
11
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
12
|
-
import { Import, ImportManager } from '../../../src/ngtsc/translator';
|
|
13
|
-
import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
|
14
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
15
|
-
import { Esm5RenderingFormatter } from './esm5_rendering_formatter';
|
|
16
|
-
/**
|
|
17
|
-
* A RenderingFormatter that works with CommonJS files, instead of `import` and `export` statements
|
|
18
|
-
* the module is an IIFE with a factory function call with dependencies, which are defined in a
|
|
19
|
-
* wrapper function for AMD, CommonJS and global module formats.
|
|
20
|
-
*/
|
|
21
|
-
export declare class CommonJsRenderingFormatter extends Esm5RenderingFormatter {
|
|
22
|
-
protected commonJsHost: NgccReflectionHost;
|
|
23
|
-
constructor(fs: PathManipulation, commonJsHost: NgccReflectionHost, isCore: boolean);
|
|
24
|
-
/**
|
|
25
|
-
* Add the imports below any in situ imports as `require` calls.
|
|
26
|
-
*/
|
|
27
|
-
addImports(output: MagicString, imports: Import[], file: ts.SourceFile): void;
|
|
28
|
-
/**
|
|
29
|
-
* Add the exports to the bottom of the file.
|
|
30
|
-
*/
|
|
31
|
-
addExports(output: MagicString, entryPointBasePath: string, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
32
|
-
addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
33
|
-
protected findEndOfImports(sf: ts.SourceFile): number;
|
|
34
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
2
|
-
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
3
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
4
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
5
|
-
import { CompileResult } from '../../../src/ngtsc/transform';
|
|
6
|
-
import { ModuleWithProvidersAnalyses, ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
|
|
7
|
-
import { ExportInfo, PrivateDeclarationsAnalyses } from '../analysis/private_declarations_analyzer';
|
|
8
|
-
import { DecorationAnalyses } from '../analysis/types';
|
|
9
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
10
|
-
import { EntryPointBundle } from '../packages/entry_point_bundle';
|
|
11
|
-
import { RenderingFormatter } from './rendering_formatter';
|
|
12
|
-
import { FileToWrite } from './utils';
|
|
13
|
-
/**
|
|
14
|
-
* A structure that captures information about what needs to be rendered
|
|
15
|
-
* in a typings file.
|
|
16
|
-
*
|
|
17
|
-
* It is created as a result of processing the analysis passed to the renderer.
|
|
18
|
-
*
|
|
19
|
-
* The `renderDtsFile()` method consumes it when rendering a typings file.
|
|
20
|
-
*/
|
|
21
|
-
declare class DtsRenderInfo {
|
|
22
|
-
classInfo: DtsClassInfo[];
|
|
23
|
-
moduleWithProviders: ModuleWithProvidersInfo[];
|
|
24
|
-
privateExports: ExportInfo[];
|
|
25
|
-
reexports: Reexport[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Information about a class in a typings file.
|
|
29
|
-
*/
|
|
30
|
-
export interface DtsClassInfo {
|
|
31
|
-
dtsDeclaration: ts.Declaration;
|
|
32
|
-
compilation: CompileResult[];
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* A base-class for rendering an `AnalyzedFile`.
|
|
36
|
-
*
|
|
37
|
-
* Package formats have output files that must be rendered differently. Concrete sub-classes must
|
|
38
|
-
* implement the `addImports`, `addDefinitions` and `removeDecorators` abstract methods.
|
|
39
|
-
*/
|
|
40
|
-
export declare class DtsRenderer {
|
|
41
|
-
private dtsFormatter;
|
|
42
|
-
private fs;
|
|
43
|
-
private logger;
|
|
44
|
-
private host;
|
|
45
|
-
private bundle;
|
|
46
|
-
constructor(dtsFormatter: RenderingFormatter, fs: ReadonlyFileSystem, logger: Logger, host: NgccReflectionHost, bundle: EntryPointBundle);
|
|
47
|
-
renderProgram(decorationAnalyses: DecorationAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses, moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null): FileToWrite[];
|
|
48
|
-
renderDtsFile(dtsFile: ts.SourceFile, renderInfo: DtsRenderInfo): FileToWrite[];
|
|
49
|
-
private getTypingsFilesToRender;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
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 { Statement } from '@angular/compiler';
|
|
9
|
-
import MagicString from 'magic-string';
|
|
10
|
-
import ts from 'typescript';
|
|
11
|
-
import { ImportManager } from '../../../src/ngtsc/translator';
|
|
12
|
-
import { CompiledClass } from '../analysis/types';
|
|
13
|
-
import { EsmRenderingFormatter } from './esm_rendering_formatter';
|
|
14
|
-
/**
|
|
15
|
-
* A RenderingFormatter that works with files that use ECMAScript Module `import` and `export`
|
|
16
|
-
* statements, but instead of `class` declarations it uses ES5 `function` wrappers for classes.
|
|
17
|
-
*/
|
|
18
|
-
export declare class Esm5RenderingFormatter extends EsmRenderingFormatter {
|
|
19
|
-
/**
|
|
20
|
-
* Add the definitions, directly before the return statement, inside the IIFE of each decorated
|
|
21
|
-
* class.
|
|
22
|
-
*/
|
|
23
|
-
addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
|
|
24
|
-
/**
|
|
25
|
-
* Convert a `Statement` to JavaScript code in a format suitable for rendering by this formatter.
|
|
26
|
-
*
|
|
27
|
-
* @param stmt The `Statement` to print.
|
|
28
|
-
* @param sourceFile A `ts.SourceFile` that provides context for the statement. See
|
|
29
|
-
* `ts.Printer#printNode()` for more info.
|
|
30
|
-
* @param importManager The `ImportManager` to use for managing imports.
|
|
31
|
-
*
|
|
32
|
-
* @return The JavaScript code corresponding to `stmt` (in the appropriate format).
|
|
33
|
-
*/
|
|
34
|
-
printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
|
|
35
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
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 { Statement } from '@angular/compiler';
|
|
9
|
-
import MagicString from 'magic-string';
|
|
10
|
-
import ts from 'typescript';
|
|
11
|
-
import { AbsoluteFsPath, PathManipulation } from '../../../src/ngtsc/file_system';
|
|
12
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
13
|
-
import { Import, ImportManager } from '../../../src/ngtsc/translator';
|
|
14
|
-
import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
|
|
15
|
-
import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
|
16
|
-
import { CompiledClass } from '../analysis/types';
|
|
17
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
18
|
-
import { RedundantDecoratorMap, RenderingFormatter } from './rendering_formatter';
|
|
19
|
-
/**
|
|
20
|
-
* A RenderingFormatter that works with ECMAScript Module import and export statements.
|
|
21
|
-
*/
|
|
22
|
-
export declare class EsmRenderingFormatter implements RenderingFormatter {
|
|
23
|
-
protected fs: PathManipulation;
|
|
24
|
-
protected host: NgccReflectionHost;
|
|
25
|
-
protected isCore: boolean;
|
|
26
|
-
protected printer: ts.Printer;
|
|
27
|
-
constructor(fs: PathManipulation, host: NgccReflectionHost, isCore: boolean);
|
|
28
|
-
/**
|
|
29
|
-
* Add the imports at the top of the file, after any imports that are already there.
|
|
30
|
-
*/
|
|
31
|
-
addImports(output: MagicString, imports: Import[], sf: ts.SourceFile): void;
|
|
32
|
-
/**
|
|
33
|
-
* Add the exports to the end of the file.
|
|
34
|
-
*/
|
|
35
|
-
addExports(output: MagicString, entryPointBasePath: AbsoluteFsPath, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
36
|
-
/**
|
|
37
|
-
* Add plain exports to the end of the file.
|
|
38
|
-
*
|
|
39
|
-
* Unlike `addExports`, direct exports go directly in a .js and .d.ts file and don't get added to
|
|
40
|
-
* an entrypoint.
|
|
41
|
-
*/
|
|
42
|
-
addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
43
|
-
/**
|
|
44
|
-
* Add the constants directly after the imports.
|
|
45
|
-
*/
|
|
46
|
-
addConstants(output: MagicString, constants: string, file: ts.SourceFile): void;
|
|
47
|
-
/**
|
|
48
|
-
* Add the definitions directly after their decorated class.
|
|
49
|
-
*/
|
|
50
|
-
addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* Add the adjacent statements after all static properties of the class.
|
|
53
|
-
*/
|
|
54
|
-
addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Remove static decorator properties from classes.
|
|
57
|
-
*/
|
|
58
|
-
removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
|
|
59
|
-
/**
|
|
60
|
-
* Add the type parameters to the appropriate functions that return `ModuleWithProviders`
|
|
61
|
-
* structures.
|
|
62
|
-
*
|
|
63
|
-
* This function will only get called on typings files.
|
|
64
|
-
*/
|
|
65
|
-
addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
|
|
66
|
-
/**
|
|
67
|
-
* Convert a `Statement` to JavaScript code in a format suitable for rendering by this formatter.
|
|
68
|
-
*
|
|
69
|
-
* @param stmt The `Statement` to print.
|
|
70
|
-
* @param sourceFile A `ts.SourceFile` that provides context for the statement. See
|
|
71
|
-
* `ts.Printer#printNode()` for more info.
|
|
72
|
-
* @param importManager The `ImportManager` to use for managing imports.
|
|
73
|
-
*
|
|
74
|
-
* @return The JavaScript code corresponding to `stmt` (in the appropriate format).
|
|
75
|
-
*/
|
|
76
|
-
printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
|
|
77
|
-
protected findEndOfImports(sf: ts.SourceFile): number;
|
|
78
|
-
/**
|
|
79
|
-
* Check whether the given type is the core Angular `ModuleWithProviders` interface.
|
|
80
|
-
* @param typeName The type to check.
|
|
81
|
-
* @returns true if the type is the core Angular `ModuleWithProviders` interface.
|
|
82
|
-
*/
|
|
83
|
-
private isCoreModuleWithProvidersType;
|
|
84
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 { ImportRewriter } from '../../../src/ngtsc/imports';
|
|
9
|
-
export declare class NgccFlatImportRewriter implements ImportRewriter {
|
|
10
|
-
shouldImportSymbol(symbol: string, specifier: string): boolean;
|
|
11
|
-
rewriteSymbol(symbol: string, specifier: string): string;
|
|
12
|
-
rewriteSpecifier(originalModulePath: string, inContextOfFile: string): string;
|
|
13
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
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 { ConstantPool } from '@angular/compiler';
|
|
9
|
-
import ts from 'typescript';
|
|
10
|
-
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
11
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
12
|
-
import { ImportManager } from '../../../src/ngtsc/translator';
|
|
13
|
-
import { ParsedConfiguration } from '../../../src/perform_compile';
|
|
14
|
-
import { PrivateDeclarationsAnalyses } from '../analysis/private_declarations_analyzer';
|
|
15
|
-
import { CompiledFile, DecorationAnalyses } from '../analysis/types';
|
|
16
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
17
|
-
import { EntryPointBundle } from '../packages/entry_point_bundle';
|
|
18
|
-
import { RenderingFormatter } from './rendering_formatter';
|
|
19
|
-
import { FileToWrite } from './utils';
|
|
20
|
-
/**
|
|
21
|
-
* A base-class for rendering an `AnalyzedFile`.
|
|
22
|
-
*
|
|
23
|
-
* Package formats have output files that must be rendered differently. Concrete sub-classes must
|
|
24
|
-
* implement the `addImports`, `addDefinitions` and `removeDecorators` abstract methods.
|
|
25
|
-
*/
|
|
26
|
-
export declare class Renderer {
|
|
27
|
-
private host;
|
|
28
|
-
private srcFormatter;
|
|
29
|
-
private fs;
|
|
30
|
-
private logger;
|
|
31
|
-
private bundle;
|
|
32
|
-
private tsConfig;
|
|
33
|
-
constructor(host: NgccReflectionHost, srcFormatter: RenderingFormatter, fs: ReadonlyFileSystem, logger: Logger, bundle: EntryPointBundle, tsConfig?: ParsedConfiguration | null);
|
|
34
|
-
renderProgram(decorationAnalyses: DecorationAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
|
|
35
|
-
/**
|
|
36
|
-
* Render the source code and source-map for an Analyzed file.
|
|
37
|
-
* @param compiledFile The analyzed file to render.
|
|
38
|
-
* @param targetPath The absolute path where the rendered file will be written.
|
|
39
|
-
*/
|
|
40
|
-
renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
|
|
41
|
-
/**
|
|
42
|
-
* From the given list of classes, computes a map of decorators that should be removed.
|
|
43
|
-
* The decorators to remove are keyed by their container node, such that we can tell if
|
|
44
|
-
* we should remove the entire decorator property.
|
|
45
|
-
* @param classes The list of classes that may have decorators to remove.
|
|
46
|
-
* @returns A map of decorators to remove, keyed by their container node.
|
|
47
|
-
*/
|
|
48
|
-
private computeDecoratorsToRemove;
|
|
49
|
-
/**
|
|
50
|
-
* Render the definitions as source code for the given class.
|
|
51
|
-
* @param sourceFile The file containing the class to process.
|
|
52
|
-
* @param clazz The class whose definitions are to be rendered.
|
|
53
|
-
* @param compilation The results of analyzing the class - this is used to generate the rendered
|
|
54
|
-
* definitions.
|
|
55
|
-
* @param imports An object that tracks the imports that are needed by the rendered definitions.
|
|
56
|
-
*/
|
|
57
|
-
private renderDefinitions;
|
|
58
|
-
/**
|
|
59
|
-
* Render the adjacent statements as source code for the given class.
|
|
60
|
-
* @param sourceFile The file containing the class to process.
|
|
61
|
-
* @param clazz The class whose statements are to be rendered.
|
|
62
|
-
* @param compilation The results of analyzing the class - this is used to generate the rendered
|
|
63
|
-
* definitions.
|
|
64
|
-
* @param imports An object that tracks the imports that are needed by the rendered definitions.
|
|
65
|
-
*/
|
|
66
|
-
private renderAdjacentStatements;
|
|
67
|
-
private renderStatements;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Render the constant pool as source code for the given class.
|
|
71
|
-
*/
|
|
72
|
-
export declare function renderConstantPool(formatter: RenderingFormatter, sourceFile: ts.SourceFile, constantPool: ConstantPool, imports: ImportManager): string;
|
|
@@ -1,37 +0,0 @@
|
|
|
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 { Statement } from '@angular/compiler';
|
|
9
|
-
import MagicString from 'magic-string';
|
|
10
|
-
import ts from 'typescript';
|
|
11
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
12
|
-
import { Import, ImportManager } from '../../../src/ngtsc/translator';
|
|
13
|
-
import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
|
|
14
|
-
import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
|
15
|
-
import { CompiledClass } from '../analysis/types';
|
|
16
|
-
/**
|
|
17
|
-
* The collected decorators that have become redundant after the compilation
|
|
18
|
-
* of Ivy static fields. The map is keyed by the container node, such that we
|
|
19
|
-
* can tell if we should remove the entire decorator property
|
|
20
|
-
*/
|
|
21
|
-
export type RedundantDecoratorMap = Map<ts.Node, ts.Node[]>;
|
|
22
|
-
export declare const RedundantDecoratorMap: MapConstructor;
|
|
23
|
-
/**
|
|
24
|
-
* Implement this interface with methods that know how to render a specific format,
|
|
25
|
-
* such as ESM5 or UMD.
|
|
26
|
-
*/
|
|
27
|
-
export interface RenderingFormatter {
|
|
28
|
-
addConstants(output: MagicString, constants: string, file: ts.SourceFile): void;
|
|
29
|
-
addImports(output: MagicString, imports: Import[], sf: ts.SourceFile): void;
|
|
30
|
-
addExports(output: MagicString, entryPointBasePath: string, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
31
|
-
addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
32
|
-
addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
|
|
33
|
-
addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
|
|
34
|
-
removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
|
|
35
|
-
addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
|
|
36
|
-
printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
|
|
37
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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 mapHelpers from 'convert-source-map';
|
|
9
|
-
import MagicString from 'magic-string';
|
|
10
|
-
import ts from 'typescript';
|
|
11
|
-
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
12
|
-
import { Logger } from '../../../src/ngtsc/logging';
|
|
13
|
-
import { FileToWrite } from './utils';
|
|
14
|
-
export interface SourceMapInfo {
|
|
15
|
-
source: string;
|
|
16
|
-
map: mapHelpers.SourceMapConverter | null;
|
|
17
|
-
isInline: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Merge the input and output source-maps, replacing the source-map comment in the output file
|
|
21
|
-
* with an appropriate source-map comment pointing to the merged source-map.
|
|
22
|
-
*/
|
|
23
|
-
export declare function renderSourceAndMap(logger: Logger, fs: ReadonlyFileSystem, sourceFile: ts.SourceFile, generatedMagicString: MagicString): FileToWrite[];
|
|
@@ -1,54 +0,0 @@
|
|
|
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 MagicString from 'magic-string';
|
|
9
|
-
import ts from 'typescript';
|
|
10
|
-
import { PathManipulation } from '../../../src/ngtsc/file_system';
|
|
11
|
-
import { Reexport } from '../../../src/ngtsc/imports';
|
|
12
|
-
import { Import, ImportManager } from '../../../src/ngtsc/translator';
|
|
13
|
-
import { ExportInfo } from '../analysis/private_declarations_analyzer';
|
|
14
|
-
import { UmdReflectionHost } from '../host/umd_host';
|
|
15
|
-
import { Esm5RenderingFormatter } from './esm5_rendering_formatter';
|
|
16
|
-
/**
|
|
17
|
-
* A RenderingFormatter that works with UMD files, instead of `import` and `export` statements
|
|
18
|
-
* the module is an IIFE with a factory function call with dependencies, which are defined in a
|
|
19
|
-
* wrapper function for AMD, CommonJS and global module formats.
|
|
20
|
-
*/
|
|
21
|
-
export declare class UmdRenderingFormatter extends Esm5RenderingFormatter {
|
|
22
|
-
protected umdHost: UmdReflectionHost;
|
|
23
|
-
constructor(fs: PathManipulation, umdHost: UmdReflectionHost, isCore: boolean);
|
|
24
|
-
/**
|
|
25
|
-
* Add the imports to the UMD module IIFE.
|
|
26
|
-
*
|
|
27
|
-
* Note that imports at "prepended" to the start of the parameter list of the factory function,
|
|
28
|
-
* and so also to the arguments passed to it when it is called.
|
|
29
|
-
* This is because there are scenarios where the factory function does not accept as many
|
|
30
|
-
* parameters as are passed as argument in the call. For example:
|
|
31
|
-
*
|
|
32
|
-
* ```
|
|
33
|
-
* (function (global, factory) {
|
|
34
|
-
* typeof exports === 'object' && typeof module !== 'undefined' ?
|
|
35
|
-
* factory(exports,require('x'),require('z')) :
|
|
36
|
-
* typeof define === 'function' && define.amd ?
|
|
37
|
-
* define(['exports', 'x', 'z'], factory) :
|
|
38
|
-
* (global = global || self, factory(global.myBundle = {}, global.x));
|
|
39
|
-
* }(this, (function (exports, x) { ... }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* (See that the `z` import is not being used by the factory function.)
|
|
43
|
-
*/
|
|
44
|
-
addImports(output: MagicString, imports: Import[], file: ts.SourceFile): void;
|
|
45
|
-
/**
|
|
46
|
-
* Add the exports to the bottom of the UMD module factory function.
|
|
47
|
-
*/
|
|
48
|
-
addExports(output: MagicString, entryPointBasePath: string, exports: ExportInfo[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
49
|
-
addDirectExports(output: MagicString, exports: Reexport[], importManager: ImportManager, file: ts.SourceFile): void;
|
|
50
|
-
/**
|
|
51
|
-
* Add the constants to the top of the UMD factory function.
|
|
52
|
-
*/
|
|
53
|
-
addConstants(output: MagicString, constants: string, file: ts.SourceFile): void;
|
|
54
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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 ts from 'typescript';
|
|
9
|
-
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
|
|
10
|
-
import { ImportRewriter } from '../../../src/ngtsc/imports';
|
|
11
|
-
/**
|
|
12
|
-
* Information about a file that has been rendered.
|
|
13
|
-
*/
|
|
14
|
-
export interface FileToWrite {
|
|
15
|
-
/** Path to where the file should be written. */
|
|
16
|
-
path: AbsoluteFsPath;
|
|
17
|
-
/** The contents of the file to be be written. */
|
|
18
|
-
contents: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Create an appropriate ImportRewriter given the parameters.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getImportRewriter(r3SymbolsFile: ts.SourceFile | null, isCore: boolean, isFlat: boolean): ImportRewriter;
|
|
24
|
-
export declare function stripExtension<T extends string>(filePath: T): T;
|
package/ngcc/src/utils.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
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 ts from 'typescript';
|
|
9
|
-
import { AbsoluteFsPath, ReadonlyFileSystem } from '../../src/ngtsc/file_system';
|
|
10
|
-
import { DeclarationNode, KnownDeclaration } from '../../src/ngtsc/reflection';
|
|
11
|
-
export type JsonPrimitive = string | number | boolean | null;
|
|
12
|
-
export type JsonValue = JsonPrimitive | JsonArray | JsonObject | undefined;
|
|
13
|
-
export interface JsonArray extends Array<JsonValue> {
|
|
14
|
-
}
|
|
15
|
-
export interface JsonObject {
|
|
16
|
-
[key: string]: JsonValue;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A list (`Array`) of partially ordered `T` items.
|
|
20
|
-
*
|
|
21
|
-
* The items in the list are partially ordered in the sense that any element has either the same or
|
|
22
|
-
* higher precedence than any element which appears later in the list. What "higher precedence"
|
|
23
|
-
* means and how it is determined is implementation-dependent.
|
|
24
|
-
*
|
|
25
|
-
* See [PartiallyOrderedSet](https://en.wikipedia.org/wiki/Partially_ordered_set) for more details.
|
|
26
|
-
* (Refraining from using the term "set" here, to avoid confusion with JavaScript's
|
|
27
|
-
* [Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set).)
|
|
28
|
-
*
|
|
29
|
-
* NOTE: A plain `Array<T>` is not assignable to a `PartiallyOrderedList<T>`, but a
|
|
30
|
-
* `PartiallyOrderedList<T>` is assignable to an `Array<T>`.
|
|
31
|
-
*/
|
|
32
|
-
export interface PartiallyOrderedList<T> extends Array<T> {
|
|
33
|
-
_partiallyOrdered: true;
|
|
34
|
-
map<U>(callbackfn: (value: T, index: number, array: PartiallyOrderedList<T>) => U, thisArg?: any): PartiallyOrderedList<U>;
|
|
35
|
-
slice(...args: Parameters<Array<T>['slice']>): PartiallyOrderedList<T>;
|
|
36
|
-
}
|
|
37
|
-
export declare function getOriginalSymbol(checker: ts.TypeChecker): (symbol: ts.Symbol) => ts.Symbol;
|
|
38
|
-
export declare function isDefined<T>(value: T | undefined | null): value is T;
|
|
39
|
-
export declare function getNameText(name: ts.PropertyName | ts.BindingName): string;
|
|
40
|
-
/**
|
|
41
|
-
* Does the given declaration have a name which is an identifier?
|
|
42
|
-
* @param declaration The declaration to test.
|
|
43
|
-
* @returns true if the declaration has an identifier for a name.
|
|
44
|
-
*/
|
|
45
|
-
export declare function hasNameIdentifier(declaration: ts.Node): declaration is DeclarationNode & {
|
|
46
|
-
name: ts.Identifier;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Test whether a path is "relative".
|
|
50
|
-
*
|
|
51
|
-
* Relative paths start with `/`, `./` or `../` (or the Windows equivalents); or are simply `.` or
|
|
52
|
-
* `..`.
|
|
53
|
-
*/
|
|
54
|
-
export declare function isRelativePath(path: string): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* A `Map`-like object that can compute and memoize a missing value for any key.
|
|
57
|
-
*
|
|
58
|
-
* The computed values are memoized, so the factory function is not called more than once per key.
|
|
59
|
-
* This is useful for storing values that are expensive to compute and may be used multiple times.
|
|
60
|
-
*/
|
|
61
|
-
export declare class FactoryMap<K, V> {
|
|
62
|
-
private factory;
|
|
63
|
-
private internalMap;
|
|
64
|
-
constructor(factory: (key: K) => V, entries?: readonly (readonly [K, V])[] | null);
|
|
65
|
-
get(key: K): V;
|
|
66
|
-
set(key: K, value: V): void;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Attempt to resolve a `path` to a file by appending the provided `postFixes`
|
|
70
|
-
* to the `path` and checking if the file exists on disk.
|
|
71
|
-
* @returns An absolute path to the first matching existing file, or `null` if none exist.
|
|
72
|
-
*/
|
|
73
|
-
export declare function resolveFileWithPostfixes(fs: ReadonlyFileSystem, path: AbsoluteFsPath, postFixes: string[]): AbsoluteFsPath | null;
|
|
74
|
-
/**
|
|
75
|
-
* Determine whether a function declaration corresponds with a TypeScript helper function, returning
|
|
76
|
-
* its kind if so or null if the declaration does not seem to correspond with such a helper.
|
|
77
|
-
*/
|
|
78
|
-
export declare function getTsHelperFnFromDeclaration(decl: DeclarationNode): KnownDeclaration | null;
|
|
79
|
-
/**
|
|
80
|
-
* Determine whether an identifier corresponds with a TypeScript helper function (based on its
|
|
81
|
-
* name), returning its kind if so or null if the identifier does not seem to correspond with such a
|
|
82
|
-
* helper.
|
|
83
|
-
*/
|
|
84
|
-
export declare function getTsHelperFnFromIdentifier(id: ts.Identifier): KnownDeclaration | null;
|
|
85
|
-
/**
|
|
86
|
-
* An identifier may become repeated when bundling multiple source files into a single bundle, so
|
|
87
|
-
* bundlers have a strategy of suffixing non-unique identifiers with a suffix like $2. This function
|
|
88
|
-
* strips off such suffixes, so that ngcc deals with the canonical name of an identifier.
|
|
89
|
-
* @param value The value to strip any suffix of, if applicable.
|
|
90
|
-
* @returns The canonical representation of the value, without any suffix.
|
|
91
|
-
*/
|
|
92
|
-
export declare function stripDollarSuffix(value: string): string;
|
|
93
|
-
export declare function stripExtension(fileName: string): string;
|
|
94
|
-
/**
|
|
95
|
-
* Parse the JSON from a `package.json` file.
|
|
96
|
-
*
|
|
97
|
-
* @param packageJsonPath The absolute path to the `package.json` file.
|
|
98
|
-
* @returns JSON from the `package.json` file if it exists and is valid, `null` otherwise.
|
|
99
|
-
*/
|
|
100
|
-
export declare function loadJson<T extends JsonObject = JsonObject>(fs: ReadonlyFileSystem, packageJsonPath: AbsoluteFsPath): T | null;
|
|
101
|
-
/**
|
|
102
|
-
* Given the parsed JSON of a `package.json` file, try to extract info for a secondary entry-point
|
|
103
|
-
* from the `exports` property. Such info will only be present for packages following Angular
|
|
104
|
-
* Package Format v14+.
|
|
105
|
-
*
|
|
106
|
-
* @param primaryPackageJson The parsed JSON of the primary `package.json` (or `null` if it failed
|
|
107
|
-
* to be loaded).
|
|
108
|
-
* @param packagePath The absolute path to the containing npm package.
|
|
109
|
-
* @param entryPointPath The absolute path to the secondary entry-point.
|
|
110
|
-
* @returns The `exports` info for the specified entry-point if it exists, `null` otherwise.
|
|
111
|
-
*/
|
|
112
|
-
export declare function loadSecondaryEntryPointInfoForApfV14(fs: ReadonlyFileSystem, primaryPackageJson: JsonObject | null, packagePath: AbsoluteFsPath, entryPointPath: AbsoluteFsPath): JsonObject | null;
|