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 | /// <amd-module name="@angular/compiler-cli/src/ngtsc/entry_point/src/private_export_checker" />
|
---|
9 | import * as ts from 'typescript';
|
---|
10 | import { ReferenceGraph } from './reference_graph';
|
---|
11 | /**
|
---|
12 | * Produce `ts.Diagnostic`s for classes that are visible from exported types (e.g. directives
|
---|
13 | * exposed by exported `NgModule`s) that are not themselves exported.
|
---|
14 | *
|
---|
15 | * This function reconciles two concepts:
|
---|
16 | *
|
---|
17 | * A class is Exported if it's exported from the main library `entryPoint` file.
|
---|
18 | * A class is Visible if, via Angular semantics, a downstream consumer can import an Exported class
|
---|
19 | * and be affected by the class in question. For example, an Exported NgModule may expose a
|
---|
20 | * directive class to its consumers. Consumers that import the NgModule may have the directive
|
---|
21 | * applied to elements in their templates. In this case, the directive is considered Visible.
|
---|
22 | *
|
---|
23 | * `checkForPrivateExports` attempts to verify that all Visible classes are Exported, and report
|
---|
24 | * `ts.Diagnostic`s for those that aren't.
|
---|
25 | *
|
---|
26 | * @param entryPoint `ts.SourceFile` of the library's entrypoint, which should export the library's
|
---|
27 | * public API.
|
---|
28 | * @param checker `ts.TypeChecker` for the current program.
|
---|
29 | * @param refGraph `ReferenceGraph` tracking the visibility of Angular types.
|
---|
30 | * @returns an array of `ts.Diagnostic`s representing errors when visible classes are not exported
|
---|
31 | * properly.
|
---|
32 | */
|
---|
33 | export declare function checkForPrivateExports(entryPoint: ts.SourceFile, checker: ts.TypeChecker, refGraph: ReferenceGraph): ts.Diagnostic[];
|
---|