@angular/compiler-cli
- Version 19.1.4
- Published
- 2.65 MB
- 8 dependencies
- MIT license
Install
npm i @angular/compiler-cli
yarn add @angular/compiler-cli
pnpm add @angular/compiler-cli
Overview
Angular - the compiler CLI for Node.js
Index
Variables
Functions
- absoluteFrom()
- absoluteFromSourceFile()
- angularJitApplicationTransform()
- basename()
- calcProjectFileAndBasePath()
- constructorParametersDownlevelTransform()
- createCompilerHost()
- createFileSystemTsReadDirectoryFn()
- createProgram()
- defaultGatherDiagnostics()
- dirname()
- exitCodeFromResult()
- formatDiagnostics()
- getDownlevelDecoratorsTransform()
- getFileSystem()
- getInitializerApiJitTransform()
- getSourceFileOrError()
- isDocEntryWithSourceInfo()
- isLocalCompilationDiagnostics()
- isLocalRelativePath()
- isRoot()
- isRooted()
- isTsDiagnostic()
- join()
- ngErrorCode()
- performCompilation()
- readConfiguration()
- relative()
- relativeFrom()
- resolve()
- setFileSystem()
- toRelativeImport()
Classes
NgtscProgram
- compiler
- emit()
- getApiDocumentation()
- getEmittedSourceFiles()
- getIndexedComponents()
- getNgOptionDiagnostics()
- getNgSemanticDiagnostics()
- getNgStructuralDiagnostics()
- getReuseTsProgram()
- getTsOptionDiagnostics()
- getTsProgram()
- getTsSemanticDiagnostics()
- getTsSyntacticDiagnostics()
- listLazyRoutes()
- loadNgStructureAsync()
Interfaces
Enums
ErrorCode
- COMPONENT_IMPORT_NOT_STANDALONE
- COMPONENT_INVALID_SHADOW_DOM_SELECTOR
- COMPONENT_INVALID_STYLE_URLS
- COMPONENT_MISSING_TEMPLATE
- COMPONENT_NOT_STANDALONE
- COMPONENT_RESOURCE_NOT_FOUND
- COMPONENT_UNKNOWN_DEFERRED_IMPORT
- COMPONENT_UNKNOWN_IMPORT
- CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES
- CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL
- CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK
- CONFIG_FLAT_MODULE_NO_INDEX
- CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK
- CONFLICTING_INPUT_TRANSFORM
- CONFLICTING_LET_DECLARATION
- CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION
- DECORATOR_ARG_NOT_LITERAL
- DECORATOR_ARITY_WRONG
- DECORATOR_COLLISION
- DECORATOR_NOT_CALLED
- DECORATOR_UNEXPECTED
- DEFERRED_DEPENDENCY_IMPORTED_EAGERLY
- DEFERRED_DIRECTIVE_USED_EAGERLY
- DEFERRED_PIPE_USED_EAGERLY
- DIRECTIVE_INHERITS_UNDECORATED_CTOR
- DIRECTIVE_MISSING_SELECTOR
- DUPLICATE_VARIABLE_DECLARATION
- HOST_BINDING_PARSE_ERROR
- HOST_DIRECTIVE_COMPONENT
- HOST_DIRECTIVE_CONFLICTING_ALIAS
- HOST_DIRECTIVE_INVALID
- HOST_DIRECTIVE_MISSING_REQUIRED_BINDING
- HOST_DIRECTIVE_NOT_STANDALONE
- HOST_DIRECTIVE_UNDEFINED_BINDING
- ILLEGAL_FOR_LOOP_TRACK_ACCESS
- ILLEGAL_LET_WRITE
- IMPORT_CYCLE_DETECTED
- IMPORT_GENERATION_FAILURE
- INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT
- INCORRECTLY_DECLARED_ON_STATIC_MEMBER
- INITIALIZER_API_DECORATOR_METADATA_COLLISION
- INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY
- INITIALIZER_API_NO_REQUIRED_FUNCTION
- INITIALIZER_API_WITH_DISALLOWED_DECORATOR
- INJECTABLE_DUPLICATE_PROV
- INJECTABLE_INHERITS_INVALID_CONSTRUCTOR
- INLINE_TCB_REQUIRED
- INLINE_TYPE_CTOR_REQUIRED
- INTERPOLATED_SIGNAL_NOT_INVOKED
- INVALID_BANANA_IN_BOX
- LET_USED_BEFORE_DEFINITION
- LOCAL_COMPILATION_UNRESOLVED_CONST
- LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION
- MISSING_CONTROL_FLOW_DIRECTIVE
- MISSING_NGFOROF_LET
- MISSING_PIPE
- MISSING_REFERENCE_TARGET
- MISSING_REQUIRED_INPUTS
- NGMODULE_BOOTSTRAP_IS_STANDALONE
- NGMODULE_DECLARATION_IS_STANDALONE
- NGMODULE_DECLARATION_NOT_UNIQUE
- NGMODULE_INVALID_DECLARATION
- NGMODULE_INVALID_EXPORT
- NGMODULE_INVALID_IMPORT
- NGMODULE_INVALID_REEXPORT
- NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC
- NGMODULE_REEXPORT_NAME_COLLISION
- NON_STANDALONE_NOT_ALLOWED
- NULLISH_COALESCING_NOT_NULLABLE
- OPTIONAL_CHAIN_NOT_NULLABLE
- PARAM_MISSING_TOKEN
- PIPE_MISSING_NAME
- SCHEMA_INVALID_ATTRIBUTE
- SCHEMA_INVALID_ELEMENT
- SKIP_HYDRATION_NOT_STATIC
- SPLIT_TWO_WAY_BINDING
- SUFFIX_NOT_SUPPORTED
- SUGGEST_STRICT_TEMPLATES
- SUGGEST_SUBOPTIMAL_TYPE_INFERENCE
- SYMBOL_NOT_EXPORTED
- TEMPLATE_PARSE_ERROR
- TEXT_ATTRIBUTE_NOT_BINDING
- UNDECORATED_CLASS_USING_ANGULAR_FEATURES
- UNDECORATED_PROVIDER
- UNINVOKED_FUNCTION_IN_EVENT_BINDING
- UNSUPPORTED_INITIALIZER_API_USAGE
- UNUSED_LET_DECLARATION
- UNUSED_STANDALONE_IMPORTS
- VALUE_HAS_WRONG_TYPE
- VALUE_NOT_LITERAL
- WARN_NGMODULE_ID_UNNECESSARY
- WRITE_TO_READ_ONLY_VARIABLE
Type Aliases
Namespaces
Variables
variable DEFAULT_ERROR_CODE
const DEFAULT_ERROR_CODE: number;
variable GLOBAL_DEFS_FOR_TERSER
const GLOBAL_DEFS_FOR_TERSER: { ngDevMode: boolean; ngI18nClosureMode: boolean };
Known values for global variables in
@angular/core
that Terser should set using https://github.com/terser-js/terser#conditional-compilation
variable GLOBAL_DEFS_FOR_TERSER_WITH_AOT
const GLOBAL_DEFS_FOR_TERSER_WITH_AOT: { ngJitMode: boolean; ngDevMode: boolean; ngI18nClosureMode: boolean;};
variable LogicalProjectPath
const LogicalProjectPath: { relativePathBetween: ( from: LogicalProjectPath, to: LogicalProjectPath ) => PathSegment;};
variable SOURCE
const SOURCE: string;
variable UNKNOWN_ERROR_CODE
const UNKNOWN_ERROR_CODE: number;
variable VERSION
const VERSION: Version;
Functions
function absoluteFrom
absoluteFrom: (path: string) => AbsoluteFsPath;
Convert the path
path
to anAbsoluteFsPath
, throwing an error if it's not an absolute path.
function absoluteFromSourceFile
absoluteFromSourceFile: (sf: { fileName: string }) => AbsoluteFsPath;
Extract an
AbsoluteFsPath
from ats.SourceFile
-like object.
function angularJitApplicationTransform
angularJitApplicationTransform: ( program: ts.Program, isCore?: boolean, shouldTransformClass?: (node: ts.ClassDeclaration) => boolean) => ts.TransformerFactory<ts.SourceFile>;
JIT transform for Angular applications. Used by the Angular CLI for unit tests and explicit JIT applications.
The transforms include:
- A transform for downleveling Angular decorators and Angular-decorated class constructor parameters for dependency injection. This transform can be used by the CLI for JIT-mode compilation where constructor parameters and associated Angular decorators should be downleveled so that apps are not exposed to the ES2015 temporal dead zone limitation in TypeScript. See https://github.com/angular/angular-cli/pull/14473 for more details.
- A transform for adding
@Input
to signal inputs. Signal inputs cannot be recognized at runtime using reflection. That is because the class would need to be instantiated- but is not possible before creation. To fix this for JIT, a decorator is automatically added that will declare the input as a signal input while also capturing the necessary metadata
function basename
basename: (filePath: PathString, extension?: string) => PathSegment;
Static access to
basename
.
function calcProjectFileAndBasePath
calcProjectFileAndBasePath: ( project: string, host?: ConfigurationHost) => { projectFile: AbsoluteFsPath; basePath: AbsoluteFsPath };
function constructorParametersDownlevelTransform
constructorParametersDownlevelTransform: ( program: ts.Program, isCore?: boolean) => ts.TransformerFactory<ts.SourceFile>;
JIT transform used by the Angular CLI.
NOTE: Signature is explicitly captured here to highlight the contract various Angular CLI versions are relying on.
function createCompilerHost
createCompilerHost: ({ options, tsHost,}: { options: CompilerOptions; tsHost?: ts.CompilerHost;}) => CompilerHost;
function createFileSystemTsReadDirectoryFn
createFileSystemTsReadDirectoryFn: ( fs: FileSystem) => NonNullable<ts.CompilerHost['readDirectory']>;
Creates a ts.CompilerHost#readDirectory implementation function, that leverages the specified file system (that may be e.g. virtual).
function createProgram
createProgram: ({ rootNames, options, host, oldProgram,}: { rootNames: ReadonlyArray<string>; options: CompilerOptions; host: CompilerHost; oldProgram?: Program;}) => Program;
function defaultGatherDiagnostics
defaultGatherDiagnostics: (program: api.Program) => ReadonlyArray<ts.Diagnostic>;
function dirname
dirname: <T extends PathString>(file: T) => T;
Static access to
dirname
.
function exitCodeFromResult
exitCodeFromResult: (diags: ReadonlyArray<ts.Diagnostic> | undefined) => number;
function formatDiagnostics
formatDiagnostics: ( diags: ReadonlyArray<ts.Diagnostic>, host?: ts.FormatDiagnosticsHost) => string;
function getDownlevelDecoratorsTransform
getDownlevelDecoratorsTransform: ( typeChecker: ts.TypeChecker, host: ReflectionHost, diagnostics: ts.Diagnostic[], isCore: boolean, isClosureCompilerEnabled: boolean, shouldTransformClass?: (node: ts.ClassDeclaration) => boolean) => ts.TransformerFactory<ts.SourceFile>;
Gets a transformer for downleveling Angular constructor parameter and property decorators.
Note that Angular class decorators are never processed as those rely on side effects that would otherwise no longer be executed. i.e. the creation of a component definition.
Parameter typeChecker
Reference to the program's type checker.
Parameter host
Reflection host that is used for determining decorators.
Parameter diagnostics
List which will be populated with diagnostics if any.
Parameter isCore
Whether the current TypeScript program is for the
@angular/core
package.Parameter isClosureCompilerEnabled
Whether closure annotations need to be added where needed.
Parameter shouldTransformClass
Optional function to check if a given class should be transformed.
function getFileSystem
getFileSystem: () => FileSystem;
function getInitializerApiJitTransform
getInitializerApiJitTransform: ( host: ReflectionHost, importTracker: ImportedSymbolsTracker, isCore: boolean, shouldTransformClass?: (node: ts.ClassDeclaration) => boolean) => ts.TransformerFactory<ts.SourceFile>;
Creates an AST transform that looks for Angular classes and transforms initializer-based declared members to work with JIT compilation.
For example, an
input()
member may be transformed to add an@Input
decorator for JIT.Parameter host
Reflection host
Parameter importTracker
Import tracker for efficient import checking.
Parameter isCore
Whether this transforms runs against
@angular/core
.Parameter shouldTransformClass
Optional function to check if a given class should be transformed.
function getSourceFileOrError
getSourceFileOrError: ( program: ts.Program, fileName: AbsoluteFsPath) => ts.SourceFile;
function isDocEntryWithSourceInfo
isDocEntryWithSourceInfo: (entry: DocEntry) => entry is DocEntryWithSourceInfo;
function isLocalCompilationDiagnostics
isLocalCompilationDiagnostics: (diagnostic: ts.Diagnostic) => boolean;
Whether the compiler diagnostics represents an error related to local compilation mode.
This helper has application in 1P where we check whether a diagnostic is related to local compilation in order to add some g3 specific info to it.
function isLocalRelativePath
isLocalRelativePath: (relativePath: string) => boolean;
Returns true if the given path is locally relative.
This is used to work out if the given path is relative (i.e. not absolute) but also is not escaping the current directory.
function isRoot
isRoot: (path: AbsoluteFsPath) => boolean;
Returns true when the path provided is the root path.
function isRooted
isRooted: (path: string) => boolean;
Static access to
isRooted
.
function isTsDiagnostic
isTsDiagnostic: (diagnostic: any) => diagnostic is ts.Diagnostic;
function join
join: <T extends PathString>(basePath: T, ...paths: string[]) => T;
Static access to
join
.
function ngErrorCode
ngErrorCode: (code: ErrorCode) => number;
function performCompilation
performCompilation: <CbEmitRes extends ts.EmitResult = ts.EmitResult>({ rootNames, options, host, oldProgram, emitCallback, mergeEmitResultsCallback, gatherDiagnostics, customTransformers, emitFlags, forceEmit, modifiedResourceFiles,}: { rootNames: string[]; options: api.CompilerOptions; host?: api.CompilerHost; oldProgram?: api.Program; emitCallback?: api.TsEmitCallback<CbEmitRes>; mergeEmitResultsCallback?: api.TsMergeEmitResultsCallback<CbEmitRes>; gatherDiagnostics?: (program: api.Program) => ReadonlyArray<ts.Diagnostic>; customTransformers?: api.CustomTransformers; emitFlags?: api.EmitFlags; forceEmit?: boolean; modifiedResourceFiles?: Set<string> | null;}) => PerformCompilationResult;
function readConfiguration
readConfiguration: ( project: string, existingOptions?: api.CompilerOptions, host?: ConfigurationHost) => ParsedConfiguration;
function relative
relative: <T extends PathString>(from: T, to: T) => PathSegment | AbsoluteFsPath;
Static access to
relative
.
function relativeFrom
relativeFrom: (path: string) => PathSegment;
Convert the path
path
to aPathSegment
, throwing an error if it's not a relative path.
function resolve
resolve: (basePath: string, ...paths: string[]) => AbsoluteFsPath;
Static access to
resolve
s.
function setFileSystem
setFileSystem: (fileSystem: FileSystem) => void;
function toRelativeImport
toRelativeImport: ( relativePath: PathSegment | AbsoluteFsPath) => PathSegment | AbsoluteFsPath;
Converts a path to a form suitable for use as a relative module import specifier.
In other words it adds the
./
to the path if it is locally relative.
Classes
class ConsoleLogger
class ConsoleLogger implements Logger {}
A simple logger that outputs directly to the Console.
The log messages can be filtered based on severity via the
logLevel
constructor parameter.
class DocsExtractor
class DocsExtractor {}
Extracts all information from a source file that may be relevant for generating public API documentation.
constructor
constructor(typeChecker: ts.TypeChecker, metadataReader: MetadataReader);
method extractAll
extractAll: ( sourceFile: ts.SourceFile, rootDir: string, privateModules: Set<string>) => { entries: DocEntry[]; symbols: Map<string, string> };
Gets the set of all documentable entries from a source file, including declarations that are re-exported from this file as an entry-point.
Parameter sourceFile
The file from which to extract documentable entries.
class LogicalFileSystem
class LogicalFileSystem {}
A utility class which can translate absolute paths to source files into logical paths in TypeScript's logical file system, based on the root directories of the project.
constructor
constructor( rootDirs: AbsoluteFsPath[], compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>);
method logicalPathOfFile
logicalPathOfFile: (physicalFile: AbsoluteFsPath) => LogicalProjectPath | null;
Get the logical path in the project of a source file.
Returns
A
LogicalProjectPath
to the source file, ornull
if the source file is not in any of the TS project's root directories.
method logicalPathOfSf
logicalPathOfSf: (sf: ts.SourceFile) => LogicalProjectPath | null;
Get the logical path in the project of a
ts.SourceFile
.This method is provided as a convenient alternative to calling
logicalPathOfFile(absoluteFromSourceFile(sf))
.
class NgtscCompilerHost
class NgtscCompilerHost implements ts.CompilerHost {}
constructor
constructor(fs: FileSystem, options?: ts.CompilerOptions);
property fs
protected fs: FileSystem;
property options
protected options: ts.CompilerOptions;
method fileExists
fileExists: (fileName: string) => boolean;
method getCanonicalFileName
getCanonicalFileName: (fileName: string) => string;
method getCurrentDirectory
getCurrentDirectory: () => string;
method getDefaultLibFileName
getDefaultLibFileName: (options: ts.CompilerOptions) => string;
method getDefaultLibLocation
getDefaultLibLocation: () => string;
method getNewLine
getNewLine: () => string;
method getSourceFile
getSourceFile: ( fileName: string, languageVersion: ts.ScriptTarget) => ts.SourceFile | undefined;
method readFile
readFile: (fileName: string) => string | undefined;
method realpath
realpath: (path: string) => string;
method useCaseSensitiveFileNames
useCaseSensitiveFileNames: () => boolean;
method writeFile
writeFile: ( fileName: string, data: string, writeByteOrderMark: boolean, onError: (message: string) => void, sourceFiles?: ReadonlyArray<ts.SourceFile>) => void;
class NgTscPlugin
class NgTscPlugin implements TscPlugin {}
A plugin for
tsc_wrapped
which allows Angular compilation from a plaints_library
.
constructor
constructor(ngOptions: {});
property compiler
readonly compiler: NgCompiler;
property name
name: string;
method createTransformers
createTransformers: () => ts.CustomTransformers;
method getDiagnostics
getDiagnostics: (file?: ts.SourceFile) => ts.Diagnostic[];
method getNextProgram
getNextProgram: () => ts.Program;
method getOptionDiagnostics
getOptionDiagnostics: () => ts.Diagnostic[];
method setupCompilation
setupCompilation: ( program: ts.Program, oldProgram?: ts.Program) => { ignoreForDiagnostics: Set<ts.SourceFile>; ignoreForEmit: Set<ts.SourceFile>;};
method wrapHost
wrapHost: ( host: ts.CompilerHost & Partial<UnifiedModulesHost>, inputFiles: readonly string[], options: ts.CompilerOptions) => PluginCompilerHost;
class NgtscProgram
class NgtscProgram implements api.Program {}
Entrypoint to the Angular Compiler (Ivy+) which sits behind the
api.Program
interface, allowing it to be a drop-in replacement for the legacy View Engine compiler to tooling such as the command-line main() function or the Angular CLI.
constructor
constructor( rootNames: readonly string[], options: NgCompilerOptions, delegateHost: api.CompilerHost, oldProgram?: NgtscProgram);
property compiler
readonly compiler: NgCompiler;
method emit
emit: <CbEmitRes extends ts.EmitResult>( opts?: api.EmitOptions<CbEmitRes> | undefined) => ts.EmitResult;
method getApiDocumentation
getApiDocumentation: ( entryPoint: string, privateModules: Set<string>) => { entries: DocEntry[]; symbols: Map<string, string> };
Gets information for the current program that may be used to generate API reference documentation. This includes Angular-specific information, such as component inputs and outputs.
Parameter entryPoint
Path to the entry point for the package for which API docs should be extracted.
method getEmittedSourceFiles
getEmittedSourceFiles: () => Map<string, ts.SourceFile>;
method getIndexedComponents
getIndexedComponents: () => Map<DeclarationNode, IndexedComponent>;
method getNgOptionDiagnostics
getNgOptionDiagnostics: ( cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method getNgSemanticDiagnostics
getNgSemanticDiagnostics: ( fileName?: string | undefined, cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method getNgStructuralDiagnostics
getNgStructuralDiagnostics: ( cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method getReuseTsProgram
getReuseTsProgram: () => ts.Program;
method getTsOptionDiagnostics
getTsOptionDiagnostics: ( cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method getTsProgram
getTsProgram: () => ts.Program;
method getTsSemanticDiagnostics
getTsSemanticDiagnostics: ( sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method getTsSyntacticDiagnostics
getTsSyntacticDiagnostics: ( sourceFile?: ts.SourceFile | undefined, cancellationToken?: ts.CancellationToken | undefined) => readonly ts.Diagnostic[];
method listLazyRoutes
listLazyRoutes: (entryRoute?: string | undefined) => api.LazyRoute[];
method loadNgStructureAsync
loadNgStructureAsync: () => Promise<void>;
Ensure that the
NgCompiler
has properly analyzed the program, and allow for the asynchronous loading of any resources during the process.This is used by the Angular CLI to allow for spawning (async) child compilations for things like SASS files used in
styleUrls
.
class NodeJSFileSystem
class NodeJSFileSystem extends NodeJSReadonlyFileSystem implements FileSystem {}
A wrapper around the Node.js file-system (i.e. the
fs
package).
method copyFile
copyFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;
method ensureDir
ensureDir: (path: AbsoluteFsPath) => void;
method moveFile
moveFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;
method removeDeep
removeDeep: (path: AbsoluteFsPath) => void;
method removeFile
removeFile: (path: AbsoluteFsPath) => void;
method symlink
symlink: (target: AbsoluteFsPath, path: AbsoluteFsPath) => void;
method writeFile
writeFile: ( path: AbsoluteFsPath, data: string | Uint8Array, exclusive?: boolean) => void;
Interfaces
interface AngularCompilerOptions
interface CompilerOptions extends NgCompilerOptions, ts.CompilerOptions {}
property annotationsAs
annotationsAs?: 'decorators' | 'static fields';
property basePath
basePath?: string;
property createExternalSymbolFactoryReexports
createExternalSymbolFactoryReexports?: boolean;
Whether NGC should generate re-exports for external symbols which are referenced in Angular metadata (e.g. @Component, @Inject, @ViewChild). This can be enabled in order to avoid dynamically generated module dependencies which can break strict dependency enforcements. This is not enabled by default. Read more about this here: https://github.com/angular/angular/issues/25644.
property disableExpressionLowering
disableExpressionLowering?: boolean;
property enableResourceInlining
enableResourceInlining?: boolean;
Whether to replace the
templateUrl
andstyleUrls
property in all decorators with inlined contents intemplate
andstyles
properties. When enabled, the .js output of ngc will have no lazy-loadedtemplateUrl
orstyleUrl
s. Note that this requires that resources be available to load statically at compile-time.
property flatModulePrivateSymbolPrefix
flatModulePrivateSymbolPrefix?: string;
property genDir
genDir?: string;
property generateCodeForLibraries
generateCodeForLibraries?: boolean;
property i18nInFile
i18nInFile?: string;
property i18nInFormat
i18nInFormat?: string;
property i18nInMissingTranslations
i18nInMissingTranslations?: 'error' | 'warning' | 'ignore';
property skipMetadataEmit
skipMetadataEmit?: boolean;
property skipTemplateCodegen
skipTemplateCodegen?: boolean;
property strictMetadataEmit
strictMetadataEmit?: boolean;
property trace
trace?: boolean;
interface ClassEntry
interface ClassEntry extends DocEntry {}
Documentation entity for a TypeScript class.
property extends
extends?: string;
property generics
generics: GenericEntry[];
property implements
implements: string[];
property isAbstract
isAbstract: boolean;
property members
members: MemberEntry[];
interface CompilerHost
interface CompilerHost extends ts.CompilerHost, ExtendedTsCompilerHost {}
method amdModuleName
amdModuleName: (sf: ts.SourceFile) => string | undefined;
Produce an AMD module name for the source file. Used in Bazel.
An AMD module can have an arbitrary name, so that it is require'd by name rather than by path. See https://requirejs.org/docs/whyamd.html#namedmodules
method fromSummaryFileName
fromSummaryFileName: (fileName: string, referringLibFileName: string) => string;
Converts a fileName that was processed by
toSummaryFileName
back into a real fileName given the fileName of the library that is referring to it.
method moduleNameToFileName
moduleNameToFileName: ( moduleName: string, containingFile: string) => string | null;
Converts a module name that is used in an
import
to a file path. I.e.path/to/containingFile.ts
containingimport {...} from 'module-name'
.
method toSummaryFileName
toSummaryFileName: (fileName: string, referringSrcFileName: string) => string;
Converts a file name into a representation that should be stored in a summary file. This has to include changing the suffix as well. E.g.
some_file.ts
->some_file.d.ts
Parameter referringSrcFileName
the source file that refers to fileName
interface CompilerOptions
interface CompilerOptions extends NgCompilerOptions, ts.CompilerOptions {}
property annotationsAs
annotationsAs?: 'decorators' | 'static fields';
property basePath
basePath?: string;
property createExternalSymbolFactoryReexports
createExternalSymbolFactoryReexports?: boolean;
Whether NGC should generate re-exports for external symbols which are referenced in Angular metadata (e.g. @Component, @Inject, @ViewChild). This can be enabled in order to avoid dynamically generated module dependencies which can break strict dependency enforcements. This is not enabled by default. Read more about this here: https://github.com/angular/angular/issues/25644.
property disableExpressionLowering
disableExpressionLowering?: boolean;
property enableResourceInlining
enableResourceInlining?: boolean;
Whether to replace the
templateUrl
andstyleUrls
property in all decorators with inlined contents intemplate
andstyles
properties. When enabled, the .js output of ngc will have no lazy-loadedtemplateUrl
orstyleUrl
s. Note that this requires that resources be available to load statically at compile-time.
property flatModulePrivateSymbolPrefix
flatModulePrivateSymbolPrefix?: string;
property genDir
genDir?: string;
property generateCodeForLibraries
generateCodeForLibraries?: boolean;
property i18nInFile
i18nInFile?: string;
property i18nInFormat
i18nInFormat?: string;
property i18nInMissingTranslations
i18nInMissingTranslations?: 'error' | 'warning' | 'ignore';
property skipMetadataEmit
skipMetadataEmit?: boolean;
property skipTemplateCodegen
skipTemplateCodegen?: boolean;
property strictMetadataEmit
strictMetadataEmit?: boolean;
property trace
trace?: boolean;
interface ConstantEntry
interface ConstantEntry extends DocEntry {}
Documentation entity for a constant.
property type
type: string;
interface CustomTransformers
interface CustomTransformers {}
interface DecoratorEntry
interface DecoratorEntry extends DocEntry {}
Documentation entity for an Angular decorator.
property decoratorType
decoratorType: DecoratorType;
property members
members: PropertyEntry[];
interface DirectiveEntry
interface DirectiveEntry extends ClassEntry {}
Documentation entity for an Angular directives and components.
property exportAs
exportAs: string[];
property isStandalone
isStandalone: boolean;
property selector
selector: string;
interface DocEntry
interface DocEntry {}
Base type for all documentation entities.
property description
description: string;
property entryType
entryType: EntryType;
property jsdocTags
jsdocTags: JsDocTagEntry[];
property name
name: string;
property rawComment
rawComment: string;
interface DocEntryWithSourceInfo
interface DocEntryWithSourceInfo extends DocEntry {}
property source
source: SourceEntry;
interface EmitOptions
interface EmitOptions<CbEmitRes extends ts.EmitResult> {}
property cancellationToken
cancellationToken?: ts.CancellationToken;
property customTransformers
customTransformers?: CustomTransformers;
property emitCallback
emitCallback?: TsEmitCallback<CbEmitRes>;
property emitFlags
emitFlags?: EmitFlags;
property forceEmit
forceEmit?: boolean;
property mergeEmitResultsCallback
mergeEmitResultsCallback?: TsMergeEmitResultsCallback<CbEmitRes>;
interface EntryCollection
interface EntryCollection {}
The JSON data file format for extracted API reference info.
property entries
entries: DocEntry[];
property moduleLabel
moduleLabel: string;
property moduleName
moduleName: string;
property normalizedModuleName
normalizedModuleName: string;
interface EnumEntry
interface EnumEntry extends DocEntry {}
Documentation entity for a TypeScript enum.
property members
members: EnumMemberEntry[];
interface EnumMemberEntry
interface EnumMemberEntry extends MemberEntry {}
Sub-entry for an enum member.
interface FileStats
interface FileStats {}
Information about an object in the FileSystem. This is analogous to the
fs.Stats
class in Node.js.
method isDirectory
isDirectory: () => boolean;
method isFile
isFile: () => boolean;
method isSymbolicLink
isSymbolicLink: () => boolean;
interface FileSystem
interface FileSystem extends ReadonlyFileSystem {}
A basic interface to abstract the underlying file-system.
This makes it easier to provide mock file-systems in unit tests, but also to create clever file-systems that have features such as caching.
method copyFile
copyFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;
method ensureDir
ensureDir: (path: AbsoluteFsPath) => void;
method moveFile
moveFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;
method removeDeep
removeDeep: (path: AbsoluteFsPath) => void;
method removeFile
removeFile: (path: AbsoluteFsPath) => void;
method symlink
symlink: (target: AbsoluteFsPath, path: AbsoluteFsPath) => void;
method writeFile
writeFile: ( path: AbsoluteFsPath, data: string | Uint8Array, exclusive?: boolean) => void;
interface FunctionDefinitionEntry
interface FunctionDefinitionEntry {}
Interface describing a function with overload signatures.
property implementation
implementation: FunctionSignatureMetadata | null;
property name
name: string;
property signatures
signatures: FunctionSignatureMetadata[];
interface FunctionSignatureMetadata
interface FunctionSignatureMetadata extends DocEntry {}
property generics
generics: GenericEntry[];
property isNewType
isNewType: boolean;
property params
params: ParameterEntry[];
property returnDescription
returnDescription?: string;
property returnType
returnType: string;
interface GenericEntry
interface GenericEntry {}
Documentation entity for single generic parameter.
property constraint
constraint: string | undefined;
property default
default: string | undefined;
property name
name: string;
interface InitializerApiFunctionEntry
interface InitializerApiFunctionEntry extends DocEntry {}
Docs entry describing an initializer API function.
An initializer API function is a function that is invoked as initializer of class members. The function may hold additional sub functions, like
.required
.Known popular initializer APIs are
input()
,output()
,model()
.Initializer APIs are often constructed typed in complex ways so this entry type allows for readable "parsing" and interpretation of such constructs. Initializer APIs are explicitly denoted via a JSDoc tag.
property callFunction
callFunction: FunctionDefinitionEntry;
property subFunctions
subFunctions: FunctionDefinitionEntry[];
interface JsDocTagEntry
interface JsDocTagEntry {}
Documentation entity for single JsDoc tag.
interface LazyRoute
interface LazyRoute {}
property module
module: { name: string; filePath: string;};
property referencedModule
referencedModule: { name: string; filePath: string;};
property route
route: string;
interface Logger
interface Logger {}
Implement this interface if you want to provide different logging output from the standard ConsoleLogger.
interface MemberEntry
interface MemberEntry {}
Sub-entry for a single class or enum member.
property description
description: string;
property jsdocTags
jsdocTags: JsDocTagEntry[];
property memberTags
memberTags: MemberTags[];
property memberType
memberType: MemberType;
property name
name: string;
interface ParameterEntry
interface ParameterEntry {}
Sub-entry for a single function parameter.
property description
description: string;
property isOptional
isOptional: boolean;
property isRestParam
isRestParam: boolean;
property name
name: string;
property type
type: string;
interface ParsedConfiguration
interface ParsedConfiguration {}
interface PathManipulation
interface PathManipulation {}
An abstraction over the path manipulation aspects of a file-system.
method basename
basename: (filePath: string, extension?: string) => PathSegment;
method chdir
chdir: (path: AbsoluteFsPath) => void;
method dirname
dirname: <T extends PathString>(file: T) => T;
method extname
extname: { (path: AbsoluteFsPath | PathSegment): string; (path: AbsoluteFsPath | PathSegment): string;};
method isRoot
isRoot: (path: AbsoluteFsPath) => boolean;
method isRooted
isRooted: (path: string) => boolean;
method join
join: <T extends PathString>(basePath: T, ...paths: string[]) => T;
method normalize
normalize: <T extends PathString>(path: T) => T;
method pwd
pwd: () => AbsoluteFsPath;
method relative
relative: <T extends PathString>(from: T, to: T) => PathSegment | AbsoluteFsPath;
Compute the relative path between
from
andto
.In file-systems that can have multiple file trees the returned path may not actually be "relative" (i.e.
PathSegment
). For example, Windows can have multiple drives :relative('c:/a/b', 'd:/a/c')
would be `d:/a/c'.
method resolve
resolve: (...paths: string[]) => AbsoluteFsPath;
interface PerformCompilationResult
interface PerformCompilationResult {}
property diagnostics
diagnostics: ReadonlyArray<ts.Diagnostic>;
property emitResult
emitResult?: ts.EmitResult;
property program
program?: api.Program;
interface PipeEntry
interface PipeEntry extends ClassEntry {}
property isStandalone
isStandalone: boolean;
property pipeName
pipeName: string;
interface PluginCompilerHost
interface PluginCompilerHost extends ts.CompilerHost, Partial<UnifiedModulesHost> {}
A
ts.CompilerHost
which also returns a list of input files, out of which thets.Program
should be created.Currently mirrored from @bazel/concatjs/internal/tsc_wrapped/plugin_api (with the naming of
fileNameToModuleName
corrected).
property inputFiles
readonly inputFiles: ReadonlyArray<string>;
interface Program
interface Program {}
method emit
emit: <CbEmitRes extends ts.EmitResult>( opts?: EmitOptions<CbEmitRes> | undefined) => ts.EmitResult;
Emit the files requested by emitFlags implied by the program.
Angular structural information is required to emit files.
method getNgOptionDiagnostics
getNgOptionDiagnostics: ( cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve options diagnostics for the Angular options used to create the program.
method getNgSemanticDiagnostics
getNgSemanticDiagnostics: ( fileName?: string, cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve the Angular semantic diagnostics.
Angular structural information is required to produce these diagnostics.
method getNgStructuralDiagnostics
getNgStructuralDiagnostics: ( cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve the diagnostics for the structure of an Angular application is correctly formed. This includes validating Angular annotations and the syntax of referenced and imbedded HTML and CSS.
Note it is important to displaying TypeScript semantic diagnostics along with Angular structural diagnostics as an error in the program structure might cause errors detected in semantic analysis and a semantic error might cause errors in specifying the program structure.
Angular structural information is required to produce these diagnostics.
method getTsOptionDiagnostics
getTsOptionDiagnostics: ( cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve options diagnostics for the TypeScript options used to create the program. This is faster than calling
getTsProgram().getOptionsDiagnostics()
since it does not need to collect Angular structural information to produce the errors.
method getTsProgram
getTsProgram: () => ts.Program;
Retrieve the TypeScript program used to produce semantic diagnostics and emit the sources.
Angular structural information is required to produce the program.
method getTsSemanticDiagnostics
getTsSemanticDiagnostics: ( sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve the semantic diagnostics from TypeScript. This is equivalent to calling
getTsProgram().getSemanticDiagnostics()
directly and is included for completeness.
method getTsSyntacticDiagnostics
getTsSyntacticDiagnostics: ( sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => ReadonlyArray<ts.Diagnostic>;
Retrieve the syntax diagnostics from TypeScript. This is faster than calling
getTsProgram().getSyntacticDiagnostics()
since it does not need to collect Angular structural information to produce the errors.
method listLazyRoutes
listLazyRoutes: (entryRoute?: string) => LazyRoute[];
This method is obsolete and always returns an empty array.
method loadNgStructureAsync
loadNgStructureAsync: () => Promise<void>;
Load Angular structural information asynchronously. If this method is not called then the Angular structural information, including referenced HTML and CSS files, are loaded synchronously. If the supplied Angular compiler host returns a promise from
loadResource()
will produce a diagnostic error message or,getTsProgram()
oremit
to throw.
interface PropertyEntry
interface PropertyEntry extends MemberEntry {}
Sub-entry for a class property.
property inputAlias
inputAlias?: string;
property isRequiredInput
isRequiredInput?: boolean;
property outputAlias
outputAlias?: string;
property type
type: string;
interface ReadonlyFileSystem
interface ReadonlyFileSystem extends PathManipulation {}
An abstraction over the read-only aspects of a file-system.
method exists
exists: (path: AbsoluteFsPath) => boolean;
method getDefaultLibLocation
getDefaultLibLocation: () => AbsoluteFsPath;
method isCaseSensitive
isCaseSensitive: () => boolean;
method lstat
lstat: (path: AbsoluteFsPath) => FileStats;
method readdir
readdir: (path: AbsoluteFsPath) => PathSegment[];
method readFile
readFile: (path: AbsoluteFsPath) => string;
method readFileBuffer
readFileBuffer: (path: AbsoluteFsPath) => Uint8Array;
method realpath
realpath: (filePath: AbsoluteFsPath) => AbsoluteFsPath;
method stat
stat: (path: AbsoluteFsPath) => FileStats;
interface SourceEntry
interface SourceEntry {}
interface TsEmitArguments
interface TsEmitArguments {}
property cancellationToken
cancellationToken?: ts.CancellationToken;
property customTransformers
customTransformers?: ts.CustomTransformers;
property emitOnlyDtsFiles
emitOnlyDtsFiles?: boolean;
property host
host: CompilerHost;
property options
options: CompilerOptions;
property program
program: ts.Program;
property targetSourceFile
targetSourceFile?: ts.SourceFile;
property writeFile
writeFile?: ts.WriteFileCallback;
interface TsEmitCallback
interface TsEmitCallback<T extends ts.EmitResult> {}
call signature
(args: TsEmitArguments): T;
interface TsMergeEmitResultsCallback
interface TsMergeEmitResultsCallback<T extends ts.EmitResult> {}
call signature
(results: T[]): T;
interface TypeAliasEntry
interface TypeAliasEntry extends ConstantEntry {}
Documentation entity for a type alias.
property generics
generics: GenericEntry[];
Enums
enum DecoratorType
enum DecoratorType { Class = 'class', Member = 'member', Parameter = 'parameter',}
enum EmitFlags
enum EmitFlags { DTS = 1, JS = 2, Metadata = 4, I18nBundle = 8, Codegen = 16, Default = 19, All = 31,}
enum EntryType
enum EntryType { Block = 'block', Component = 'component', Constant = 'constant', Decorator = 'decorator', Directive = 'directive', Element = 'element', Enum = 'enum', Function = 'function', Interface = 'interface', NgModule = 'ng_module', Pipe = 'pipe', TypeAlias = 'type_alias', UndecoratedClass = 'undecorated_class', InitializerApiFunction = 'initializer_api_function',}
Type of top-level documentation entry.
member Block
Block = 'block'
member Component
Component = 'component'
member Constant
Constant = 'constant'
member Decorator
Decorator = 'decorator'
member Directive
Directive = 'directive'
member Element
Element = 'element'
member Enum
Enum = 'enum'
member Function
Function = 'function'
member InitializerApiFunction
InitializerApiFunction = 'initializer_api_function'
member Interface
Interface = 'interface'
member NgModule
NgModule = 'ng_module'
member Pipe
Pipe = 'pipe'
member TypeAlias
TypeAlias = 'type_alias'
member UndecoratedClass
UndecoratedClass = 'undecorated_class'
enum ErrorCode
enum ErrorCode { DECORATOR_ARG_NOT_LITERAL = 1001, DECORATOR_ARITY_WRONG = 1002, DECORATOR_NOT_CALLED = 1003, DECORATOR_UNEXPECTED = 1005, DECORATOR_COLLISION = 1006, VALUE_HAS_WRONG_TYPE = 1010, VALUE_NOT_LITERAL = 1011, INITIALIZER_API_WITH_DISALLOWED_DECORATOR = 1050, INITIALIZER_API_DECORATOR_METADATA_COLLISION = 1051, INITIALIZER_API_NO_REQUIRED_FUNCTION = 1052, INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY = 1053, INCORRECTLY_DECLARED_ON_STATIC_MEMBER = 1100, COMPONENT_MISSING_TEMPLATE = 2001, PIPE_MISSING_NAME = 2002, PARAM_MISSING_TOKEN = 2003, DIRECTIVE_MISSING_SELECTOR = 2004, UNDECORATED_PROVIDER = 2005, DIRECTIVE_INHERITS_UNDECORATED_CTOR = 2006, UNDECORATED_CLASS_USING_ANGULAR_FEATURES = 2007, COMPONENT_RESOURCE_NOT_FOUND = 2008, COMPONENT_INVALID_SHADOW_DOM_SELECTOR = 2009, COMPONENT_NOT_STANDALONE = 2010, COMPONENT_IMPORT_NOT_STANDALONE = 2011, COMPONENT_UNKNOWN_IMPORT = 2012, HOST_DIRECTIVE_INVALID = 2013, HOST_DIRECTIVE_NOT_STANDALONE = 2014, HOST_DIRECTIVE_COMPONENT = 2015, INJECTABLE_INHERITS_INVALID_CONSTRUCTOR = 2016, HOST_DIRECTIVE_UNDEFINED_BINDING = 2017, HOST_DIRECTIVE_CONFLICTING_ALIAS = 2018, HOST_DIRECTIVE_MISSING_REQUIRED_BINDING = 2019, CONFLICTING_INPUT_TRANSFORM = 2020, COMPONENT_INVALID_STYLE_URLS = 2021, COMPONENT_UNKNOWN_DEFERRED_IMPORT = 2022, NON_STANDALONE_NOT_ALLOWED = 2023, SYMBOL_NOT_EXPORTED = 3001, IMPORT_CYCLE_DETECTED = 3003, IMPORT_GENERATION_FAILURE = 3004, CONFIG_FLAT_MODULE_NO_INDEX = 4001, CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK = 4002, CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES = 4003, CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL = 4004, CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK = 4005, HOST_BINDING_PARSE_ERROR = 5001, TEMPLATE_PARSE_ERROR = 5002, NGMODULE_INVALID_DECLARATION = 6001, NGMODULE_INVALID_IMPORT = 6002, NGMODULE_INVALID_EXPORT = 6003, NGMODULE_INVALID_REEXPORT = 6004, NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC = 6005, NGMODULE_REEXPORT_NAME_COLLISION = 6006, NGMODULE_DECLARATION_NOT_UNIQUE = 6007, NGMODULE_DECLARATION_IS_STANDALONE = 6008, NGMODULE_BOOTSTRAP_IS_STANDALONE = 6009, WARN_NGMODULE_ID_UNNECESSARY = 6100, SCHEMA_INVALID_ELEMENT = 8001, SCHEMA_INVALID_ATTRIBUTE = 8002, MISSING_REFERENCE_TARGET = 8003, MISSING_PIPE = 8004, WRITE_TO_READ_ONLY_VARIABLE = 8005, DUPLICATE_VARIABLE_DECLARATION = 8006, SPLIT_TWO_WAY_BINDING = 8007, MISSING_REQUIRED_INPUTS = 8008, ILLEGAL_FOR_LOOP_TRACK_ACCESS = 8009, INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT = 8010, CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = 8011, DEFERRED_PIPE_USED_EAGERLY = 8012, DEFERRED_DIRECTIVE_USED_EAGERLY = 8013, DEFERRED_DEPENDENCY_IMPORTED_EAGERLY = 8014, ILLEGAL_LET_WRITE = 8015, LET_USED_BEFORE_DEFINITION = 8016, CONFLICTING_LET_DECLARATION = 8017, INVALID_BANANA_IN_BOX = 8101, NULLISH_COALESCING_NOT_NULLABLE = 8102, MISSING_CONTROL_FLOW_DIRECTIVE = 8103, TEXT_ATTRIBUTE_NOT_BINDING = 8104, MISSING_NGFOROF_LET = 8105, SUFFIX_NOT_SUPPORTED = 8106, OPTIONAL_CHAIN_NOT_NULLABLE = 8107, SKIP_HYDRATION_NOT_STATIC = 8108, INTERPOLATED_SIGNAL_NOT_INVOKED = 8109, UNSUPPORTED_INITIALIZER_API_USAGE = 8110, UNINVOKED_FUNCTION_IN_EVENT_BINDING = 8111, UNUSED_LET_DECLARATION = 8112, UNUSED_STANDALONE_IMPORTS = 8113, INLINE_TCB_REQUIRED = 8900, INLINE_TYPE_CTOR_REQUIRED = 8901, INJECTABLE_DUPLICATE_PROV = 9001, SUGGEST_STRICT_TEMPLATES = 10001, SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002, LOCAL_COMPILATION_UNRESOLVED_CONST = 11001, LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION = 11003,}
member COMPONENT_IMPORT_NOT_STANDALONE
COMPONENT_IMPORT_NOT_STANDALONE = 2011
Raised when a type in the
imports
of a component is a directive or pipe, but is not standalone.
member COMPONENT_INVALID_SHADOW_DOM_SELECTOR
COMPONENT_INVALID_SHADOW_DOM_SELECTOR = 2009
Raised when a component uses
ShadowDom
view encapsulation, but its selector does not match the shadow DOM tag name requirements.
member COMPONENT_INVALID_STYLE_URLS
COMPONENT_INVALID_STYLE_URLS = 2021
Raised when a component has both
styleUrls
andstyleUrl
.
member COMPONENT_MISSING_TEMPLATE
COMPONENT_MISSING_TEMPLATE = 2001
member COMPONENT_NOT_STANDALONE
COMPONENT_NOT_STANDALONE = 2010
Raised when a component has
imports
but is not marked asstandalone: true
.
member COMPONENT_RESOURCE_NOT_FOUND
COMPONENT_RESOURCE_NOT_FOUND = 2008
Raised when an component cannot resolve an external resource, such as a template or a style sheet.
member COMPONENT_UNKNOWN_DEFERRED_IMPORT
COMPONENT_UNKNOWN_DEFERRED_IMPORT = 2022
Raised when a type in the
deferredImports
of a component is not a component, directive or pipe.
member COMPONENT_UNKNOWN_IMPORT
COMPONENT_UNKNOWN_IMPORT = 2012
Raised when a type in the
imports
of a component is not a directive, pipe, or NgModule.
member CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES
CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES = 4003
member CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL
CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL = 4004
member CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK
CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK = 4005
member CONFIG_FLAT_MODULE_NO_INDEX
CONFIG_FLAT_MODULE_NO_INDEX = 4001
member CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK
CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK = 4002
member CONFLICTING_INPUT_TRANSFORM
CONFLICTING_INPUT_TRANSFORM = 2020
Raised when a component specifies both a
transform
function on an input and has a correspondingngAcceptInputType_
member for the same input.
member CONFLICTING_LET_DECLARATION
CONFLICTING_LET_DECLARATION = 8017
A
@let
declaration conflicts with another symbol in the same scope.
member CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION
CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = 8011
A control flow node is projected at the root of a component and is preventing its direct descendants from being projected, because it has more than one root node.
<comp>@if (expr) {<div projectsIntoSlot></div>Text preventing the div from being projected}</comp>
member DECORATOR_ARG_NOT_LITERAL
DECORATOR_ARG_NOT_LITERAL = 1001
member DECORATOR_ARITY_WRONG
DECORATOR_ARITY_WRONG = 1002
member DECORATOR_COLLISION
DECORATOR_COLLISION = 1006
This error code indicates that there are incompatible decorators on a type or a class field.
member DECORATOR_NOT_CALLED
DECORATOR_NOT_CALLED = 1003
member DECORATOR_UNEXPECTED
DECORATOR_UNEXPECTED = 1005
member DEFERRED_DEPENDENCY_IMPORTED_EAGERLY
DEFERRED_DEPENDENCY_IMPORTED_EAGERLY = 8014
A directive/component/pipe imported via
@Component.deferredImports
is also included into the@Component.imports
list.
member DEFERRED_DIRECTIVE_USED_EAGERLY
DEFERRED_DIRECTIVE_USED_EAGERLY = 8013
A directive/component imported via
@Component.deferredImports
is used outside of a@defer
block in a template.
member DEFERRED_PIPE_USED_EAGERLY
DEFERRED_PIPE_USED_EAGERLY = 8012
A pipe imported via
@Component.deferredImports
is used outside of a@defer
block in a template.
member DIRECTIVE_INHERITS_UNDECORATED_CTOR
DIRECTIVE_INHERITS_UNDECORATED_CTOR = 2006
Raised when a Directive inherits its constructor from a base class without an Angular decorator.
member DIRECTIVE_MISSING_SELECTOR
DIRECTIVE_MISSING_SELECTOR = 2004
member DUPLICATE_VARIABLE_DECLARATION
DUPLICATE_VARIABLE_DECLARATION = 8006
A template variable was declared twice. For example:
<div *ngFor="let i of items; let i = index"></div>
member HOST_BINDING_PARSE_ERROR
HOST_BINDING_PARSE_ERROR = 5001
Raised when a host expression has a parse error, such as a host listener or host binding expression containing a pipe.
member HOST_DIRECTIVE_COMPONENT
HOST_DIRECTIVE_COMPONENT = 2015
Raised when a host directive is a component.
member HOST_DIRECTIVE_CONFLICTING_ALIAS
HOST_DIRECTIVE_CONFLICTING_ALIAS = 2018
Raised when a host tries to alias a host directive binding to a pre-existing binding's public name.
member HOST_DIRECTIVE_INVALID
HOST_DIRECTIVE_INVALID = 2013
Raised when the compiler wasn't able to resolve the metadata of a host directive.
member HOST_DIRECTIVE_MISSING_REQUIRED_BINDING
HOST_DIRECTIVE_MISSING_REQUIRED_BINDING = 2019
Raised when a host directive definition doesn't expose a required binding from the host directive.
member HOST_DIRECTIVE_NOT_STANDALONE
HOST_DIRECTIVE_NOT_STANDALONE = 2014
Raised when a host directive isn't standalone.
member HOST_DIRECTIVE_UNDEFINED_BINDING
HOST_DIRECTIVE_UNDEFINED_BINDING = 2017
Raised when a host tries to alias a host directive binding that does not exist.
member ILLEGAL_FOR_LOOP_TRACK_ACCESS
ILLEGAL_FOR_LOOP_TRACK_ACCESS = 8009
The tracking expression of a
for
loop block is accessing a variable that is unavailable, for example:<ng-template let-ref>@for (item of items; track ref) {}</ng-template>
member ILLEGAL_LET_WRITE
ILLEGAL_LET_WRITE = 8015
An expression is trying to write to an
@let
declaration.
member IMPORT_CYCLE_DETECTED
IMPORT_CYCLE_DETECTED = 3003
Raised when a relationship between directives and/or pipes would cause a cyclic import to be created that cannot be handled, such as in partial compilation mode.
member IMPORT_GENERATION_FAILURE
IMPORT_GENERATION_FAILURE = 3004
Raised when the compiler is unable to generate an import statement for a reference.
member INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT
INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT = 8010
The trigger of a
defer
block cannot access its trigger element, either because it doesn't exist or it's in a different view.@defer (on interaction(trigger)) {...}<ng-template><button #trigger></button></ng-template>
member INCORRECTLY_DECLARED_ON_STATIC_MEMBER
INCORRECTLY_DECLARED_ON_STATIC_MEMBER = 1100
An Angular feature, like inputs, outputs or queries is incorrectly declared on a static member.
member INITIALIZER_API_DECORATOR_METADATA_COLLISION
INITIALIZER_API_DECORATOR_METADATA_COLLISION = 1051
Raised when an initializer API feature (like signal inputs) are also declared in the class decorator metadata.
e.g. a signal input is also declared in the
@Directive
inputs
array.
member INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY
INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY = 1053
Raised whenever an initializer API is used on a class member and the given access modifiers (e.g.
private
) are not allowed.
member INITIALIZER_API_NO_REQUIRED_FUNCTION
INITIALIZER_API_NO_REQUIRED_FUNCTION = 1052
Raised whenever an initializer API does not support the
.required
function, but is still detected unexpectedly.
member INITIALIZER_API_WITH_DISALLOWED_DECORATOR
INITIALIZER_API_WITH_DISALLOWED_DECORATOR = 1050
Raised when an initializer API is annotated with an unexpected decorator.
e.g.
@Input
is also applied on the class member usinginput
.
member INJECTABLE_DUPLICATE_PROV
INJECTABLE_DUPLICATE_PROV = 9001
An injectable already has a
ɵprov
property.
member INJECTABLE_INHERITS_INVALID_CONSTRUCTOR
INJECTABLE_INHERITS_INVALID_CONSTRUCTOR = 2016
Raised when a type with Angular decorator inherits its constructor from a base class which has a constructor that is incompatible with Angular DI.
member INLINE_TCB_REQUIRED
INLINE_TCB_REQUIRED = 8900
The template type-checking engine would need to generate an inline type check block for a component, but the current type-checking environment doesn't support it.
member INLINE_TYPE_CTOR_REQUIRED
INLINE_TYPE_CTOR_REQUIRED = 8901
The template type-checking engine would need to generate an inline type constructor for a directive or component, but the current type-checking environment doesn't support it.
member INTERPOLATED_SIGNAL_NOT_INVOKED
INTERPOLATED_SIGNAL_NOT_INVOKED = 8109
Signal functions should be invoked when interpolated in templates.
For example:
{{ mySignal() }}
member INVALID_BANANA_IN_BOX
INVALID_BANANA_IN_BOX = 8101
A two way binding in a template has an incorrect syntax, parentheses outside brackets. For example:
<div ([foo])="bar" />
member LET_USED_BEFORE_DEFINITION
LET_USED_BEFORE_DEFINITION = 8016
An expression is trying to read an
@let
before it has been defined.
member LOCAL_COMPILATION_UNRESOLVED_CONST
LOCAL_COMPILATION_UNRESOLVED_CONST = 11001
In local compilation mode a const is required to be resolved statically but cannot be so since it is imported from a file outside of the compilation unit. This usually happens with const being used as Angular decorators parameters such as
@Component.template
,@HostListener.eventName
, etc.
member LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION
LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION = 11003
In local compilation mode a certain expression or syntax is not supported. This is usually because the expression/syntax is not very common and so we did not add support for it yet. This can be changed in the future and support for more expressions could be added if need be. Meanwhile, this error is thrown to indicate a current unavailability.
member MISSING_CONTROL_FLOW_DIRECTIVE
MISSING_CONTROL_FLOW_DIRECTIVE = 8103
A known control flow directive (e.g.
*ngIf
) is used in a template, but theCommonModule
is not imported.
member MISSING_NGFOROF_LET
MISSING_NGFOROF_LET = 8105
NgForOf is used in a template, but the user forgot to include let in their statement.
For example:
<ul><li *ngFor="item of items">{{item["name"]}};</li></ul>
member MISSING_PIPE
MISSING_PIPE = 8004
No matching pipe was found for a
member MISSING_REFERENCE_TARGET
MISSING_REFERENCE_TARGET = 8003
No matching directive was found for a
#ref="target"
expression.
member MISSING_REQUIRED_INPUTS
MISSING_REQUIRED_INPUTS = 8008
A directive usage isn't binding to one or more required inputs.
member NGMODULE_BOOTSTRAP_IS_STANDALONE
NGMODULE_BOOTSTRAP_IS_STANDALONE = 6009
Raised when a standalone component is part of the bootstrap list of an NgModule.
member NGMODULE_DECLARATION_IS_STANDALONE
NGMODULE_DECLARATION_IS_STANDALONE = 6008
Raised when a standalone directive/pipe is part of the declarations of an NgModule.
member NGMODULE_DECLARATION_NOT_UNIQUE
NGMODULE_DECLARATION_NOT_UNIQUE = 6007
Raised when a directive/pipe is part of the declarations of two or more NgModules.
member NGMODULE_INVALID_DECLARATION
NGMODULE_INVALID_DECLARATION = 6001
Raised when an NgModule contains an invalid reference in
declarations
.
member NGMODULE_INVALID_EXPORT
NGMODULE_INVALID_EXPORT = 6003
Raised when an NgModule contains an invalid type in
exports
.
member NGMODULE_INVALID_IMPORT
NGMODULE_INVALID_IMPORT = 6002
Raised when an NgModule contains an invalid type in
imports
.
member NGMODULE_INVALID_REEXPORT
NGMODULE_INVALID_REEXPORT = 6004
Raised when an NgModule contains a type in
exports
which is neither indeclarations
nor otherwise imported.
member NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC
NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC = 6005
Raised when a
ModuleWithProviders
with a missing generic type argument is passed into anNgModule
.
member NGMODULE_REEXPORT_NAME_COLLISION
NGMODULE_REEXPORT_NAME_COLLISION = 6006
Raised when an NgModule exports multiple directives/pipes of the same name and the compiler attempts to generate private re-exports within the NgModule file.
member NON_STANDALONE_NOT_ALLOWED
NON_STANDALONE_NOT_ALLOWED = 2023
Raised when a
standalone: false
component is declared butstrictStandalone
is set.
member NULLISH_COALESCING_NOT_NULLABLE
NULLISH_COALESCING_NOT_NULLABLE = 8102
The left side of a nullish coalescing operation is not nullable.
{{ foo ?? bar }}When the type of foo doesn't include
null
orundefined
.
member OPTIONAL_CHAIN_NOT_NULLABLE
OPTIONAL_CHAIN_NOT_NULLABLE = 8107
The left side of an optional chain operation is not nullable.
{{ foo?.bar }}{{ foo?.['bar'] }}{{ foo?.() }}When the type of foo doesn't include
null
orundefined
.
member PARAM_MISSING_TOKEN
PARAM_MISSING_TOKEN = 2003
member PIPE_MISSING_NAME
PIPE_MISSING_NAME = 2002
member SCHEMA_INVALID_ATTRIBUTE
SCHEMA_INVALID_ATTRIBUTE = 8002
An element's attribute name failed validation against the DOM schema.
member SCHEMA_INVALID_ELEMENT
SCHEMA_INVALID_ELEMENT = 8001
An element name failed validation against the DOM schema.
member SKIP_HYDRATION_NOT_STATIC
SKIP_HYDRATION_NOT_STATIC = 8108
ngSkipHydration
should not be a binding (it should be a static attribute).For example:
<my-cmp [ngSkipHydration]="someTruthyVar" />ngSkipHydration
cannot be a binding and can not have values other than "true" or an empty value
member SPLIT_TWO_WAY_BINDING
SPLIT_TWO_WAY_BINDING = 8007
A template has a two way binding (two bindings created by a single syntactical element) in which the input and output are going to different places.
member SUFFIX_NOT_SUPPORTED
SUFFIX_NOT_SUPPORTED = 8106
Indicates that the binding suffix is not supported
Style bindings support suffixes like
style.width.px
,.em
, and.%
. These suffixes are _not_ supported for attribute bindings.For example
[attr.width.px]="5"
becomeswidth.px="5"
when bound. This is almost certainly unintentional and this error is meant to surface this mistake to the developer.
member SUGGEST_STRICT_TEMPLATES
SUGGEST_STRICT_TEMPLATES = 10001
Suggest users to enable
strictTemplates
to make use of full capabilities provided by Angular language service.
member SUGGEST_SUBOPTIMAL_TYPE_INFERENCE
SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002
Indicates that a particular structural directive provides advanced type narrowing functionality, but the current template type-checking configuration does not allow its usage in type inference.
member SYMBOL_NOT_EXPORTED
SYMBOL_NOT_EXPORTED = 3001
member TEMPLATE_PARSE_ERROR
TEMPLATE_PARSE_ERROR = 5002
Raised when the compiler cannot parse a component's template.
member TEXT_ATTRIBUTE_NOT_BINDING
TEXT_ATTRIBUTE_NOT_BINDING = 8104
A text attribute is not interpreted as a binding but likely intended to be.
For example:
<divattr.x="value"class.blue="true"style.margin-right.px="5"></div>All of the above attributes will just be static text attributes and will not be interpreted as bindings by the compiler.
member UNDECORATED_CLASS_USING_ANGULAR_FEATURES
UNDECORATED_CLASS_USING_ANGULAR_FEATURES = 2007
Raised when an undecorated class that is using Angular features has been discovered.
member UNDECORATED_PROVIDER
UNDECORATED_PROVIDER = 2005
Raised when an undecorated class is passed in as a provider to a module or a directive.
member UNINVOKED_FUNCTION_IN_EVENT_BINDING
UNINVOKED_FUNCTION_IN_EVENT_BINDING = 8111
A function in an event binding is not called.
For example:
<button (click)="myFunc"></button>This will not call
myFunc
when the button is clicked. Instead, it should be<button (click)="myFunc()"></button>
.
member UNSUPPORTED_INITIALIZER_API_USAGE
UNSUPPORTED_INITIALIZER_API_USAGE = 8110
Initializer-based APIs can only be invoked from inside of an initializer.
// AllowedmyInput = input();// Not allowedfunction myInput() {return input();}
member UNUSED_LET_DECLARATION
UNUSED_LET_DECLARATION = 8112
A
@let
declaration in a template isn't used.For example:
@let used = 1; <!-- Not an error -->@let notUsed = 2; <!-- Error -->{{used}}
member UNUSED_STANDALONE_IMPORTS
UNUSED_STANDALONE_IMPORTS = 8113
A symbol referenced in
@Component.imports
isn't being used within the template.
member VALUE_HAS_WRONG_TYPE
VALUE_HAS_WRONG_TYPE = 1010
member VALUE_NOT_LITERAL
VALUE_NOT_LITERAL = 1011
member WARN_NGMODULE_ID_UNNECESSARY
WARN_NGMODULE_ID_UNNECESSARY = 6100
Indicates that an NgModule is declared with
id: module.id
. This is an anti-pattern that is disabled explicitly in the compiler, that was originally based on a misunderstanding ofNgModule.id
.
member WRITE_TO_READ_ONLY_VARIABLE
WRITE_TO_READ_ONLY_VARIABLE = 8005
The left-hand side of an assignment expression was a template variable. Effectively, the template looked like:
<ng-template let-something><button (click)="something = ...">...</button></ng-template>Template variables are read-only.
enum LogLevel
enum LogLevel { debug = 0, info = 1, warn = 2, error = 3,}
enum MemberTags
enum MemberTags { Abstract = 'abstract', Static = 'static', Readonly = 'readonly', Protected = 'protected', Optional = 'optional', Input = 'input', Output = 'output', Inherited = 'override',}
Informational tags applicable to class members.
enum MemberType
enum MemberType { Property = 'property', Method = 'method', Getter = 'getter', Setter = 'setter', EnumItem = 'enum_item',}
Types of class members
enum OptimizeFor
enum OptimizeFor { SingleFile = 0, WholeProgram = 1,}
Describes the scope of the caller's interest in template type-checking results.
member SingleFile
SingleFile = 0
Indicates that a consumer of a
TemplateTypeChecker
is only interested in results for a given file, and wants them as fast as possible.Calling
TemplateTypeChecker
methods successively for multiple files while specifyingOptimizeFor.SingleFile
can result in significant unnecessary overhead overall.
member WholeProgram
WholeProgram = 1
Indicates that a consumer of a
TemplateTypeChecker
intends to query for results pertaining to the entire user program, and so the type-checker should internally optimize for this case.Initial calls to retrieve type-checking information may take longer, but repeated calls to gather information for the whole user program will be significantly faster with this mode of optimization.
Type Aliases
type AbsoluteFsPath
type AbsoluteFsPath = BrandedPath<'AbsoluteFsPath'>;
A fully qualified path in the file system, in POSIX form.
type ConfigurationHost
type ConfigurationHost = Pick< ReadonlyFileSystem, | 'readFile' | 'exists' | 'lstat' | 'resolve' | 'join' | 'dirname' | 'extname' | 'pwd' | 'readdir'>;
Used to read configuration files.
type FunctionEntry
type FunctionEntry = FunctionDefinitionEntry & DocEntry & { implementation: FunctionSignatureMetadata; };
type InterfaceEntry
type InterfaceEntry = ClassEntry;
Documentation entity for a TypeScript interface.
type LogicalProjectPath
type LogicalProjectPath = BrandedPath<'LogicalProjectPath'>;
A path that's relative to the logical root of a TypeScript project (one of the project's rootDirs).
Paths in the type system use POSIX format.
type MethodEntry
type MethodEntry = MemberEntry & FunctionEntry;
Sub-entry for a class method.
type PathSegment
type PathSegment = BrandedPath<'PathSegment'>;
A path that's relative to another (unspecified) root.
This does not necessarily have to refer to a physical file.
type PathString
type PathString = string | AbsoluteFsPath | PathSegment;
Namespaces
namespace @babel/core
module '@babel/core' {}
Copyright Google LLC All Rights Reserved.
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://angular.dev/license
namespace @babel/generator
module '@babel/generator' {}
Package Files (28)
- index.d.ts
- private/babel.d.ts
- private/tooling.d.ts
- src/ngtsc/diagnostics/src/error.d.ts
- src/ngtsc/diagnostics/src/error_code.d.ts
- src/ngtsc/diagnostics/src/util.d.ts
- src/ngtsc/docs/src/entities.d.ts
- src/ngtsc/docs/src/extractor.d.ts
- src/ngtsc/file_system/src/compiler_host.d.ts
- src/ngtsc/file_system/src/helpers.d.ts
- src/ngtsc/file_system/src/logical.d.ts
- src/ngtsc/file_system/src/node_js_file_system.d.ts
- src/ngtsc/file_system/src/ts_read_directory.d.ts
- src/ngtsc/file_system/src/types.d.ts
- src/ngtsc/file_system/src/util.d.ts
- src/ngtsc/logging/src/console_logger.d.ts
- src/ngtsc/logging/src/logger.d.ts
- src/ngtsc/program.d.ts
- src/ngtsc/transform/jit/src/downlevel_decorators_transform.d.ts
- src/ngtsc/transform/jit/src/index.d.ts
- src/ngtsc/transform/jit/src/initializer_api_transforms/transform.d.ts
- src/ngtsc/tsc_plugin.d.ts
- src/ngtsc/typecheck/api/checker.d.ts
- src/perform_compile.d.ts
- src/transformers/api.d.ts
- src/transformers/compiler_host.d.ts
- src/transformers/program.d.ts
- src/version.d.ts
Dependencies (8)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@angular/compiler-cli
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@angular/compiler-cli)
- HTML<a href="https://www.jsdocs.io/package/@angular/compiler-cli"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8824 ms. - Missing or incorrect documentation? Open an issue for this package.