@angular/compiler-cli 15.2.0 → 16.0.0-next.0
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-PKSKJEUS.js → chunk-2DMH5JXJ.js} +9 -18
- package/bundles/{chunk-PKSKJEUS.js.map → chunk-2DMH5JXJ.js.map} +1 -1
- package/bundles/{chunk-P6SWFK2U.js → chunk-4TCRZYAK.js} +2 -2
- package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
- package/bundles/{chunk-2PLRZDNU.js → chunk-6CARGXRJ.js} +5 -5
- package/bundles/{chunk-O4JLZZWJ.js → chunk-EDWIBG7R.js} +1 -10
- package/bundles/chunk-EDWIBG7R.js.map +6 -0
- package/bundles/{chunk-6ZJFIQBG.js → chunk-GYHDNUIK.js} +1 -2
- package/bundles/{chunk-2OF2AI57.js → chunk-IS6KZYEA.js} +377 -609
- package/bundles/chunk-IS6KZYEA.js.map +6 -0
- package/bundles/{chunk-J3L7WZP3.js → chunk-JHMH3CX2.js} +3 -3
- package/bundles/{chunk-ZCBRXUPO.js → chunk-K2A5WD7L.js} +1 -6
- package/bundles/chunk-K2A5WD7L.js.map +6 -0
- package/bundles/{chunk-QRHWLC7U.js → chunk-PSGRCFPQ.js} +2 -2
- 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 +2 -15
- 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 +3 -5
- package/src/ngtsc/shims/api.d.ts +0 -19
- package/src/ngtsc/shims/index.d.ts +0 -2
- package/src/transformers/api.d.ts +0 -5
- package/bundles/chunk-2OF2AI57.js.map +0 -6
- package/bundles/chunk-7DUI3BSX.js +0 -29
- package/bundles/chunk-7DUI3BSX.js.map +0 -6
- package/bundles/chunk-MLCT4AWL.js +0 -2187
- package/bundles/chunk-MLCT4AWL.js.map +0 -6
- package/bundles/chunk-NXCQCU6C.js +0 -5265
- package/bundles/chunk-NXCQCU6C.js.map +0 -6
- package/bundles/chunk-O4JLZZWJ.js.map +0 -6
- package/bundles/chunk-YRDMG3GM.js +0 -115
- package/bundles/chunk-YRDMG3GM.js.map +0 -6
- package/bundles/chunk-ZCBRXUPO.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/bundles/{chunk-P6SWFK2U.js.map → chunk-4TCRZYAK.js.map} +0 -0
- /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
- /package/bundles/{chunk-2PLRZDNU.js.map → chunk-6CARGXRJ.js.map} +0 -0
- /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
- /package/bundles/{chunk-J3L7WZP3.js.map → chunk-JHMH3CX2.js.map} +0 -0
- /package/bundles/{chunk-QRHWLC7U.js.map → chunk-PSGRCFPQ.js.map} +0 -0
|
@@ -1,27 +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 { Logger } from '../../../../../src/ngtsc/logging';
|
|
9
|
-
import { PartiallyOrderedTasks, Task, TaskDependencies } from '../api';
|
|
10
|
-
import { BaseTaskQueue } from './base_task_queue';
|
|
11
|
-
/**
|
|
12
|
-
* A `TaskQueue` implementation that assumes tasks are processed in parallel, thus has to ensure a
|
|
13
|
-
* task's dependencies have been processed before processing the task.
|
|
14
|
-
*/
|
|
15
|
-
export declare class ParallelTaskQueue extends BaseTaskQueue {
|
|
16
|
-
/**
|
|
17
|
-
* A map from Tasks to the Tasks that it depends upon.
|
|
18
|
-
*
|
|
19
|
-
* This is the reverse mapping of `TaskDependencies`.
|
|
20
|
-
*/
|
|
21
|
-
private blockedTasks;
|
|
22
|
-
constructor(logger: Logger, tasks: PartiallyOrderedTasks, dependencies: TaskDependencies);
|
|
23
|
-
computeNextTask(): Task | null;
|
|
24
|
-
markAsCompleted(task: Task): void;
|
|
25
|
-
toString(): string;
|
|
26
|
-
private stringifyBlockedTasks;
|
|
27
|
-
}
|
|
@@ -1,16 +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 { Task } from '../api';
|
|
9
|
-
import { BaseTaskQueue } from './base_task_queue';
|
|
10
|
-
/**
|
|
11
|
-
* A `TaskQueue` implementation that assumes tasks are processed serially and each one is completed
|
|
12
|
-
* before requesting the next one.
|
|
13
|
-
*/
|
|
14
|
-
export declare class SerialTaskQueue extends BaseTaskQueue {
|
|
15
|
-
computeNextTask(): Task | null;
|
|
16
|
-
}
|
|
@@ -1,57 +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 { DepGraph } from 'dependency-graph';
|
|
9
|
-
import { EntryPoint } from '../../packages/entry_point';
|
|
10
|
-
import { PartiallyOrderedTasks, Task, TaskDependencies } from './api';
|
|
11
|
-
/** Stringify a task for debugging purposes. */
|
|
12
|
-
export declare const stringifyTask: (task: Task) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Compute a mapping of tasks to the tasks that are dependent on them (if any).
|
|
15
|
-
*
|
|
16
|
-
* Task A can depend upon task B, if either:
|
|
17
|
-
*
|
|
18
|
-
* * A and B have the same entry-point _and_ B is generating the typings for that entry-point
|
|
19
|
-
* (i.e. has `processDts: true`).
|
|
20
|
-
* * A's entry-point depends on B's entry-point _and_ B is also generating typings.
|
|
21
|
-
*
|
|
22
|
-
* NOTE: If a task is not generating typings, then it cannot affect anything which depends on its
|
|
23
|
-
* entry-point, regardless of the dependency graph. To put this another way, only the task
|
|
24
|
-
* which produces the typings for a dependency needs to have been completed.
|
|
25
|
-
*
|
|
26
|
-
* As a performance optimization, we take into account the fact that `tasks` are sorted in such a
|
|
27
|
-
* way that a task can only depend on earlier tasks (i.e. dependencies always come before
|
|
28
|
-
* dependents in the list of tasks).
|
|
29
|
-
*
|
|
30
|
-
* @param tasks A (partially ordered) list of tasks.
|
|
31
|
-
* @param graph The dependency graph between entry-points.
|
|
32
|
-
* @return A map from each task to those tasks directly dependent upon it.
|
|
33
|
-
*/
|
|
34
|
-
export declare function computeTaskDependencies(tasks: PartiallyOrderedTasks, graph: DepGraph<EntryPoint>): TaskDependencies;
|
|
35
|
-
export declare function getDependentsSet(map: TaskDependencies, task: Task): Set<Task>;
|
|
36
|
-
/**
|
|
37
|
-
* Invert the given mapping of Task dependencies.
|
|
38
|
-
*
|
|
39
|
-
* @param dependencies The mapping of tasks to the tasks that depend upon them.
|
|
40
|
-
* @returns A mapping of tasks to the tasks that they depend upon.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getBlockedTasks(dependencies: TaskDependencies): Map<Task, Set<Task>>;
|
|
43
|
-
/**
|
|
44
|
-
* Sort a list of tasks by priority.
|
|
45
|
-
*
|
|
46
|
-
* Priority is determined by the number of other tasks that a task is (transitively) blocking:
|
|
47
|
-
* The more tasks a task is blocking the higher its priority is, because processing it will
|
|
48
|
-
* potentially unblock more tasks.
|
|
49
|
-
*
|
|
50
|
-
* To keep the behavior predictable, if two tasks block the same number of other tasks, their
|
|
51
|
-
* relative order in the original `tasks` lists is preserved.
|
|
52
|
-
*
|
|
53
|
-
* @param tasks A (partially ordered) list of tasks.
|
|
54
|
-
* @param dependencies The mapping of tasks to the tasks that depend upon them.
|
|
55
|
-
* @return The list of tasks sorted by priority.
|
|
56
|
-
*/
|
|
57
|
-
export declare function sortTasksByPriority(tasks: PartiallyOrderedTasks, dependencies: TaskDependencies): PartiallyOrderedTasks;
|
|
@@ -1,69 +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 { Logger } from '../../../src/ngtsc/logging';
|
|
10
|
-
import { Declaration, Import } from '../../../src/ngtsc/reflection';
|
|
11
|
-
import { BundleProgram } from '../packages/bundle_program';
|
|
12
|
-
import { FactoryMap } from '../utils';
|
|
13
|
-
import { Esm5ReflectionHost } from './esm5_host';
|
|
14
|
-
import { NgccClassSymbol } from './ngcc_host';
|
|
15
|
-
export declare class CommonJsReflectionHost extends Esm5ReflectionHost {
|
|
16
|
-
protected commonJsExports: FactoryMap<ts.SourceFile, Map<string, Declaration<ts.Declaration>> | null>;
|
|
17
|
-
protected topLevelHelperCalls: FactoryMap<string, FactoryMap<ts.SourceFile, ts.CallExpression[]>>;
|
|
18
|
-
protected program: ts.Program;
|
|
19
|
-
protected compilerHost: ts.CompilerHost;
|
|
20
|
-
constructor(logger: Logger, isCore: boolean, src: BundleProgram, dts?: BundleProgram | null);
|
|
21
|
-
getImportOfIdentifier(id: ts.Identifier): Import | null;
|
|
22
|
-
getDeclarationOfIdentifier(id: ts.Identifier): Declaration | null;
|
|
23
|
-
getExportsOfModule(module: ts.Node): Map<string, Declaration> | null;
|
|
24
|
-
/**
|
|
25
|
-
* Search statements related to the given class for calls to the specified helper.
|
|
26
|
-
*
|
|
27
|
-
* In CommonJS these helper calls can be outside the class's IIFE at the top level of the
|
|
28
|
-
* source file. Searching the top level statements for helpers can be expensive, so we
|
|
29
|
-
* try to get helpers from the IIFE first and only fall back on searching the top level if
|
|
30
|
-
* no helpers are found.
|
|
31
|
-
*
|
|
32
|
-
* @param classSymbol the class whose helper calls we are interested in.
|
|
33
|
-
* @param helperNames the names of the helpers (e.g. `__decorate`) whose calls we are interested
|
|
34
|
-
* in.
|
|
35
|
-
* @returns an array of nodes of calls to the helper with the given name.
|
|
36
|
-
*/
|
|
37
|
-
protected getHelperCallsForClass(classSymbol: NgccClassSymbol, helperNames: string[]): ts.CallExpression[];
|
|
38
|
-
/**
|
|
39
|
-
* Find all the helper calls at the top level of a source file.
|
|
40
|
-
*
|
|
41
|
-
* We cache the helper calls per source file so that we don't have to keep parsing the code for
|
|
42
|
-
* each class in a file.
|
|
43
|
-
*
|
|
44
|
-
* @param sourceFile the source who may contain helper calls.
|
|
45
|
-
* @param helperNames the names of the helpers (e.g. `__decorate`) whose calls we are interested
|
|
46
|
-
* in.
|
|
47
|
-
* @returns an array of nodes of calls to the helper with the given name.
|
|
48
|
-
*/
|
|
49
|
-
private getTopLevelHelperCalls;
|
|
50
|
-
private computeExportsOfCommonJsModule;
|
|
51
|
-
private extractBasicCommonJsExportDeclaration;
|
|
52
|
-
private extractCommonJsWildcardReexports;
|
|
53
|
-
private extractCommonJsDefinePropertyExportDeclaration;
|
|
54
|
-
private findCommonJsImport;
|
|
55
|
-
/**
|
|
56
|
-
* Handle the case where the identifier represents a reference to a whole CommonJS
|
|
57
|
-
* module, i.e. the result of a call to `require(...)`.
|
|
58
|
-
*
|
|
59
|
-
* @param id the identifier whose declaration we are looking for.
|
|
60
|
-
* @returns a declaration if `id` refers to a CommonJS module, or `null` otherwise.
|
|
61
|
-
*/
|
|
62
|
-
private getCommonJsModuleDeclaration;
|
|
63
|
-
/**
|
|
64
|
-
* If this is an IFE then try to grab the outer and inner classes otherwise fallback on the super
|
|
65
|
-
* class.
|
|
66
|
-
*/
|
|
67
|
-
protected getDeclarationOfExpression(expression: ts.Expression): Declaration | null;
|
|
68
|
-
private resolveModuleName;
|
|
69
|
-
}
|
|
@@ -1,146 +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 { Declaration } from '../../../src/ngtsc/reflection';
|
|
10
|
-
export interface ExportDeclaration {
|
|
11
|
-
name: string;
|
|
12
|
-
declaration: Declaration;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A CommonJS or UMD wildcard re-export statement.
|
|
16
|
-
*
|
|
17
|
-
* The CommonJS or UMD version of `export * from 'blah';`.
|
|
18
|
-
*
|
|
19
|
-
* These statements can have several forms (depending, for example, on whether
|
|
20
|
-
* the TypeScript helpers are imported or emitted inline). The expression can have one of the
|
|
21
|
-
* following forms:
|
|
22
|
-
* - `__export(firstArg)`
|
|
23
|
-
* - `__exportStar(firstArg)`
|
|
24
|
-
* - `tslib.__export(firstArg, exports)`
|
|
25
|
-
* - `tslib.__exportStar(firstArg, exports)`
|
|
26
|
-
*
|
|
27
|
-
* In all cases, we only care about `firstArg`, which is the first argument of the re-export call
|
|
28
|
-
* expression and can be either a `require('...')` call or an identifier (initialized via a
|
|
29
|
-
* `require('...')` call).
|
|
30
|
-
*/
|
|
31
|
-
export interface WildcardReexportStatement extends ts.ExpressionStatement {
|
|
32
|
-
expression: ts.CallExpression;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* A CommonJS or UMD re-export statement using an `Object.defineProperty()` call.
|
|
36
|
-
* For example:
|
|
37
|
-
*
|
|
38
|
-
* ```
|
|
39
|
-
* Object.defineProperty(exports, "<exported-id>",
|
|
40
|
-
* { enumerable: true, get: function () { return <imported-id>; } });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export interface DefinePropertyReexportStatement extends ts.ExpressionStatement {
|
|
44
|
-
expression: ts.CallExpression & {
|
|
45
|
-
arguments: [ts.Identifier, ts.StringLiteral, ts.ObjectLiteralExpression];
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* A call expression that has a string literal for its first argument.
|
|
50
|
-
*/
|
|
51
|
-
export interface RequireCall extends ts.CallExpression {
|
|
52
|
-
arguments: ts.CallExpression['arguments'] & [ts.StringLiteral];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Return the "namespace" of the specified `ts.Identifier` if the identifier is the RHS of a
|
|
56
|
-
* property access expression, i.e. an expression of the form `<namespace>.<id>` (in which case a
|
|
57
|
-
* `ts.Identifier` corresponding to `<namespace>` will be returned). Otherwise return `null`.
|
|
58
|
-
*/
|
|
59
|
-
export declare function findNamespaceOfIdentifier(id: ts.Identifier): ts.Identifier | null;
|
|
60
|
-
/**
|
|
61
|
-
* Return the `RequireCall` that is used to initialize the specified `ts.Identifier`, if the
|
|
62
|
-
* specified identifier was indeed initialized with a require call in a declaration of the form:
|
|
63
|
-
* `var <id> = require('...')`
|
|
64
|
-
*/
|
|
65
|
-
export declare function findRequireCallReference(id: ts.Identifier, checker: ts.TypeChecker): RequireCall | null;
|
|
66
|
-
/**
|
|
67
|
-
* Check whether the specified `ts.Statement` is a wildcard re-export statement.
|
|
68
|
-
* I.E. an expression statement of one of the following forms:
|
|
69
|
-
* - `__export(<foo>)`
|
|
70
|
-
* - `__exportStar(<foo>)`
|
|
71
|
-
* - `tslib.__export(<foo>, exports)`
|
|
72
|
-
* - `tslib.__exportStar(<foo>, exports)`
|
|
73
|
-
*/
|
|
74
|
-
export declare function isWildcardReexportStatement(stmt: ts.Statement): stmt is WildcardReexportStatement;
|
|
75
|
-
/**
|
|
76
|
-
* Check whether the statement is a re-export of the form:
|
|
77
|
-
*
|
|
78
|
-
* ```
|
|
79
|
-
* Object.defineProperty(exports, "<export-name>",
|
|
80
|
-
* { enumerable: true, get: function () { return <import-name>; } });
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export declare function isDefinePropertyReexportStatement(stmt: ts.Statement): stmt is DefinePropertyReexportStatement;
|
|
84
|
-
/**
|
|
85
|
-
* Extract the "value" of the getter in a `defineProperty` statement.
|
|
86
|
-
*
|
|
87
|
-
* This will return the `ts.Expression` value of a single `return` statement in the `get` method
|
|
88
|
-
* of the property definition object, or `null` if that is not possible.
|
|
89
|
-
*/
|
|
90
|
-
export declare function extractGetterFnExpression(statement: DefinePropertyReexportStatement): ts.Expression | null;
|
|
91
|
-
/**
|
|
92
|
-
* Check whether the specified `ts.Node` represents a `require()` call, i.e. an call expression of
|
|
93
|
-
* the form: `require('<foo>')`
|
|
94
|
-
*/
|
|
95
|
-
export declare function isRequireCall(node: ts.Node): node is RequireCall;
|
|
96
|
-
/**
|
|
97
|
-
* Check whether the specified `path` is an "external" import.
|
|
98
|
-
* In other words, that it comes from a entry-point outside the current one.
|
|
99
|
-
*/
|
|
100
|
-
export declare function isExternalImport(path: string): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* A UMD/CommonJS style export declaration of the form `exports.<name>`.
|
|
103
|
-
*/
|
|
104
|
-
export interface ExportsDeclaration extends ts.PropertyAccessExpression {
|
|
105
|
-
name: ts.Identifier;
|
|
106
|
-
expression: ts.Identifier;
|
|
107
|
-
parent: ExportsAssignment;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Check whether the specified `node` is a property access expression of the form
|
|
111
|
-
* `exports.<foo>`.
|
|
112
|
-
*/
|
|
113
|
-
export declare function isExportsDeclaration(expr: ts.Node): expr is ExportsDeclaration;
|
|
114
|
-
/**
|
|
115
|
-
* A UMD/CommonJS style export assignment of the form `exports.<foo> = <bar>`.
|
|
116
|
-
*/
|
|
117
|
-
export interface ExportsAssignment extends ts.BinaryExpression {
|
|
118
|
-
left: ExportsDeclaration;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Check whether the specified `node` is an assignment expression of the form
|
|
122
|
-
* `exports.<foo> = <bar>`.
|
|
123
|
-
*/
|
|
124
|
-
export declare function isExportsAssignment(expr: ts.Node): expr is ExportsAssignment;
|
|
125
|
-
/**
|
|
126
|
-
* An expression statement of the form `exports.<foo> = <bar>;`.
|
|
127
|
-
*/
|
|
128
|
-
export interface ExportsStatement extends ts.ExpressionStatement {
|
|
129
|
-
expression: ExportsAssignment;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Check whether the specified `stmt` is an expression statement of the form
|
|
133
|
-
* `exports.<foo> = <bar>;`.
|
|
134
|
-
*/
|
|
135
|
-
export declare function isExportsStatement(stmt: ts.Node): stmt is ExportsStatement;
|
|
136
|
-
/**
|
|
137
|
-
* Find the far right hand side of a sequence of aliased assignments of the form
|
|
138
|
-
*
|
|
139
|
-
* ```
|
|
140
|
-
* exports.MyClass = alias1 = alias2 = <<declaration>>
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @param node the expression to parse
|
|
144
|
-
* @returns the original `node` or the far right expression of a series of assignments.
|
|
145
|
-
*/
|
|
146
|
-
export declare function skipAliases(node: ts.Expression): ts.Expression;
|
|
@@ -1,43 +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 { ClassDeclaration, ClassMember, CtorParameter, Declaration, DeclarationNode, Decorator, FunctionDefinition, Import, ReflectionHost } from '../../../src/ngtsc/reflection';
|
|
10
|
-
import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
|
|
11
|
-
/**
|
|
12
|
-
* A reflection host implementation that delegates reflector queries depending on whether they
|
|
13
|
-
* reflect on declaration files (for dependent libraries) or source files within the entry-point
|
|
14
|
-
* that is being compiled. The first type of queries are handled by the regular TypeScript
|
|
15
|
-
* reflection host, whereas the other queries are handled by an `NgccReflectionHost` that is
|
|
16
|
-
* specific to the entry-point's format.
|
|
17
|
-
*/
|
|
18
|
-
export declare class DelegatingReflectionHost implements NgccReflectionHost {
|
|
19
|
-
private tsHost;
|
|
20
|
-
private ngccHost;
|
|
21
|
-
constructor(tsHost: ReflectionHost, ngccHost: NgccReflectionHost);
|
|
22
|
-
getConstructorParameters(clazz: ClassDeclaration): CtorParameter[] | null;
|
|
23
|
-
getDeclarationOfIdentifier(id: ts.Identifier): Declaration | null;
|
|
24
|
-
getDecoratorsOfDeclaration(declaration: DeclarationNode): Decorator[] | null;
|
|
25
|
-
getDefinitionOfFunction(fn: ts.Node): FunctionDefinition | null;
|
|
26
|
-
getDtsDeclaration(declaration: DeclarationNode): ts.Declaration | null;
|
|
27
|
-
getExportsOfModule(module: ts.Node): Map<string, Declaration> | null;
|
|
28
|
-
getGenericArityOfClass(clazz: ClassDeclaration): number | null;
|
|
29
|
-
getImportOfIdentifier(id: ts.Identifier): Import | null;
|
|
30
|
-
getInternalNameOfClass(clazz: ClassDeclaration): ts.Identifier;
|
|
31
|
-
getAdjacentNameOfClass(clazz: ClassDeclaration): ts.Identifier;
|
|
32
|
-
getMembersOfClass(clazz: ClassDeclaration): ClassMember[];
|
|
33
|
-
getVariableValue(declaration: ts.VariableDeclaration): ts.Expression | null;
|
|
34
|
-
hasBaseClass(clazz: ClassDeclaration): boolean;
|
|
35
|
-
getBaseClassExpression(clazz: ClassDeclaration): ts.Expression | null;
|
|
36
|
-
isClass(node: ts.Node): node is ClassDeclaration;
|
|
37
|
-
findClassSymbols(sourceFile: ts.SourceFile): NgccClassSymbol[];
|
|
38
|
-
getClassSymbol(node: ts.Node): NgccClassSymbol | undefined;
|
|
39
|
-
getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
|
|
40
|
-
getEndOfClass(classSymbol: NgccClassSymbol): ts.Node;
|
|
41
|
-
detectKnownDeclaration<T extends Declaration>(decl: T): T;
|
|
42
|
-
isStaticallyExported(decl: ts.Node): boolean;
|
|
43
|
-
}
|