@angular/compiler-cli
- Version 22.0.2
- Published
- 2.66 MB
- 8 dependencies
- MIT license
Install
npm i @angular/compiler-cliyarn add @angular/compiler-clipnpm add @angular/compiler-cliOverview
Angular - the compiler CLI for Node.js
Index
Variables
Functions
- absoluteFrom()
- absoluteFromSourceFile()
- angularJitApplicationTransform()
- basename()
- calcProjectFileAndBasePath()
- constructorParametersDownlevelTransform()
- createCompilerHost()
- createFileSystemTsReadDirectoryFn()
- createProgram()
- defaultGatherDiagnostics()
- dirname()
- exitCodeFromResult()
- findFirstMatchingNode()
- formatDiagnostics()
- freshCompilationTicket()
- getAngularDecorators()
- getDownlevelDecoratorsTransform()
- getFileSystem()
- getInitializerApiJitTransform()
- getRootDirs()
- getSourceFileOrError()
- hasExpressionIdentifier()
- incrementalFromCompilerTicket()
- isDocEntryWithSourceInfo()
- isExternalResource()
- isFatalDiagnosticError()
- isLocalCompilationDiagnostics()
- isLocalRelativePath()
- isNamedClassDeclaration()
- isRoot()
- isRooted()
- isShim()
- isTsDiagnostic()
- join()
- ngErrorCode()
- performCompilation()
- readConfiguration()
- relative()
- relativeFrom()
- resolve()
- resourceChangeTicket()
- setFileSystem()
- toRelativeImport()
Classes
NgCompiler
- analyzeAsync()
- emitHmrUpdateModule()
- enableTemplateTypeChecker
- fromTicket()
- getApiDocumentation()
- getComponentsWithStyleFile()
- getComponentsWithTemplateFile()
- getCurrentProgram()
- getDiagnostics()
- getDiagnosticsForComponent()
- getDiagnosticsForFile()
- getDirectiveResources()
- getIndexedComponents()
- getMeta()
- getOptionDiagnostics()
- getResourceDependencies()
- getTemplateTypeChecker()
- ignoreForDiagnostics
- ignoreForEmit
- incrementalCompilation
- incrementalStrategy
- options
- perfRecorder
- prepareEmit()
- programDriver
- usePoisonedData
- xi18n()
NgtscProgram
- compiler
- emit()
- getApiDocumentation()
- getEmittedSourceFiles()
- getIndexedComponents()
- getNgOptionDiagnostics()
- getNgSemanticDiagnostics()
- getNgStructuralDiagnostics()
- getReuseTsProgram()
- getTsOptionDiagnostics()
- getTsProgram()
- getTsSemanticDiagnostics()
- getTsSyntacticDiagnostics()
- listLazyRoutes()
- loadNgStructureAsync()
Interfaces
TemplateTypeChecker
- generateAllTypeCheckBlocks()
- getDiagnosticsForComponent()
- getDiagnosticsForFile()
- getDirectiveMetadata()
- getDirectiveScopeData()
- getDirectivesOfNode()
- getElementsInFileScope()
- getExpressionCompletionLocation()
- getExpressionTarget()
- getGlobalCompletions()
- getGlobalTsContext()
- getHostElement()
- getLiteralCompletionLocation()
- getNgModuleMetadata()
- getOwningNgModule()
- getPipeMetadata()
- getPotentialDomBindings()
- getPotentialDomEvents()
- getPotentialElementTags()
- getPotentialImportsFor()
- getPotentialPipes()
- getPotentialTemplateDirectives()
- getPrimaryAngularDecorator()
- getSourceMappingAtTcbLocation()
- getSuggestionDiagnosticsForComponent()
- getSuggestionDiagnosticsForFile()
- getSymbolOfNode()
- getTemplate()
- getTsSymbolOfSymbol()
- getTypeCheckBlock()
- getTypeOfSymbol()
- getUsedDirectives()
- getUsedPipes()
- invalidateClass()
- isTrackedTypeCheckFile()
- makeTemplateDiagnostic()
Enums
ErrorCode
- COMPONENT_ANIMATIONS_CONFLICT
- 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_EMIT_DECLARATION_ONLY_UNSUPPORTED
- 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_HOST_DIRECTIVE_BINDING
- 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
- DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER
- DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER
- DEFER_TRIGGER_MISCONFIGURATION
- DEFERRED_DEPENDENCY_IMPORTED_EAGERLY
- DEFERRED_DIRECTIVE_USED_EAGERLY
- DEFERRED_PIPE_USED_EAGERLY
- DIRECTIVE_INHERITS_UNDECORATED_CTOR
- DIRECTIVE_MISSING_SELECTOR
- DUPLICATE_BINDING_NAME
- DUPLICATE_DECORATED_PROPERTIES
- DUPLICATE_VARIABLE_DECLARATION
- FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION
- FORM_FIELD_UNSUPPORTED_BINDING
- 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
- INCORRECT_NAMED_TEMPLATE_DEPENDENCY_TYPE
- 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_NAMED_TEMPLATE_DEPENDENCY
- MISSING_NGFOROF_LET
- MISSING_PIPE
- MISSING_REFERENCE_TARGET
- MISSING_REQUIRED_INPUTS
- MISSING_STRUCTURAL_DIRECTIVE
- MULTIPLE_MATCHING_COMPONENTS
- 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
- SERVICE_CONSTRUCTOR_DI
- 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
- UNCLAIMED_DIRECTIVE_BINDING
- UNDECORATED_CLASS_USING_ANGULAR_FEATURES
- UNDECORATED_PROVIDER
- UNINVOKED_FUNCTION_IN_EVENT_BINDING
- UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION
- UNINVOKED_TRACK_FUNCTION
- UNPARENTHESIZED_NULLISH_COALESCING
- UNSUPPORTED_INITIALIZER_API_USAGE
- UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD
- UNUSED_LET_DECLARATION
- UNUSED_STANDALONE_IMPORTS
- VALUE_HAS_WRONG_TYPE
- VALUE_NOT_LITERAL
- WARN_NGMODULE_ID_UNNECESSARY
- WRITE_TO_READ_ONLY_VARIABLE
PerfPhase
- Analysis
- Compile
- CycleDetection
- LAST
- LSApplyRefactoring
- LsCodeFixes
- LsCodeFixesAll
- LsCompletions
- LsComponentLocations
- LSComputeApplicableRefactorings
- LsDefinition
- LsDiagnostics
- LsQuickInfo
- LsReferencesAndRenames
- LSSemanticClassification
- LsSignatureHelp
- LsSuggestionDiagnostics
- LsTcb
- OutliningSpans
- Reconciliation
- Resolve
- ResourceUpdate
- Setup
- TcbGeneration
- TcbUpdateProgram
- TtcAutocompletion
- TtcDiagnostics
- TtcSuggestionDiagnostics
- TtcSymbol
- TypeScriptDiagnostics
- TypeScriptEmit
- TypeScriptProgramCreate
- Unaccounted
Type Aliases
- AbsoluteFsPath
- ClassDeclaration
- CompilationTicket
- Completion
- ConfigurationHost
- DeclarationNode
- DirectiveHostIdentifier
- DirectiveSymbol
- FunctionEntry
- InputMapping
- InterfaceMemberEntry
- LogicalProjectPath
- MethodEntry
- NgTemplateDiagnostic
- PathSegment
- PathString
- SourceMapping
- Symbol
- TemplateDeclarationSymbol
- TopLevelIdentifier
- TypeAliasMemberEntry
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/corethat 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
pathto anAbsoluteFsPath, throwing an error if it's not an absolute path.
function absoluteFromSourceFile
absoluteFromSourceFile: (sf: { fileName: string }) => AbsoluteFsPath;Extract an
AbsoluteFsPathfrom 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
@Inputto 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 findFirstMatchingNode
findFirstMatchingNode: <T extends ts.Node>( tcb: ts.Node, opts: FindOptions<T>) => T | null;Given a
ts.Nodewith finds the first node whose matching the criteria specified by theFindOptions.Returns
nullwhen nots.Nodematches the given conditions.
function formatDiagnostics
formatDiagnostics: ( diags: ReadonlyArray<ts.Diagnostic>, host?: ts.FormatDiagnosticsHost) => string;function freshCompilationTicket
freshCompilationTicket: ( tsProgram: ts.Program, options: NgCompilerOptions, incrementalBuildStrategy: IncrementalBuildStrategy, programDriver: ProgramDriver, perfRecorder: ActivePerfRecorder | null, enableTemplateTypeChecker: boolean, usePoisonedData: boolean) => CompilationTicket;Create a
CompilationTicketfor a brand new compilation, using no prior state.
function getAngularDecorators
getAngularDecorators: ( decorators: Decorator[], names: readonly string[], isCore: boolean) => Decorator[];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/corepackage.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@Inputdecorator 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 getRootDirs
getRootDirs: ( host: Pick<ts.CompilerHost, 'getCurrentDirectory' | 'getCanonicalFileName'>, options: ts.CompilerOptions) => AbsoluteFsPath[];function getSourceFileOrError
getSourceFileOrError: ( program: ts.Program, fileName: AbsoluteFsPath) => ts.SourceFile;function hasExpressionIdentifier
hasExpressionIdentifier: ( sourceFile: ts.SourceFile, node: ts.Node, identifier: ExpressionIdentifier) => boolean;function incrementalFromCompilerTicket
incrementalFromCompilerTicket: ( oldCompiler: NgCompiler, newProgram: ts.Program, incrementalBuildStrategy: IncrementalBuildStrategy, programDriver: ProgramDriver, modifiedResourceFiles: Set<AbsoluteFsPath>, perfRecorder: ActivePerfRecorder | null) => CompilationTicket;Create a
CompilationTicketas efficiently as possible, based on a previousNgCompilerinstance and a newts.Program.
function isDocEntryWithSourceInfo
isDocEntryWithSourceInfo: (entry: DocEntry) => entry is DocEntryWithSourceInfo;function isExternalResource
isExternalResource: (resource: Resource) => resource is ExternalResource;function isFatalDiagnosticError
isFatalDiagnosticError: (err: any) => err is FatalDiagnosticError;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 isNamedClassDeclaration
isNamedClassDeclaration: (node: ts.Node) => node is any;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 isShim
isShim: (sf: ts.SourceFile) => boolean;Check whether
sfis a shimts.SourceFile(either a per-file shim or a top-level shim).
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
pathto aPathSegment, throwing an error if it's not a relative path.
function resolve
resolve: (basePath: string, ...paths: string[]) => AbsoluteFsPath;Static access to
resolves.
function resourceChangeTicket
resourceChangeTicket: ( compiler: NgCompiler, modifiedResourceFiles: Set<string>) => IncrementalResourceCompilationTicket;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 AbsoluteSourceSpan
class AbsoluteSourceSpan {}Describes the absolute byte offsets of a text anchor in a source code.
constructor
constructor(start: number, end: number);property end
readonly end: number;property start
readonly start: number;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
logLevelconstructor 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 Environment
class Environment extends ReferenceEmitEnvironment {}A context which hosts one or more Type Check Blocks (TCBs).
An
Environmentsupports the generation of TCBs by tracking necessary imports, declarations of type constructors, and other statements beyond the type-checking code within the TCB itself. Through method calls onEnvironment, the TCB generator can requestts.Expressions which reference declarations in theEnvironmentfor these artifacts`.Environmentcan be used in a standalone fashion, or can be extended to support more specialized usage.
constructor
constructor( config: TypeCheckingConfig, importManager: ImportManager, refEmitter: ReferenceEmitter, contextFile: ts.SourceFile, copiedSourceOriginPath?: String & { _brand: 'AbsoluteFsPath' });property config
readonly config: TypeCheckingConfig;property copiedSourceOriginPath
copiedSourceOriginPath?: String & { _brand: 'AbsoluteFsPath' };property pipeInstStatements
protected pipeInstStatements: TcbExpr[];property typeCtorStatements
protected typeCtorStatements: TcbExpr[];method getPreludeStatements
getPreludeStatements: () => TcbExpr[];method pipeInst
pipeInst: (pipe: TcbPipeMetadata) => TcbExpr;method typeCtorFor
typeCtorFor: (dir: TcbDirectiveMetadata) => TcbExpr;Get an expression referring to a type constructor for the given directive.
Depending on the shape of the directive itself, this could be either a reference to a declared type constructor, or to an inline type constructor.
class ImportManager
class ImportManager implements ImportGenerator< ts.SourceFile, ts.Identifier | ts.PropertyAccessExpression > {}Import manager that can be used to conveniently and efficiently generate imports It efficiently re-uses existing source file imports, or previous generated imports.
These capabilities are important for efficient TypeScript transforms that minimize structural changes to the dependency graph of source files, enabling as much incremental re-use as possible.
Those imports may be inserted via a TypeScript transform, or via manual string manipulation using e.g.
magic-string.
constructor
constructor(config?: Partial<ImportManagerConfig>);method addImport
addImport: { (request: ImportRequest<ts.SourceFile> & { asTypeReference: true }): | ts.Identifier | ts.QualifiedName; ( request: ImportRequest<ts.SourceFile> & { asTypeReference?: undefined } ): any;};Adds an import to the given source-file and returns a TypeScript expression that can be used to access the newly imported symbol.
method addSideEffectImport
addSideEffectImport: ( requestedFile: ts.SourceFile, moduleSpecifier: string) => void;Adds a side-effect import for the given module.
method finalize
finalize: () => { affectedFiles: Set<string>; updatedImports: Map<ts.NamedImports, ts.NamedImports>; newImports: Map<string, ts.ImportDeclaration[]>; reusedOriginalAliasDeclarations: Set<AliasImportDeclaration>; deletedImports: Set<ts.ImportDeclaration>;};Finalizes the import manager by computing all necessary import changes and returning them.
Changes are collected once at the end, after all imports are requested, because this simplifies building up changes to existing imports that need to be updated, and allows more trivial re-use of previous generated imports.
method removeImport
removeImport: ( requestedFile: ts.SourceFile, exportSymbolName: string, moduleSpecifier: string) => void;Marks all imported symbols with a specific name for removal. Call
addImportto undo this operation.Parameter requestedFile
File from which to remove the imports.
Parameter exportSymbolName
Declared name of the symbol being removed.
Parameter moduleSpecifier
Module from which the symbol is being imported.
method toTsTransform
toTsTransform: ( extraStatementsMap?: Map<string, ts.Statement[]>) => ts.TransformerFactory<ts.SourceFile>;Gets a TypeScript transform for the import manager.
Parameter extraStatementsMap
Additional set of statements to be inserted for given source files after their imports. E.g. top-level constants.
method transformTsFile
transformTsFile: ( ctx: ts.TransformationContext, file: ts.SourceFile, extraStatementsAfterImports?: ts.Statement[]) => ts.SourceFile;Transforms a single file as a shorthand, using toTsTransform.
Parameter extraStatementsMap
Additional set of statements to be inserted for given source files after their imports. E.g. top-level constants.
class InvalidFileSystem
class InvalidFileSystem implements FileSystem {}The default
FileSystemthat will always fail.This is a way of ensuring that the developer consciously chooses and configures the
FileSystembefore using it; particularly important when considering static functions likeabsoluteFrom()which rely on theFileSystemunder the hood.
method basename
basename: (filePath: string, extension?: string) => PathSegment;method chdir
chdir: (path: AbsoluteFsPath) => void;method copyFile
copyFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;method dirname
dirname: <T extends PathString>(file: T) => T;method ensureDir
ensureDir: (path: AbsoluteFsPath) => void;method exists
exists: (path: AbsoluteFsPath) => boolean;method extname
extname: (path: AbsoluteFsPath | PathSegment) => string;method getDefaultLibLocation
getDefaultLibLocation: () => AbsoluteFsPath;method isCaseSensitive
isCaseSensitive: () => boolean;method isRoot
isRoot: (path: AbsoluteFsPath) => boolean;method isRooted
isRooted: (path: string) => boolean;method join
join: <T extends PathString>(basePath: T, ...paths: string[]) => T;method lstat
lstat: (path: AbsoluteFsPath) => FileStats;method moveFile
moveFile: (from: AbsoluteFsPath, to: AbsoluteFsPath) => void;method normalize
normalize: <T extends PathString>(path: T) => T;method pwd
pwd: () => AbsoluteFsPath;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 relative
relative: <T extends PathString>(from: T, to: T) => PathSegment | AbsoluteFsPath;method removeDeep
removeDeep: (path: AbsoluteFsPath) => void;method removeFile
removeFile: (path: AbsoluteFsPath) => void;method resolve
resolve: (...paths: string[]) => AbsoluteFsPath;method stat
stat: (path: AbsoluteFsPath) => FileStats;method symlink
symlink: (target: AbsoluteFsPath, path: AbsoluteFsPath) => void;method writeFile
writeFile: ( path: AbsoluteFsPath, data: string | Uint8Array, exclusive?: boolean) => void;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
LogicalProjectPathto the source file, ornullif 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 NgCompiler
class NgCompiler {}The heart of the Angular Ivy compiler.
The
NgCompilerprovides an API for performing Angular compilation within a custom TypeScript compiler. Each instance ofNgCompilersupports a single compilation, which might be incremental.NgCompileris lazy, and does not perform any of the work of the compilation until one of its output methods (e.g.getDiagnostics) is called.See the README.md for more information.
property enableTemplateTypeChecker
readonly enableTemplateTypeChecker: boolean;property ignoreForDiagnostics
readonly ignoreForDiagnostics: Set<ts.SourceFile>;property ignoreForEmit
readonly ignoreForEmit: Set<ts.SourceFile>;property incrementalCompilation
readonly incrementalCompilation: IncrementalCompilation;property incrementalStrategy
readonly incrementalStrategy: IncrementalBuildStrategy;property options
readonly options: NgCompilerOptions;property perfRecorder
readonly perfRecorder: ActivePerfRecorder;property programDriver
readonly programDriver: ProgramDriver;property usePoisonedData
readonly usePoisonedData: boolean;method analyzeAsync
analyzeAsync: () => Promise<void>;Perform Angular's analysis step (as a precursor to
getDiagnosticsorprepareEmit) asynchronously.Normally, this operation happens lazily whenever
getDiagnosticsorprepareEmitare called. However, certain consumers may wish to allow for an asynchronous phase of analysis, where resources such asstyleUrlsare resolved asynchronously. In these casesanalyzeAsyncmust be called first, and itsPromiseawaited prior to calling any other APIs ofNgCompiler.
method emitHmrUpdateModule
emitHmrUpdateModule: (node: ts.Declaration) => string | null;Emits the JavaScript module that can be used to replace the metadata of a class during HMR.
Parameter node
Class for which to generate the update module.
method fromTicket
static fromTicket: ( ticket: CompilationTicket, adapter: NgCompilerAdapter) => NgCompiler;Convert a
CompilationTicketinto anNgCompilerinstance for the requested compilation.Depending on the nature of the compilation request, the
NgCompilerinstance may be reused from a previous compilation and updated with any changes, it may be a new instance which incrementally reuses state from a previous compilation, or it may represent a fresh compilation entirely.
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.
Returns
A map of symbols with their associated module, eg: ApplicationRef => @angular/core
method getComponentsWithStyleFile
getComponentsWithStyleFile: ( styleFilePath: string) => ReadonlySet<DeclarationNode>;Retrieves the
ts.Declarations for any component(s) which use the given template file.
method getComponentsWithTemplateFile
getComponentsWithTemplateFile: ( templateFilePath: string) => ReadonlySet<DeclarationNode>;Retrieves the
ts.Declarations for any component(s) which use the given template file.
method getCurrentProgram
getCurrentProgram: () => ts.Program;Get the current
ts.Programknown to thisNgCompiler.Compilation begins with an input
ts.Program, and during template type-checking operations newts.Programs may be produced using theProgramDriver. The most recent suchts.Programto be produced is available here.This
ts.Programserves two key purposes:* As an incremental starting point for creating the next
ts.Programbased on files that the user has changed (for clients using the TS compiler program APIs).* As the "before" point for an incremental compilation invocation, to determine what's changed between the old and new programs (for all compilations).
method getDiagnostics
getDiagnostics: () => ts.Diagnostic[];Get all Angular-related diagnostics for this compilation.
method getDiagnosticsForComponent
getDiagnosticsForComponent: (component: ts.ClassDeclaration) => ts.Diagnostic[];Get all
ts.Diagnostics currently available that pertain to the given component.
method getDiagnosticsForFile
getDiagnosticsForFile: ( file: ts.SourceFile, optimizeFor: OptimizeFor) => ts.Diagnostic[];Get all Angular-related diagnostics for this compilation.
If a
ts.SourceFileis passed, only diagnostics related to that file are returned.
method getDirectiveResources
getDirectiveResources: (classDecl: ts.Declaration) => DirectiveResources | null;Retrieves external resources for the given directive.
method getIndexedComponents
getIndexedComponents: () => Map<DeclarationNode, IndexedComponent>;Run the indexing process and return a
Mapof all indexed components.See the
indexingpackage for more details.
method getMeta
getMeta: (classDecl: ts.Declaration) => PipeMeta | DirectiveMeta | null;method getOptionDiagnostics
getOptionDiagnostics: () => ts.Diagnostic[];Get all setup-related diagnostics for this compilation.
method getResourceDependencies
getResourceDependencies: (file: ts.SourceFile) => string[];Get the resource dependencies of a file.
If the file is not part of the compilation, an empty array will be returned.
method getTemplateTypeChecker
getTemplateTypeChecker: () => TemplateTypeChecker;method prepareEmit
prepareEmit: () => { transformers: ts.CustomTransformers };Fetch transformers and other information which is necessary for a consumer to
emitthe program with Angular-added definitions.
method xi18n
xi18n: (ctx: Xi18nContext) => void;Collect i18n messages into the
Xi18nContext.
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_wrappedwhich 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.Programinterface, 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
NgCompilerhas 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
fspackage).
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;class Reference
class Reference<T extends ts.Node = ts.Node> {}A
ts.Nodeplus the context in which it was discovered.A
Referenceis a pointer to ats.Nodethat was extracted from the program somehow. It contains not only the node itself, but the information regarding how the node was located. In particular, it might track different identifiers by which the node is exposed, as well as potentially a module specifier which might expose the node.The Angular compiler uses
References instead ofts.Nodes when tracking classes or generating imports.
constructor
constructor(node: ts.Node, bestGuessOwningModule?: OwningModule | AmbientImport);property alias
readonly alias: any;property bestGuessOwningModule
readonly bestGuessOwningModule: OwningModule;The compiler's best guess at an absolute module specifier which owns this
Reference.This is usually determined by tracking the import statements which led the compiler to a given node. If any of these imports are absolute, it's an indication that the node being imported might come from that module.
It is not _guaranteed_ that the node in question is exported from its
bestGuessOwningModule- that is mostly a convention that applies in certain package formats.If
bestGuessOwningModuleisnull, then it's likely the node came from the current program.
property debugName
readonly debugName: string;A name for the node, if one is available.
This is only suited for debugging. Any actual references to this node should be made with
ts.Identifiers (seegetIdentityIn).
property hasOwningModuleGuess
readonly hasOwningModuleGuess: boolean;Whether this reference has a potential owning module or not.
See
bestGuessOwningModule.
property isAmbient
readonly isAmbient: boolean;property key
readonly key: string;property node
readonly node: ts.Node;property ownedByModuleGuess
readonly ownedByModuleGuess: string;The best guess at which module specifier owns this particular reference, or
nullif there isn't one.
property synthetic
synthetic: boolean;Indicates that the Reference was created synthetically, not as a result of natural value resolution.
This is used to avoid misinterpreting the Reference in certain contexts.
method addIdentifier
addIdentifier: (identifier: ts.Identifier) => void;Record a
ts.Identifierby which it's valid to refer to this node, within the context of thisReference.
method cloneWithAlias
cloneWithAlias: (alias: Expression) => Reference<T>;method cloneWithNoIdentifiers
cloneWithNoIdentifiers: () => Reference<T>;method getIdentityIn
getIdentityIn: (context: ts.SourceFile) => ts.Identifier | null;Get a
ts.Identifierwithin thisReferencethat can be used to refer within the context of a givents.SourceFile, if any.
method getIdentityInExpression
getIdentityInExpression: (expr: ts.Expression) => ts.Identifier | null;Get a
ts.Identifierfor thisReferencethat exists within the given expression.This is very useful for producing
ts.Diagnostics that referenceReferences that were extracted from some larger expression, as it can be used to pinpoint thets.Identifierwithin the expression from which theReferenceoriginated.
method getOriginForDiagnostics
getOriginForDiagnostics: ( container: ts.Expression, fallback?: ts.Expression) => ts.Expression;Given the 'container' expression from which this
Referencewas extracted, produce ats.Expressionto use in a diagnostic which best indicates the position within the container expression that generated theReference.For example, given a
Referenceto the class 'Bar' and the containing expression:[Foo, Bar, Baz], this function would attempt to return thets.IdentifierforBarwithin the array. This could be used to produce a nice diagnostic context:[Foo, Bar, Baz]~~~If no specific node can be found, then the
fallbackexpression is used, which defaults to the entire containing expression.
class ReferenceEmitter
class ReferenceEmitter {}Generates
Expressions which refer toReferences in a given context.A
ReferenceEmitteruses one or moreReferenceEmitStrategyimplementations to produce anExpressionwhich refers to aReferencein the context of a particular file.
constructor
constructor(strategies: ReferenceEmitStrategy[]);method emit
emit: ( ref: Reference, context: ts.SourceFile, importFlags?: ImportFlags) => ReferenceEmitResult;class RegistryDomSchemaChecker
class RegistryDomSchemaChecker implements DomSchemaChecker<TemplateDiagnostic> {}Checks non-Angular elements and properties against the
DomElementSchemaRegistry, a schema maintained by the Angular team via extraction from a browser IDL.
constructor
constructor(resolver: TypeCheckSourceResolver);property diagnostics
readonly diagnostics: readonly TemplateDiagnostic[];method checkElement
checkElement: ( id: TypeCheckId, tagName: string, sourceSpanForDiagnostics: ParseSourceSpan, schemas: SchemaMetadata[], hostIsStandalone: boolean) => void;method checkHostElementProperty
checkHostElementProperty: ( id: TypeCheckId, element: TmplAstHostElement, name: string, span: ParseSourceSpan, schemas: SchemaMetadata[]) => void;method checkTemplateElementProperty
checkTemplateElementProperty: ( id: TypeCheckId, tagName: string, name: string, span: ParseSourceSpan, schemas: SchemaMetadata[], hostIsStandalone: boolean) => void;class SymbolBuilder
class SymbolBuilder {}Generates and caches
Symbols for various template structures for a given component.The
SymbolBuilderinternally caches theSymbols it creates, and must be destroyed and replaced if the component's template changes.
constructor
constructor( tcbPath: String & { _brand: 'AbsoluteFsPath' }, tcbIsShim: boolean, typeCheckBlock: ts.Node, boundTarget: SymbolBoundTarget, typeCheckingConfig: TypeCheckingConfig);method getSymbol
getSymbol: { (node: TmplAstTemplate | TmplAstElement): | TemplateSymbol | ElementSymbol | null; (node: any): ReferenceSymbol | VariableSymbol | LetDeclarationSymbol; (node: TmplAstComponent): SelectorlessComponentSymbol; (node: TmplAstDirective): SelectorlessDirectiveSymbol; (node: any): Symbol;};class TrackedIncrementalBuildStrategy
class TrackedIncrementalBuildStrategy implements IncrementalBuildStrategy {}Tracks an
IncrementalStatewithin the strategy itself.
method getIncrementalState
getIncrementalState: () => IncrementalState | null;method setIncrementalState
setIncrementalState: (state: IncrementalState) => void;method toNextBuildStrategy
toNextBuildStrategy: () => TrackedIncrementalBuildStrategy;Interfaces
interface AbstractBoundTemplate
interface AbstractBoundTemplate<T> {}Abstract representation of a bound template, providing methods to query directives and targets in the template.
method getDirectivesOfNode
getDirectivesOfNode: ( node: TmplAstElement | TmplAstTemplate | TmplAstComponent | TmplAstDirective) => Array<{ ref: { node: T }; selector: string | null }> | null;method getExpressionTarget
getExpressionTarget: ( ast: AST) => TmplAstReference | TmplAstVariable | TmplAstLetDeclaration | null;method getReferenceTarget
getReferenceTarget: ( node: TmplAstReference) => | TmplAstElement | TmplAstTemplate | TmplAstComponent | TmplAstDirective | { node: | TmplAstElement | TmplAstTemplate | TmplAstComponent | TmplAstDirective; directive: { ref: { node: T } }; } | null;method getTemplateAst
getTemplateAst: () => TmplAstNode[] | undefined;method getUsedDirectives
getUsedDirectives: () => Array<{ ref: { node: T }; isComponent: boolean }>;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
templateUrlandstyleUrlsproperty in all decorators with inlined contents intemplateandstylesproperties. When enabled, the .js output of ngc will have no lazy-loadedtemplateUrlorstyleUrls. 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 AttributeIdentifier
interface AttributeIdentifier extends TemplateIdentifier {}Describes an element attribute in a template.
property kind
kind: IdentifierKind.Attribute;interface BindingSymbol
interface BindingSymbol {}Represents either an input or output binding in a template.
property kind
kind: SymbolKind.Binding;property target
target: DirectiveSymbol | ElementSymbol | TemplateSymbol;The
DirectiveSymbolorElementSymbolfor the Directive, Component, orHTMLElementwith the binding.
property tcbLocation
tcbLocation: TcbLocation;The location in the shim file where the field access for the binding appears.
property tcbTypeLocation
tcbTypeLocation?: TcbLocation;The position of the expression used to determine the type.
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 ClassSymbol
interface ClassSymbol {}Represents an instance of a class found in the TCB, i.e. `var _pipe1: MyPipe = null!;
property isPipeClassSymbol
isPipeClassSymbol?: boolean;Whether this class symbol represents a pipe.
property tcbLocation
tcbLocation: TcbLocation;The position for the variable declaration for the class instance.
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
toSummaryFileNameback 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
importto a file path. I.e.path/to/containingFile.tscontainingimport {...} 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.tsParameter 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
templateUrlandstyleUrlsproperty in all decorators with inlined contents intemplateandstylesproperties. When enabled, the .js output of ngc will have no lazy-loadedtemplateUrlorstyleUrls. 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 ComponentNodeIdentifier
interface ComponentNodeIdentifier<T = DeclarationNode> extends BaseDirectiveHostIdentifier<T> {}Describes a selectorless component node in a template file.
property kind
kind: IdentifierKind.Component;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[] | null;property signatures
signatures: { parameters: ParameterEntry[]; jsdocTags: JsDocTagEntry[];}[];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 DirectiveMeta
interface DirectiveMeta extends T2DirectiveMeta, DirectiveTypeCheckMeta {}Metadata collected for a directive within an NgModule's scope.
property assumedToExportProviders
assumedToExportProviders: boolean;Whether the directive should be assumed to export providers if imported as a standalone type.
property baseClass
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;A
Referenceto the base class for the directive, if one was detected.A value of
'dynamic'indicates that while the analyzer detected that this directive extends another type, it could not statically determine the base class.
property decorator
decorator: ts.Decorator | null;The primary decorator associated with this directive.
If this is
null, no decorator exists, meaning it's probably from a .d.ts file.
property deferredImports
deferredImports: Reference<ClassDeclaration>[] | null;For standalone components, the list of imported types that can be used in
@deferblocks (when only explicit dependencies are allowed).
property hostDirectives
hostDirectives: HostDirectiveMeta[] | null;Additional directives applied to the directive host.
property imports
imports: Reference<ClassDeclaration>[] | null;For standalone components, the list of imported types.
property inputFieldNamesFromMetadataArray
inputFieldNamesFromMetadataArray: Set<string> | null;List of input fields that were defined in the class decorator metadata. Null for directives extracted from
.d.ts
property inputs
inputs: ClassPropertyMapping<InputMapping>;A mapping of input field names to the property names.
property isExplicitlyDeferred
isExplicitlyDeferred: boolean;Whether this class was imported into a standalone component's scope via
@Component.deferredImportsfield.
property isPoisoned
isPoisoned: boolean;Whether the directive had some issue with its declaration that means it might not have complete and reliable metadata.
property isSignal
isSignal: boolean;Whether the directive is a signal entity.
property isStandalone
isStandalone: boolean;Whether the directive is a standalone entity.
property isStructural
isStructural: boolean;Whether the directive is likely a structural directive (injects
TemplateRef).
property kind
kind: MetaKind.Directive;property localReferencedSymbols
localReferencedSymbols: Set<string> | null;Names of the symbols within the source file that are referenced directly inside the template.
property matchSource
matchSource: MatchSource;Way in which the directive was matched.
property outputs
outputs: ClassPropertyMapping;A mapping of output field names to the property names.
property queries
queries: string[];property rawImports
rawImports: ts.Expression | null;Node declaring the
importsof a standalone component. Used to produce diagnostics.
property ref
ref: Reference<ClassDeclaration>;property schemas
schemas: SchemaMetadata[] | null;For standalone components, the list of schemas declared.
property selector
selector: string | null;Unparsed selector of the directive, or null if the directive does not have a selector.
property selectorlessEnabled
selectorlessEnabled: boolean;Whether selectorless is enabled for the specific component.
interface DirectiveModuleExportDetails
interface DirectiveModuleExportDetails {}property exportName
exportName: string;property moduleSpecifier
moduleSpecifier: string;interface DirectiveNodeIdentifier
interface DirectiveNodeIdentifier<T = DeclarationNode> extends BaseDirectiveHostIdentifier<T> {}Describes a selectorless directive node in a template file.
property kind
kind: IdentifierKind.Directive;interface DirectSourceMapping
interface DirectSourceMapping {}A mapping to a node within the same source file..
ParseSourceSpans for this node should be accurate for direct reporting in a TS error message.
interface DocEntry
interface DocEntry {}Base type for all documentation entities.
property aliases
aliases?: string[];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 DomBindingSymbol
interface DomBindingSymbol {}A representation of an attribute on an element or template. These bindings aren't currently type-checked (see
checkTypeOfDomBindings) so they won't have ats.Type,ts.Symbol, or shim location.
interface ElementIdentifier
interface ElementIdentifier<T = DeclarationNode> extends BaseDirectiveHostIdentifier<T> {}Describes an indexed element in a template. The name of an
ElementIdentifieris the entire element tag, which can be parsed by an indexer to determine where used directives should be referenced.
property kind
kind: IdentifierKind.Element;interface ElementSymbol
interface ElementSymbol {}A representation of an element in a component template.
property directives
directives: DirectiveSymbol[];A list of directives applied to the element.
property kind
kind: SymbolKind.Element;property tcbLocation
tcbLocation: TcbLocation;The location in the shim file for the variable that holds the type of the element.
property templateNode
templateNode: TmplAstElement;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;property repo
repo: string;property symbols
symbols?: 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 ExpressionSymbol
interface ExpressionSymbol {}A representation of an expression in a component template.
property kind
kind: SymbolKind.Expression;property tcbLocation
tcbLocation: TcbLocation;The position of the most relevant part of the expression.
property tcbTypeLocation
tcbTypeLocation?: TcbLocation;The position of the expression used to determine the type.
interface ExternalTemplateSourceMapping
interface ExternalTemplateSourceMapping {}A mapping to a template declared in an external HTML file, where node positions in
ParseSourceSpans represent accurate offsets into the external file.In this case, the given
noderefers to thetemplateUrlexpression.
property componentClass
componentClass: ClassDeclaration;property node
node: ts.Expression;property template
template: string;property templateUrl
templateUrl: string;property type
type: 'external';interface FileStats
interface FileStats {}Information about an object in the FileSystem. This is analogous to the
fs.Statsclass 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 FileUpdate
interface FileUpdate {}property newText
newText: string;The source file text.
property originalFile
originalFile: ts.SourceFile | null;Represents the source file from the original program that is being updated. If the file update targets a shim file then this is null, as shim files do not have an associated original file.
interface FullSourceMapping
interface FullSourceMapping {}A representation of all a node's type checking information we know. Useful for producing diagnostics based on a TCB node or generally mapping from a TCB node back to a template location.
property sourceLocation
sourceLocation: SourceLocation;property sourceMapping
sourceMapping: SourceMapping;property span
span: ParseSourceSpan;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 GetPotentialAngularMetaOptions
interface GetPotentialAngularMetaOptions {}property includeExternalModule
includeExternalModule: boolean;interface GlobalCompletion
interface GlobalCompletion {}Autocompletion data for an expression in the global scope.
Global completion is accomplished by merging data from two sources: * TypeScript completion of the component's class members. * Local references and variables that are in scope at a given template level.
property componentContext
componentContext: TcbLocation;A location within the type-checking shim where TypeScript's completion APIs can be used to access completions for the template's component context (component class members).
property nodeContext
nodeContext: TcbLocation | null;A location within the type-checking shim where TypeScript's completion APIs can be used to access completions for the AST node of the cursor position (primitive constants).
property templateContext
templateContext: Map< string, ReferenceCompletion | VariableCompletion | LetDeclarationCompletion>;Mapof local references and variables that are visible at the requested level of the template.Shadowing of references/variables from multiple levels of the template has already been accounted for in the preparation of
templateContext. Entries here shadow component members of the same name (from thecomponentContextcompletions).
interface HostBindingsContext
interface HostBindingsContext {}Contextual data for type checking the host bindings of a directive.
property directives
directives: DirectiveMeta[];Directives present on the host element.
property node
node: TmplAstHostElement;AST node representing the host element of the directive.
property sourceMapping
sourceMapping: SourceMapping;Describes the source of the host bindings. Used for mapping errors back.
interface IndexedComponent
interface IndexedComponent<T = DeclarationNode> {}Describes an analyzed, indexed component and its template.
interface IndirectSourceMapping
interface IndirectSourceMapping {}A mapping to a node which is still in a TS file, but where the positions in any
ParseSourceSpans are not accurate for one reason or another.This can occur if the expression was interpolated in a way where the compiler could not construct a contiguous mapping for the template string.
property componentClass
componentClass: ClassDeclaration;property node
node: ts.Expression;property template
template: string;property type
type: 'indirect';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 InputBindingSymbol
interface InputBindingSymbol {}A representation of an input binding in a component template.
interface InterfaceEntry
interface InterfaceEntry extends DocEntry {}Documentation entity for a TypeScript interface.
property extends
extends: string[];property generics
generics: GenericEntry[];property implements
implements: string[];property members
members: MemberEntry[];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 LetDeclarationCompletion
interface LetDeclarationCompletion {}An autocompletion result representing an
@letdeclaration in the template.
interface LetDeclarationIdentifier
interface LetDeclarationIdentifier extends TemplateIdentifier {}Describes a
@letdeclaration in a template.
property kind
kind: IdentifierKind.LetDeclaration;interface LetDeclarationSymbol
interface LetDeclarationSymbol {}A representation of an
@letdeclaration in a component template.
property declaration
declaration: TmplAstLetDeclaration;The node in the
TemplateAstwhere the@letis declared.
property initializerLocation
initializerLocation: TcbLocation;The location in the shim file of the
@letdeclaration's initializer expression.
property kind
kind: SymbolKind.LetDeclaration;property localVarLocation
localVarLocation: TcbLocation;The location in the shim file for the identifier of the
@letdeclaration.
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 MethodIdentifier
interface MethodIdentifier<T = DeclarationNode> extends ExpressionIdentifier<T> {}Describes a method accessed in a template.
Deprecated
No longer being used. To be removed.
property kind
kind: IdentifierKind.Method;interface NamespaceEntry
interface NamespaceEntry extends DocEntry {}Documentation entity for a TypeScript namespace.
property members
members: DocEntry[];interface NgCompilerAdapter
interface NgCompilerAdapter extends Omit<ts.ModuleResolutionHost, 'getCurrentDirectory'>, Pick< ExtendedTsCompilerHost, 'getCurrentDirectory' | ExtendedCompilerHostMethods >, SourceFileTypeIdentifier {}Adapter for
NgCompilerthat allows it to be used in various circumstances, such as command-linengc, as a plugin tots_libraryin Bazel, or from the Language Service.NgCompilerAdapteris a subset of theNgCompilerHostimplementation ofts.CompilerHostwhich is relied upon byNgCompiler. A consumer ofNgCompilercan therefore use theNgCompilerHostor implementNgCompilerAdapteritself.
property constructionDiagnostics
readonly constructionDiagnostics: ts.Diagnostic[];An array of
ts.Diagnostics that occurred during construction of thets.Program.
property entryPoint
readonly entryPoint: AbsoluteFsPath | null;A path to a single file which represents the entrypoint of an Angular Package Format library, if the current program is one.
This is used to emit a flat module index if requested, and can be left
nullif that is not required.
property ignoreForEmit
readonly ignoreForEmit: Set<ts.SourceFile>;A
Setofts.SourceFiles which are internal to the program and should not be emitted as JS files.Often these are shim files such as
ngtypecheckshims used for template type-checking in command-line ngc.
property rootDirs
readonly rootDirs: ReadonlyArray<AbsoluteFsPath>;Resolved list of root directories explicitly set in, or inferred from, the tsconfig.
property unifiedModulesHost
readonly unifiedModulesHost: UnifiedModulesHost | null;A specialized interface provided in some environments (such as Bazel) which overrides how import specifiers are generated.
If not required, this can be
null.
interface NgCompilerOptions
interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions, TypeCheckingOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {}A merged interface of all of the various Angular compiler options, as well as the standard
ts.CompilerOptions.Also includes a few miscellaneous options.
index signature
[prop: string]: any;interface NodeAdapter
interface NodeAdapter<T> {}Adapter to extract information from a node, such as its name and file name.
method getFileName
getFileName: (node: T) => string;method getName
getName: (node: T) => string;interface OutputBindingSymbol
interface OutputBindingSymbol {}A representation of an output binding in a component template.
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
fromandto.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 isPure
isPure: boolean;property isStandalone
isStandalone: boolean;property pipeName
pipeName: string | null;property usage
usage: string;interface PipeMeta
interface PipeMeta {}Metadata for a pipe within an NgModule's scope.
property decorator
decorator: ts.Decorator | null;property isExplicitlyDeferred
isExplicitlyDeferred: boolean;property isPure
isPure: boolean;property isStandalone
isStandalone: boolean;property kind
kind: MetaKind.Pipe;property name
name: string | null;property nameExpr
nameExpr: ts.Expression | null;property ref
ref: Reference<ClassDeclaration>;interface PipeSymbol
interface PipeSymbol {}A representation for a call to a pipe's transform method in the TCB.
property classSymbol
classSymbol: ClassSymbol;The symbol for the pipe class as an instance that appears in the TCB.
property kind
kind: SymbolKind.Pipe;property tcbLocation
tcbLocation: TcbLocation;The position of the transform call in the template.
interface PluginCompilerHost
interface PluginCompilerHost extends ts.CompilerHost, Partial<UnifiedModulesHost> {}A
ts.CompilerHostwhich also returns a list of input files, out of which thets.Programshould be created.Currently mirrored from @bazel/concatjs/internal/tsc_wrapped/plugin_api (with the naming of
fileNameToModuleNamecorrected).
property inputFiles
readonly inputFiles: ReadonlyArray<string>;interface PotentialDirective
interface PotentialDirective {}Metadata on a directive which is available in a template.
property isComponent
isComponent: boolean;trueif this directive is a component.
property isInScope
isInScope: boolean;Whether or not this directive is in scope.
property isStructural
isStructural: boolean;trueif this directive is a structural directive.
property ngModule
ngModule: ClassDeclaration | null;The module which declares the directive.
property ref
ref: SymbolReference;property selector
selector: string | null;The selector for the directive or component.
property tsCompletionEntryInfos
tsCompletionEntryInfos: TsCompletionEntryInfo[] | null;The directive can be exported by multiple modules, collecting all the entry information here.
Filter the appropriate entry information when using it to compute the module specifier.
interface PotentialDirectiveModuleSpecifierResolver
interface PotentialDirectiveModuleSpecifierResolver {}method resolve
resolve: ( toImport: Reference<ClassDeclaration>, importOn: ts.Node | null) => DirectiveModuleExportDetails | null;interface PotentialImport
interface PotentialImport {}A PotentialImport for some Angular trait has a TypeScript module specifier, which can be relative, as well as an identifier name.
property isForwardReference
isForwardReference: boolean;property kind
kind: PotentialImportKind;property moduleSpecifier
moduleSpecifier?: string;property symbolName
symbolName: string;interface PotentialPipe
interface PotentialPipe {}Metadata for a pipe which is available in a template.
property isInScope
isInScope: boolean;Whether or not this pipe is in scope.
property name
name: string | null;Name of the pipe.
property ref
ref: SymbolReference;property tsCompletionEntryInfos
tsCompletionEntryInfos: TsCompletionEntryInfo[] | null;The pipe can be exported by multiple modules, collecting all the entry information here.
Filter the appropriate entry information when using it to compute the module specifier.
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()oremitto throw.
interface ProgramDriver
interface ProgramDriver {}property inliningMode
readonly inliningMode: InliningMode;How this strategy handles operations that require inlining.
property supportsInlineOperations
readonly supportsInlineOperations: boolean;Whether this strategy supports modifying user files (inline modifications) in addition to modifying type-checking shims.
method getProgram
getProgram: () => ts.Program;Retrieve the latest version of the program, containing all the updates made thus far.
method getSourceFileVersion
getSourceFileVersion: (sf: ts.SourceFile) => string;Retrieve a string version for a given
ts.SourceFile, which much change when the contents of the file have changed.If this method is present, the compiler will use these versions in addition to object identity for
ts.SourceFiles to determine what's changed between two incremental programs. This is valuable for some clients (such as the Language Service) that treatts.SourceFiles as mutable objects.
method updateFiles
updateFiles: ( contents: Map<AbsoluteFsPath, FileUpdate>, updateMode: UpdateMode) => void;Incorporate a set of changes to either augment or completely replace the type-checking code included in the type-checking program.
interface ProgramTypeCheckAdapter
interface ProgramTypeCheckAdapter {}Interface to trigger generation of type-checking code for a program given a new
TypeCheckContext.
method typeCheck
typeCheck: (sf: ts.SourceFile, ctx: TypeCheckContext) => void;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 PropertyIdentifier
interface PropertyIdentifier<T = DeclarationNode> extends ExpressionIdentifier<T> {}Describes a property accessed in a template.
property kind
kind: IdentifierKind.Property;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 ReferenceCompletion
interface ReferenceCompletion {}An autocompletion result representing a local reference declared in the template.
interface ReferenceIdentifier
interface ReferenceIdentifier<T = DeclarationNode> extends TemplateIdentifier {}Describes a reference in a template like "foo" in
<div #foo></div>.
property kind
kind: IdentifierKind.Reference;property target
target: { /** The template AST node that the reference targets. */ node: DirectiveHostIdentifier<T>; /** * The directive on `node` that the reference targets. If no directive is targeted, this is * `null`. */ directive: T | null;} | null;The target of this reference. If the target is not known, this is
null.
interface ReferenceSymbol
interface ReferenceSymbol {}A representation of a local reference in a component template.
property declaration
declaration: TmplAstReference;The node in the
TemplateAstwhere the symbol is declared. That is, node for the#refor#ref="exportAs".
property kind
kind: SymbolKind.Reference;property referenceVarLocation
referenceVarLocation: TcbLocation;The location in the TCB for the identifier node in the reference variable declaration. For example, given a variable declaration statement for a template reference:
var _t2 = _t1, this location is[_t2 node].getStart(). This location can be used to find references to the variable within the template.
property target
target: TmplAstElement | TmplAstTemplate | SymbolReference;Depending on the type of the reference, this is one of the following: -
TmplAstElementwhen the local ref refers to the HTML element -TmplAstTemplatewhen the ref refers to anng-template-SymbolReferencewhen the local ref refers to a Directive instance (#ref="myExportAs")
property targetLocation
targetLocation: TcbLocation;The location in the shim file of a variable that holds the type of the local ref. For example, a reference declaration like the following:
var _t1 = document.createElement('div');var _t2 = _t1; // This is the reference declarationThis
targetLocationis[_t1 variable declaration].getStart().
interface ReflectionHost
interface ReflectionHost {}Abstracts reflection operations on a TypeScript AST.
Depending on the format of the code being interpreted, different concepts are represented with different syntactical structures. The
ReflectionHostabstracts over those differences and presents a single API by which the compiler can query specific information about the AST.All operations on the
ReflectionHostrequire the use of TypeScriptts.Nodes with binding information already available (that is, nodes that come from ats.Programthat has been type-checked, and are not synthetically created).
method getBaseClassExpression
getBaseClassExpression: (clazz: ClassDeclaration) => ts.Expression | null;Get an expression representing the base class (if any) of the given
clazz.This expression is most commonly an Identifier, but is possible to inherit from a more dynamic expression.
Parameter clazz
the class whose base we want to get.
method getConstructorParameters
getConstructorParameters: (clazz: ClassDeclaration) => CtorParameter[] | null;Reflect over the constructor of a class and return metadata about its parameters.
This method only looks at the constructor of a class directly and not at any inherited constructors.
Parameter clazz
a
ClassDeclarationrepresenting the class over which to reflect.Returns
an array of
Parametermetadata representing the parameters of the constructor, if a constructor exists. If the constructor exists and has 0 parameters, this array will be empty. If the class has no constructor, this method returnsnull.
method getDeclarationOfIdentifier
getDeclarationOfIdentifier: (id: ts.Identifier) => Declaration | null;Trace an identifier to its declaration, if possible.
This method attempts to resolve the declaration of the given identifier, tracing back through imports and re-exports until the original declaration statement is found. A
Declarationobject is returned if the original declaration is found, ornullis returned otherwise.If the declaration is in a different module, and that module is imported via an absolute path, this method also returns the absolute path of the imported module. For example, if the code is:
import {RouterModule} from '@angular/core';export const ROUTES = RouterModule.forRoot([...]);and if
getDeclarationOfIdentifieris called onRouterModulein theROUTESexpression, then it would traceRouterModulevia its import from@angular/core, and note that the definition was imported from@angular/coreinto the application where it was referenced.If the definition is re-exported several times from different absolute module names, only the first one (the one by which the application refers to the module) is returned.
This module name is returned in the
viaModulefield of theDeclaration. If The declaration is relative to the application itself and there was no import through an absolute path, thenviaModuleisnull.Parameter id
a TypeScript
ts.Identifierto trace back to a declaration.Returns
metadata about the
Declarationif the original declaration is found, ornullotherwise.
method getDecoratorsOfDeclaration
getDecoratorsOfDeclaration: (declaration: ts.Declaration) => Decorator[] | null;Examine a declaration (for example, of a class or function) and return metadata about any decorators present on the declaration.
Parameter declaration
a TypeScript
ts.Declarationnode representing the class or function over which to reflect. For example, if the intent is to reflect the decorators of a class and the source is in ES6 format, this will be ats.ClassDeclarationnode. If the source is in ES5 format, this might be ats.VariableDeclarationas classes in ES5 are represented as the result of an IIFE execution.Returns
an array of
Decoratormetadata if decorators are present on the declaration, ornullif either no decorators were present or if the declaration is not of a decoratable type.
method getDefinitionOfFunction
getDefinitionOfFunction: (fn: ts.Node) => FunctionDefinition | null;Reflect over a function and return metadata about its parameters and body.
Functions in TypeScript and ES5 code have different AST representations, in particular around default values for parameters. A TypeScript function has its default value as the initializer on the parameter declaration, whereas an ES5 function has its default value set in a statement of the form:
if (param === void 0) { param = 3; }
This method abstracts over these details, and interprets the function declaration and body to extract parameter default values and the "real" body.
A current limitation is that this metadata has no representation for shorthand assignment of parameter objects in the function signature.
Parameter fn
a TypeScript
ts.Declarationnode representing the function over which to reflect.Returns
a
FunctionDefinitiongiving metadata about the function definition.
method getExportsOfModule
getExportsOfModule: (module: ts.Node) => Map<string, Declaration> | null;Collect the declarations exported from a module by name.
Iterates over the exports of a module (including re-exports) and returns a map of export name to its
Declaration. If an exported value is itself re-exported from another module, theDeclaration'sviaModulewill reflect that.Parameter node
a TypeScript
ts.Noderepresenting the module (for example ats.SourceFile) for which to collect exports.Returns
a map of
Declarations for the module's exports, by name.
method getGenericArityOfClass
getGenericArityOfClass: (clazz: ClassDeclaration) => number | null;Get the number of generic type parameters of a given class.
Parameter clazz
a
ClassDeclarationrepresenting the class over which to reflect.Returns
the number of type parameters of the class, if known, or
nullif the declaration is not a class or has an unknown number of type parameters.
method getImportOfIdentifier
getImportOfIdentifier: (id: ts.Identifier) => Import | null;Determine if an identifier was imported from another module and return
Importmetadata describing its origin.Parameter id
a TypeScript
ts.Identifierto reflect.Returns
metadata about the
Importif the identifier was imported from another module, ornullif the identifier doesn't resolve to an import but instead is locally defined.
method getMembersOfClass
getMembersOfClass: (clazz: ClassDeclaration) => ClassMember[];Examine a declaration which should be of a class, and return metadata about the members of the class.
Parameter clazz
a
ClassDeclarationrepresenting the class over which to reflect.Returns
an array of
ClassMembermetadata representing the members of the class.Throws
if
declarationdoes not resolve to a class declaration.
method getVariableValue
getVariableValue: (declaration: ts.VariableDeclaration) => ts.Expression | null;Find the assigned value of a variable declaration.
Normally this will be the initializer of the declaration, but where the variable is not a
constwe may need to look elsewhere for the variable's value.Parameter declaration
a TypeScript variable declaration, whose value we want.
Returns
the value of the variable, as a TypeScript expression node, or
undefinedif the value cannot be computed.
method hasBaseClass
hasBaseClass: (clazz: ClassDeclaration) => boolean;Determines whether the given declaration, which should be a class, has a base class.
Parameter clazz
a
ClassDeclarationrepresenting the class over which to reflect.
method isClass
isClass: (node: ts.Node) => node is any;Check whether the given node actually represents a class.
method isStaticallyExported
isStaticallyExported: (decl: ts.Node) => boolean;Returns
trueif a declaration is exported from the module in which it's defined.Not all mechanisms by which a declaration is exported can be statically detected, especially when processing already compiled JavaScript. A
falseresult does not indicate that the declaration is never visible outside its module, only that it was not exported via one of the export mechanisms that theReflectionHostis capable of statically checking.
interface Resource
interface Resource {}Represents an resource for a component and contains the
AbsoluteFsPathto the file which was resolved by evaluating thets.Expression(generally, a relative or absolute string path to the resource).If the resource is inline, the
pathwill benull.
interface SelectorlessComponentSymbol
interface SelectorlessComponentSymbol {}A representation of a selectorless component reference in a template.
property directives
directives: DirectiveSymbol[];Includes the component class itself and any host directives that may have been applied as a side-effect of it.
property kind
kind: SymbolKind.SelectorlessComponent;property tcbLocation
tcbLocation: TcbLocation;The location in the shim file for the variable that holds the type of the component.
property templateNode
templateNode: TmplAstComponent;Template AST node defining the component.
interface SelectorlessDirectiveSymbol
interface SelectorlessDirectiveSymbol {}A representation of a selectorless directive reference in a template.
property directives
directives: DirectiveSymbol[];Includes the directive class itself and any host directives that may have been applied as a side-effect of it.
property kind
kind: SymbolKind.SelectorlessDirective;property tcbLocation
tcbLocation: TcbLocation;The location in the shim file for the variable that holds the type of the directive.
property templateNode
templateNode: TmplAstDirective;Template AST node defining the directive.
interface SourceEntry
interface SourceEntry {}interface SourceLocation
interface SourceLocation {}A mapping of a TCB template id to a span in the corresponding source code.
interface SymbolBoundTarget
interface SymbolBoundTarget {}method getConsumerOfBinding
getConsumerOfBinding: ( binding: TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute) => SymbolDirectiveMeta | TmplAstElement | TmplAstTemplate | null;method getDirectivesOfNode
getDirectivesOfNode: (node: TmplAstNode) => SymbolDirectiveMeta[] | null;method getExpressionTarget
getExpressionTarget: (expr: AST) => TemplateEntity | null;method getReferenceTarget
getReferenceTarget: ( ref: TmplAstReference) => ReferenceTarget<SymbolDirectiveMeta> | null;interface SymbolDirectiveMeta
interface SymbolDirectiveMeta {}property hostDirectives
hostDirectives?: HostDirectiveMeta[] | null;property inputs
inputs: ClassPropertyMapping;property isComponent
isComponent: boolean;property isStructural
isStructural: boolean;property matchSource
matchSource: MatchSource;property outputs
outputs: ClassPropertyMapping;property selector
selector: string | null;method getNgModule
getNgModule: () => ClassDeclaration | null;method getSymbolReference
getSymbolReference: () => SymbolReference;interface SymbolReference
interface SymbolReference {}A reference to a symbol in a source file, without holding heavy AST nodes.
property filePath
filePath: string;property moduleSpecifier
moduleSpecifier?: string;property name
name: string;property position
position: number;interface TcbLocation
interface TcbLocation {}Information about where a
ts.Nodecan be found in the type check file. This can either be a type-checking shim file, or an original source file for inline type check blocks.
property endInFile
endInFile?: number;The end position in the TCB file. Used to correctly resolve AST expressions.
property isShimFile
isShimFile: boolean;Whether the type check block exists in a type-checking shim file or is inline.
property positionInFile
positionInFile: number;The location in the file where node appears.
property tcbPath
tcbPath: AbsoluteFsPath;The fully qualified path of the file which contains the generated TypeScript type check code for the component's template.
interface TemplateContext
interface TemplateContext {}Contextuable data for type checking the template of a component.
property file
file: ParseSourceFile;ParseSourceFileassociated with the template.
property nodes
nodes: TmplAstNode[];AST nodes representing the template.
property parseErrors
parseErrors: ParseError[] | null;Errors produced while parsing the template.
property pipes
pipes: Map<string, PipeMeta>;Pipes available within the template.
property preserveWhitespaces
preserveWhitespaces: boolean;Whether the template preserves whitespaces.
property sourceMapping
sourceMapping: SourceMapping;Describes the origin of the template text. Used for mapping errors back.
interface TemplateDiagnostic
interface TemplateDiagnostic extends ts.DiagnosticWithLocation {}A
ts.Diagnosticwith additional information about the diagnostic related to template type-checking.
property sourceFile
sourceFile: ts.SourceFile;The component with the template that resulted in this diagnostic.
property typeCheckId
typeCheckId: TypeCheckId;The type check ID of the directive that resulted in this diagnostic.
interface TemplateIdentifier
interface TemplateIdentifier {}Describes a semantically-interesting identifier in a template, such as an interpolated variable or selector.
interface TemplateNodeIdentifier
interface TemplateNodeIdentifier<T = DeclarationNode> extends BaseDirectiveHostIdentifier<T> {}Describes an indexed template node in a component template file.
property kind
kind: IdentifierKind.Template;interface TemplateSymbol
interface TemplateSymbol {}property directives
directives: DirectiveSymbol[];A list of directives applied to the element.
property kind
kind: SymbolKind.Template;property templateNode
templateNode: TmplAstTemplate;interface TemplateTypeChecker
interface TemplateTypeChecker {}Interface to the Angular Template Type Checker to extract diagnostics and intelligence from the compiler's understanding of component templates.
This interface is analogous to TypeScript's own
ts.TypeCheckerAPI.In general, this interface supports two kinds of operations: - updating Type Check Blocks (TCB)s that capture the template in the form of TypeScript code - querying information about available TCBs, including diagnostics
Once a TCB is available, information about it can be queried. If no TCB is available to answer a query, depending on the method either
nullwill be returned or an error will be thrown.
method generateAllTypeCheckBlocks
generateAllTypeCheckBlocks: () => void;Ensures shims for the whole program are generated. This type of operation would be required by operations like "find references" and "refactor/rename" because references may appear in type check blocks generated from templates anywhere in the program.
method getDiagnosticsForComponent
getDiagnosticsForComponent: (component: ts.ClassDeclaration) => ts.Diagnostic[];Get all
ts.Diagnostics currently available that pertain to the given component.This method always runs in
OptimizeFor.SingleFilemode.
method getDiagnosticsForFile
getDiagnosticsForFile: ( sf: ts.SourceFile, optimizeFor: OptimizeFor) => ts.Diagnostic[];Get all
ts.Diagnostics currently available for the givents.SourceFile.This method will fail (throw) if there are components within the
ts.SourceFilethat do not have TCBs available.Generating a template type-checking program is expensive, and in some workflows (e.g. checking an entire program before emit), it should ideally only be done once. The
optimizeForflag allows the caller to hint togetDiagnosticsForFile(which internally will create a template type-checking program if needed) whether the caller is interested in just the results of the single file, or whether they plan to query about other files in the program. Based on this flag,getDiagnosticsForFilewill determine how much of the user's program to prepare for checking as part of the template type-checking program it creates.
method getDirectiveMetadata
getDirectiveMetadata: ( dir: ts.ClassDeclaration) => TypeCheckableDirectiveMeta | null;Retrieve the type checking engine's metadata for the given directive class, if available.
method getDirectiveScopeData
getDirectiveScopeData: ( component: ts.ClassDeclaration, isInScope: boolean, tsCompletionEntryInfo: TsCompletionEntryInfo | null) => PotentialDirective | null;Get the scope data for a directive.
method getDirectivesOfNode
getDirectivesOfNode: ( component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate) => TypeCheckableDirectiveMeta[] | null;Gets the directives that apply to the given template node in a component's template.
method getElementsInFileScope
getElementsInFileScope: ( component: ts.ClassDeclaration) => Map<string, PotentialDirective | null>;Retrieve a
Mapof potential template element tags that includes in the current component's file scope, or in the component's NgModule scope.The different with the
getPotentialElementTagsis that the directives in the map do not need to update the import statement.
method getExpressionCompletionLocation
getExpressionCompletionLocation: ( expr: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration) => TcbLocation | null;For the given expression node, retrieve a
TcbLocationthat can be used to perform autocompletion at that point in the expression, if such a location exists.
method getExpressionTarget
getExpressionTarget: ( expression: AST, clazz: ts.ClassDeclaration) => TemplateEntity | null;Gets the target of a template expression, if possible. See
BoundTarget.getExpressionTargetfor more information.
method getGlobalCompletions
getGlobalCompletions: ( context: TmplAstTemplate | null, component: ts.ClassDeclaration, node: AST | TmplAstNode) => GlobalCompletion | null;Get "global"
Completions in the given context.Global completions are completions in the global context, as opposed to completions within an existing expression. For example, completing inside a new interpolation expression (
{{|}}) or inside a new property binding `[input]="|" should retrieve global completions, which will include completions from the template's context component, as well as any local references or template variables which are in scope for that expression.
method getGlobalTsContext
getGlobalTsContext: (component: ts.ClassDeclaration) => TcbLocation | null;Get the
TcbLocationfor the global context, which is the location of thethisvariable.
method getHostElement
getHostElement: ( directive: ts.ClassDeclaration, optimizeFor?: OptimizeFor) => TmplAstHostElement | null;Retrieve the host element of the given directive.
method getLiteralCompletionLocation
getLiteralCompletionLocation: ( strNode: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration) => TcbLocation | null;For the given node represents a
LiteralPrimitive(theTextAttributerepresents a string literal), retrieve aTcbLocationthat can be used to perform autocompletion at that point in the node, if such a location exists.
method getNgModuleMetadata
getNgModuleMetadata: (module: ts.ClassDeclaration) => NgModuleMeta | null;Retrieve the type checking engine's metadata for the given NgModule class, if available.
method getOwningNgModule
getOwningNgModule: ( component: ts.ClassDeclaration) => ts.ClassDeclaration | null;Get the class of the NgModule that owns this Angular trait. If the result is
null, that probably means the provided component is standalone.
method getPipeMetadata
getPipeMetadata: (pipe: ts.ClassDeclaration) => PipeMeta | null;Retrieve the type checking engine's metadata for the given pipe class, if available.
method getPotentialDomBindings
getPotentialDomBindings: ( tagName: string) => { attribute: string; property: string }[];Retrieve any potential DOM bindings for the given element.
This returns an array of objects which list both the attribute and property names of each binding, which are usually identical but can vary if the HTML attribute name is for example a reserved keyword in JS, like the
forattribute which corresponds to thehtmlForproperty.
method getPotentialDomEvents
getPotentialDomEvents: (tagName: string) => string[];Retrieve any potential DOM events.
method getPotentialElementTags
getPotentialElementTags: ( component: ts.ClassDeclaration, tsLs: ts.LanguageService, options: GetPotentialAngularMetaOptions) => Map<string, PotentialDirective | null>;Retrieve a
Mapof potential template element tags, to either thePotentialDirectivethat declares them (if the tag is from a directive/component), ornullif the tag originates from the DOM schema.
method getPotentialImportsFor
getPotentialImportsFor: ( toImport: Reference<ClassDeclaration>, inContext: ts.Node, importMode: PotentialImportMode, potentialDirectiveModuleSpecifierResolver?: PotentialDirectiveModuleSpecifierResolver) => ReadonlyArray<PotentialImport>;In the context of an Angular trait, generate potential imports for a directive.
method getPotentialPipes
getPotentialPipes: (component: ts.ClassDeclaration) => PotentialPipe[];Get basic metadata on the pipes which are in scope or can be imported for the given component.
method getPotentialTemplateDirectives
getPotentialTemplateDirectives: ( component: ts.ClassDeclaration, tsLs: ts.LanguageService, options: GetPotentialAngularMetaOptions) => PotentialDirective[];Get basic metadata on the directives which are in scope or can be imported for the given component.
method getPrimaryAngularDecorator
getPrimaryAngularDecorator: (target: ts.ClassDeclaration) => ts.Decorator | null;Get the primary decorator for an Angular class (such as @Component). This does not work for
@Injectable.
method getSourceMappingAtTcbLocation
getSourceMappingAtTcbLocation: ( tcbLocation: TcbLocation) => FullSourceMapping | null;Given a
shimand position within the file, returns information for mapping back to a source location.
method getSuggestionDiagnosticsForComponent
getSuggestionDiagnosticsForComponent: ( component: ts.ClassDeclaration, tsLs: ts.LanguageService) => ts.DiagnosticWithLocation[];Gets suggestion diagnostics for the given component. These diagnostics tend to proactively suggest deprecated, as opposed to diagnostics that indicate potentially incorrect runtime behavior.
This method always runs in
OptimizeFor.SingleFilemode.
method getSuggestionDiagnosticsForFile
getSuggestionDiagnosticsForFile: ( sf: ts.SourceFile, tsLs: ts.LanguageService, optimizeFor: OptimizeFor) => ts.DiagnosticWithLocation[];Gets suggestion diagnostics for the given
ts.SourceFile. These diagnostics tend to proactively suggest deprecated, as opposed to diagnostics that indicate potentially incorrect runtime behavior.
method getSymbolOfNode
getSymbolOfNode: { (node: TmplAstElement, component: ts.ClassDeclaration): ElementSymbol | null; (node: TmplAstTemplate, component: ts.ClassDeclaration): TemplateSymbol; (node: any, component: ts.ClassDeclaration): TemplateSymbol | ElementSymbol; ( node: TmplAstComponent, component: ts.ClassDeclaration ): SelectorlessComponentSymbol; ( node: TmplAstDirective, component: ts.ClassDeclaration ): SelectorlessDirectiveSymbol; (node: any, component: ts.ClassDeclaration): Symbol;};Retrieves a
Symbolfor the node in a component's template.This method can return
nullif a validSymbolcannot be determined for the node.See Also
Symbol
method getTemplate
getTemplate: ( component: ts.ClassDeclaration, optimizeFor?: OptimizeFor) => TmplAstNode[] | null;Retrieve the template in use for the given component.
method getTsSymbolOfSymbol
getTsSymbolOfSymbol: ( symbol: Symbol | BindingSymbol | ClassSymbol) => ts.Symbol | null;Translates a symbol's TCB location to its corresponding ts.Symbol using the program's type checker.
method getTypeCheckBlock
getTypeCheckBlock: (component: ts.ClassDeclaration) => ts.Node | null;Retrieve the top-level node representing the TCB for the given component.
This can return
nullif there is no TCB available for the component.This method always runs in
OptimizeFor.SingleFilemode.
method getTypeOfSymbol
getTypeOfSymbol: ( symbol: Symbol | BindingSymbol | ClassSymbol) => ts.Type | null;Translates a symbol's TCB location to its corresponding ts.Type using the program's type checker. This is used by compiler checks that need semantic type information from a positional symbol.
method getUsedDirectives
getUsedDirectives: ( component: ts.ClassDeclaration) => TypeCheckableDirectiveMeta[] | null;Gets the directives that have been used in a component's template.
method getUsedPipes
getUsedPipes: (component: ts.ClassDeclaration) => string[] | null;Gets the pipes that have been used in a component's template.
method invalidateClass
invalidateClass: (clazz: ts.ClassDeclaration) => void;Reset the
TemplateTypeChecker's state for the given class, so that it will be recomputed on the next request.
method isTrackedTypeCheckFile
isTrackedTypeCheckFile: (filePath: AbsoluteFsPath) => boolean;Returns
trueif the given file is in the record of known shims generated by the compiler,falseif we cannot find the file in the shim records.
method makeTemplateDiagnostic
makeTemplateDiagnostic: <T extends ErrorCode>( clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory, errorCode: T, message: string, relatedInformation?: { text: string; start: number; end: number; sourceFile: ts.SourceFile; }[]) => NgTemplateDiagnostic<T>;Constructs a
ts.Diagnosticfor a givenParseSourceSpanwithin a template.
interface TsCompletionEntryInfo
interface TsCompletionEntryInfo {}property tsCompletionEntryData
tsCompletionEntryData?: ts.CompletionEntryData;This data is from the tsLs completion entry, and will be used in the
ls.getCompletionEntryDetails.
property tsCompletionEntrySymbolFileName
tsCompletionEntrySymbolFileName: string;Sometimes, the location of the tsCompletionEntry symbol does not match the location of the Angular symbol.
For example, the BarComponent is declared in
bar.tsand exported from there. Thepublic_api.tsalso reexports the BarComponent frombar.ts, so thetsCompletionEntrySymbolFileNamewill bepublic_api.ts.
property tsCompletionEntrySymbolName
tsCompletionEntrySymbolName: string;Sometime the component can be exported with a different name than the class name. For example,
export {BarComponent as NewBarComponent} from './bar.component';Sometimes, the component is exported by the
NgModule.
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 TsNodeSymbolInfo
interface TsNodeSymbolInfo {}A generic representation of some node in a template.
property tcbLocation
tcbLocation: TcbLocation;The position of the most relevant part of the template node.
property tcbTypeLocation
tcbTypeLocation?: TcbLocation;The position of the expression used to determine the type.
interface TypeAliasEntry
interface TypeAliasEntry extends ConstantEntry {}Documentation entity for a type alias.
interface TypeCheckableDirectiveMeta
interface TypeCheckableDirectiveMeta extends DirectiveMeta, DirectiveTypeCheckMeta {}Extension of
DirectiveMetathat includes additional information required to type-check the usage of a particular directive.
property decorator
decorator: ts.Decorator | null;property hostDirectives
hostDirectives: HostDirectiveMeta[] | null;property imports
imports: Reference<ClassDeclaration>[] | null;property inputs
inputs: ClassPropertyMapping<InputMapping>;property isExplicitlyDeferred
isExplicitlyDeferred: boolean;property isSignal
isSignal: boolean;property isStandalone
isStandalone: boolean;property outputs
outputs: ClassPropertyMapping;property queries
queries: string[];property rawImports
rawImports: ts.Expression | null;property ref
ref: Reference<ClassDeclaration>;interface TypeCheckBlockMetadata
interface TypeCheckBlockMetadata {}Metadata required in addition to a component class in order to generate a type check block (TCB) for that component.
property boundTarget
boundTarget: BoundTarget<TypeCheckableDirectiveMeta>;Semantic information about the template of the component.
property id
id: TypeCheckId;A unique identifier for the class which gave rise to this TCB.
This can be used to map errors back to the
ts.ClassDeclarationfor the directive.
property isStandalone
isStandalone: boolean;property pipes
pipes: Map<string, PipeMeta> | null;property preserveWhitespaces
preserveWhitespaces: boolean;A boolean indicating whether the component preserves whitespaces in its template.
property schemas
schemas: SchemaMetadata[];Schemas that apply to this template.
interface TypeCheckContext
interface TypeCheckContext {}A currently pending type checking operation, into which templates for type-checking can be registered.
method addDirective
addDirective: ( ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, binder: R3TargetBinder<TypeCheckableDirectiveMeta>, schemas: SchemaMetadata[], templateContext: TemplateContext | null, hostBindingContext: HostBindingsContext | null, isStandalone: boolean) => void;Register a directive to be potentially be type-checked.
Directives registered via
addDIrectiveare available for checking, but might be skipped if checking of that class is not required. This can happen for a few reasons, including if it was previously checked and the prior results are still valid.Parameter ref
a
Referenceto the directive class which yielded this template.Parameter binder
an
R3TargetBinderwhich encapsulates the scope of this template, including all available directives.Parameter schemas
Schemas that will apply when checking the directive.
Parameter templateContext
Contextual information necessary for checking the template. Only relevant for component classes.
Parameter hostBindingContext
Contextual information necessary for checking the host bindings of a directive.
Parameter isStandalone
a boolean indicating whether the directive is standalone.
interface TypeCheckSourceResolver
interface TypeCheckSourceResolver {}Adapter interface which allows the directive type-checking diagnostics code to interpret offsets in a TCB and map them back to their original locations.
method getHostBindingsMapping
getHostBindingsMapping: (id: TypeCheckId) => SourceMapping;For the given type checking id, retrieve the source mapping of its host bindings.
method getTemplateSourceMapping
getTemplateSourceMapping: (id: TypeCheckId) => SourceMapping;For the given type checking id, retrieve the original source mapping which describes how the offsets in the template should be interpreted.
method getTypeCheckId
getTypeCheckId: (node: ts.ClassDeclaration) => TypeCheckId;method toHostParseSourceSpan
toHostParseSourceSpan: ( id: TypeCheckId, span: AbsoluteSourceSpan) => ParseSourceSpan | null;Convert an absolute source span coming from a host binding associated with the given type checking id into a full
ParseSourceSpan. The returned parse span has line and column numbers in addition to only absolute offsets and gives access to the original source code.
method toTemplateParseSourceSpan
toTemplateParseSourceSpan: ( id: TypeCheckId, span: AbsoluteSourceSpan) => ParseSourceSpan | null;Convert an absolute source span coming from the template associated with the given type checking id into a full
ParseSourceSpan. The returned parse span has line and column numbers in addition to only absolute offsets and gives access to the original source code.
interface VariableCompletion
interface VariableCompletion {}An autocompletion result representing a variable declared in the template.
interface VariableIdentifier
interface VariableIdentifier extends TemplateIdentifier {}Describes a template variable like "foo" in
<div *ngFor="let foo of foos"></div>.
property kind
kind: IdentifierKind.Variable;interface VariableSymbol
interface VariableSymbol {}A representation of a context variable in a component template.
property declaration
declaration: TmplAstVariable;The node in the
TemplateAstwhere the variable is declared. That is, the node for thelet-node in the template.
property initializerLocation
initializerLocation: TcbLocation;The location in the shim file for the initializer node of the variable that represents the template variable.
property kind
kind: SymbolKind.Variable;property localVarLocation
localVarLocation: TcbLocation;The location in the shim file for the identifier that was declared for the template variable.
Enums
enum CompletionKind
enum CompletionKind { Reference = 0, Variable = 1, LetDeclaration = 2,}Discriminant of an autocompletion source (a
Completion).
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', Namespace = 'namespace',}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 Namespace
Namespace = 'namespace'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, DUPLICATE_DECORATED_PROPERTIES = 1012, INITIALIZER_API_WITH_DISALLOWED_DECORATOR = 1050, INITIALIZER_API_DECORATOR_METADATA_COLLISION = 1051, INITIALIZER_API_NO_REQUIRED_FUNCTION = 1052, INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY = 1053, DUPLICATE_BINDING_NAME = 1054, 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, MISSING_NAMED_TEMPLATE_DEPENDENCY = 2024, INCORRECT_NAMED_TEMPLATE_DEPENDENCY_TYPE = 2025, UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD = 2026, COMPONENT_ANIMATIONS_CONFLICT = 2027, SERVICE_CONSTRUCTOR_DI = 2028, 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, CONFIG_EMIT_DECLARATION_ONLY_UNSUPPORTED = 4006, 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, UNCLAIMED_DIRECTIVE_BINDING = 8018, DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER = 8019, DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER = 8020, DEFER_TRIGGER_MISCONFIGURATION = 8021, FORM_FIELD_UNSUPPORTED_BINDING = 8022, MULTIPLE_MATCHING_COMPONENTS = 8023, CONFLICTING_HOST_DIRECTIVE_BINDING = -8024, 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, UNPARENTHESIZED_NULLISH_COALESCING = 8114, UNINVOKED_TRACK_FUNCTION = 8115, MISSING_STRUCTURAL_DIRECTIVE = 8116, UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION = 8117, FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION = 8118, 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_ANIMATIONS_CONFLICT
COMPONENT_ANIMATIONS_CONFLICT = 2027A component is using both the
animationsproperty andanimate.enteroranimate.leavein the template.
member COMPONENT_IMPORT_NOT_STANDALONE
COMPONENT_IMPORT_NOT_STANDALONE = 2011Raised when a type in the
importsof a component is a directive or pipe, but is not standalone.
member COMPONENT_INVALID_SHADOW_DOM_SELECTOR
COMPONENT_INVALID_SHADOW_DOM_SELECTOR = 2009Raised when a component uses
ShadowDomview encapsulation, but its selector does not match the shadow DOM tag name requirements.
member COMPONENT_INVALID_STYLE_URLS
COMPONENT_INVALID_STYLE_URLS = 2021Raised when a component has both
styleUrlsandstyleUrl.
member COMPONENT_MISSING_TEMPLATE
COMPONENT_MISSING_TEMPLATE = 2001member COMPONENT_NOT_STANDALONE
COMPONENT_NOT_STANDALONE = 2010Raised when a component has
importsbut is not marked asstandalone: true.
member COMPONENT_RESOURCE_NOT_FOUND
COMPONENT_RESOURCE_NOT_FOUND = 2008Raised 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 = 2022Raised when a type in the
deferredImportsof a component is not a component, directive or pipe.
member COMPONENT_UNKNOWN_IMPORT
COMPONENT_UNKNOWN_IMPORT = 2012Raised when a type in the
importsof a component is not a directive, pipe, or NgModule.
member CONFIG_EMIT_DECLARATION_ONLY_UNSUPPORTED
CONFIG_EMIT_DECLARATION_ONLY_UNSUPPORTED = 4006member CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES
CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES = 4003member CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL
CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL = 4004member CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK
CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK = 4005member CONFIG_FLAT_MODULE_NO_INDEX
CONFIG_FLAT_MODULE_NO_INDEX = 4001member CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK
CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK = 4002member CONFLICTING_HOST_DIRECTIVE_BINDING
CONFLICTING_HOST_DIRECTIVE_BINDING = -8024Raised when a host directive input/output is exposed multiple times under the same name.
member CONFLICTING_INPUT_TRANSFORM
CONFLICTING_INPUT_TRANSFORM = 2020Raised when a component specifies both a
transformfunction on an input and has a correspondingngAcceptInputType_member for the same input.
member CONFLICTING_LET_DECLARATION
CONFLICTING_LET_DECLARATION = 8017A
@letdeclaration conflicts with another symbol in the same scope.
member CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION
CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = 8011A 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 = 1001member DECORATOR_ARITY_WRONG
DECORATOR_ARITY_WRONG = 1002member DECORATOR_COLLISION
DECORATOR_COLLISION = 1006This error code indicates that there are incompatible decorators on a type or a class field.
member DECORATOR_NOT_CALLED
DECORATOR_NOT_CALLED = 1003member DECORATOR_UNEXPECTED
DECORATOR_UNEXPECTED = 1005member DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER
DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER = 8020The
@placeholderfor an implicit@defertrigger is not set up correctly, for example:@defer(on viewport) {Hello} @placeholder {<!-- Multiple root nodes. --><button></button><div></div>}
member DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER
DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER = 8019An
@deferblock with an implicit trigger does not have a placeholder, for example:@defer(on viewport) {Hello}
member DEFER_TRIGGER_MISCONFIGURATION
DEFER_TRIGGER_MISCONFIGURATION = 8021Raised when an
@deferblock defines unreachable or redundant triggers. Examples: multiple main triggers, 'on immediate' together with other mains or any prefetch, prefetch timer delay that is not earlier than the main timer, or an identical prefetch
member DEFERRED_DEPENDENCY_IMPORTED_EAGERLY
DEFERRED_DEPENDENCY_IMPORTED_EAGERLY = 8014A directive/component/pipe imported via
@Component.deferredImportsis also included into the@Component.importslist.
member DEFERRED_DIRECTIVE_USED_EAGERLY
DEFERRED_DIRECTIVE_USED_EAGERLY = 8013A directive/component imported via
@Component.deferredImportsis used outside of a@deferblock in a template.
member DEFERRED_PIPE_USED_EAGERLY
DEFERRED_PIPE_USED_EAGERLY = 8012A pipe imported via
@Component.deferredImportsis used outside of a@deferblock in a template.
member DIRECTIVE_INHERITS_UNDECORATED_CTOR
DIRECTIVE_INHERITS_UNDECORATED_CTOR = 2006Raised when a Directive inherits its constructor from a base class without an Angular decorator.
member DIRECTIVE_MISSING_SELECTOR
DIRECTIVE_MISSING_SELECTOR = 2004member DUPLICATE_BINDING_NAME
DUPLICATE_BINDING_NAME = 1054Raised whenever there are duplicate binding property names for outputs, inputs & models.
member DUPLICATE_DECORATED_PROPERTIES
DUPLICATE_DECORATED_PROPERTIES = 1012member DUPLICATE_VARIABLE_DECLARATION
DUPLICATE_VARIABLE_DECLARATION = 8006A template variable was declared twice. For example:
<div *ngFor="let i of items; let i = index"></div>
member FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION
FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION = 8118A required initializer is being invoked in a forbidden context such as a property initializer or a constructor.
For example: ```ts class MyComponent { myInput = input.required(); somValue = this.myInput(); // Error
constructor() { this.myInput(); // Error }
member FORM_FIELD_UNSUPPORTED_BINDING
FORM_FIELD_UNSUPPORTED_BINDING = 8022Raised when the user has an unsupported binding on a
FormFielddirective.
member HOST_BINDING_PARSE_ERROR
HOST_BINDING_PARSE_ERROR = 5001Raised 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 = 2015Raised when a host directive is a component.
member HOST_DIRECTIVE_CONFLICTING_ALIAS
HOST_DIRECTIVE_CONFLICTING_ALIAS = 2018Raised 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 = 2013Raised 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 = 2019Raised when a host directive definition doesn't expose a required binding from the host directive.
member HOST_DIRECTIVE_NOT_STANDALONE
HOST_DIRECTIVE_NOT_STANDALONE = 2014Raised when a host directive isn't standalone.
member HOST_DIRECTIVE_UNDEFINED_BINDING
HOST_DIRECTIVE_UNDEFINED_BINDING = 2017Raised 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 = 8009The tracking expression of a
forloop 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 = 8015An expression is trying to write to an
@letdeclaration.
member IMPORT_CYCLE_DETECTED
IMPORT_CYCLE_DETECTED = 3003Raised 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 = 3004Raised when the compiler is unable to generate an import statement for a reference.
member INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT
INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT = 8010The trigger of a
deferblock 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 INCORRECT_NAMED_TEMPLATE_DEPENDENCY_TYPE
INCORRECT_NAMED_TEMPLATE_DEPENDENCY_TYPE = 2025Raised if an incorrect type is used for a named template dependency (e.g. directive class used as a component).
member INCORRECTLY_DECLARED_ON_STATIC_MEMBER
INCORRECTLY_DECLARED_ON_STATIC_MEMBER = 1100An 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 = 1051Raised 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
@Directiveinputsarray.
member INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY
INITIALIZER_API_DISALLOWED_MEMBER_VISIBILITY = 1053Raised 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 = 1052Raised whenever an initializer API does not support the
.requiredfunction, but is still detected unexpectedly.
member INITIALIZER_API_WITH_DISALLOWED_DECORATOR
INITIALIZER_API_WITH_DISALLOWED_DECORATOR = 1050Raised when an initializer API is annotated with an unexpected decorator.
e.g.
@Inputis also applied on the class member usinginput.
member INJECTABLE_DUPLICATE_PROV
INJECTABLE_DUPLICATE_PROV = 9001An injectable already has a
ɵprovproperty.
member INJECTABLE_INHERITS_INVALID_CONSTRUCTOR
INJECTABLE_INHERITS_INVALID_CONSTRUCTOR = 2016Raised 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 = 8900The 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 = 8901The 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 = 8109Signal functions should be invoked when interpolated in templates.
For example:
{{ mySignal() }}
member INVALID_BANANA_IN_BOX
INVALID_BANANA_IN_BOX = 8101A 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 = 8016An expression is trying to read an
@letbefore it has been defined.
member LOCAL_COMPILATION_UNRESOLVED_CONST
LOCAL_COMPILATION_UNRESOLVED_CONST = 11001In 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 = 11003In 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 = 8103A known control flow directive (e.g.
*ngIf) is used in a template, but theCommonModuleis not imported.
member MISSING_NAMED_TEMPLATE_DEPENDENCY
MISSING_NAMED_TEMPLATE_DEPENDENCY = 2024Raised when a named template dependency isn't defined in the component's source file.
member MISSING_NGFOROF_LET
MISSING_NGFOROF_LET = 8105NgForOf 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 = 8004No matching pipe was found for a
member MISSING_REFERENCE_TARGET
MISSING_REFERENCE_TARGET = 8003No matching directive was found for a
#ref="target"expression.
member MISSING_REQUIRED_INPUTS
MISSING_REQUIRED_INPUTS = 8008A directive usage isn't binding to one or more required inputs.
member MISSING_STRUCTURAL_DIRECTIVE
MISSING_STRUCTURAL_DIRECTIVE = 8116A structural directive is used in a template, but the directive is not imported.
member MULTIPLE_MATCHING_COMPONENTS
MULTIPLE_MATCHING_COMPONENTS = 8023Raised when multiple components in the compilation scope match a given element in a template.
member NGMODULE_BOOTSTRAP_IS_STANDALONE
NGMODULE_BOOTSTRAP_IS_STANDALONE = 6009Raised when a standalone component is part of the bootstrap list of an NgModule.
member NGMODULE_DECLARATION_IS_STANDALONE
NGMODULE_DECLARATION_IS_STANDALONE = 6008Raised when a standalone directive/pipe is part of the declarations of an NgModule.
member NGMODULE_DECLARATION_NOT_UNIQUE
NGMODULE_DECLARATION_NOT_UNIQUE = 6007Raised when a directive/pipe is part of the declarations of two or more NgModules.
member NGMODULE_INVALID_DECLARATION
NGMODULE_INVALID_DECLARATION = 6001Raised when an NgModule contains an invalid reference in
declarations.
member NGMODULE_INVALID_EXPORT
NGMODULE_INVALID_EXPORT = 6003Raised when an NgModule contains an invalid type in
exports.
member NGMODULE_INVALID_IMPORT
NGMODULE_INVALID_IMPORT = 6002Raised when an NgModule contains an invalid type in
imports.
member NGMODULE_INVALID_REEXPORT
NGMODULE_INVALID_REEXPORT = 6004Raised when an NgModule contains a type in
exportswhich is neither indeclarationsnor otherwise imported.
member NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC
NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC = 6005Raised when a
ModuleWithProviderswith a missing generic type argument is passed into anNgModule.
member NGMODULE_REEXPORT_NAME_COLLISION
NGMODULE_REEXPORT_NAME_COLLISION = 6006Raised 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 = 2023Raised when a
standalone: falsecomponent is declared butstrictStandaloneis set.
member NULLISH_COALESCING_NOT_NULLABLE
NULLISH_COALESCING_NOT_NULLABLE = 8102The left side of a nullish coalescing operation is not nullable.
{{ foo ?? bar }}When the type of foo doesn't include
nullorundefined.
member OPTIONAL_CHAIN_NOT_NULLABLE
OPTIONAL_CHAIN_NOT_NULLABLE = 8107The left side of an optional chain operation is not nullable.
{{ foo?.bar }}{{ foo?.['bar'] }}{{ foo?.() }}When the type of foo doesn't include
nullorundefined.
member PARAM_MISSING_TOKEN
PARAM_MISSING_TOKEN = 2003member PIPE_MISSING_NAME
PIPE_MISSING_NAME = 2002member SCHEMA_INVALID_ATTRIBUTE
SCHEMA_INVALID_ATTRIBUTE = 8002An element's attribute name failed validation against the DOM schema.
member SCHEMA_INVALID_ELEMENT
SCHEMA_INVALID_ELEMENT = 8001An element name failed validation against the DOM schema.
member SERVICE_CONSTRUCTOR_DI
SERVICE_CONSTRUCTOR_DI = 2028Raised when an
@Serviceclass is using constructor dependency injection.
member SKIP_HYDRATION_NOT_STATIC
SKIP_HYDRATION_NOT_STATIC = 8108ngSkipHydrationshould not be a binding (it should be a static attribute).For example:
<my-cmp [ngSkipHydration]="someTruthyVar" />ngSkipHydrationcannot be a binding and can not have values other than "true" or an empty value
member SPLIT_TWO_WAY_BINDING
SPLIT_TWO_WAY_BINDING = 8007A 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 = 8106Indicates 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 = 10001Suggest users to enable
strictTemplatesto make use of full capabilities provided by Angular language service.
member SUGGEST_SUBOPTIMAL_TYPE_INFERENCE
SUGGEST_SUBOPTIMAL_TYPE_INFERENCE = 10002Indicates 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 = 3001member TEMPLATE_PARSE_ERROR
TEMPLATE_PARSE_ERROR = 5002Raised when the compiler cannot parse a component's template.
member TEXT_ATTRIBUTE_NOT_BINDING
TEXT_ATTRIBUTE_NOT_BINDING = 8104A 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 UNCLAIMED_DIRECTIVE_BINDING
UNCLAIMED_DIRECTIVE_BINDING = 8018A binding inside selectorless directive syntax did not match any inputs/outputs of the directive.
member UNDECORATED_CLASS_USING_ANGULAR_FEATURES
UNDECORATED_CLASS_USING_ANGULAR_FEATURES = 2007Raised when an undecorated class that is using Angular features has been discovered.
member UNDECORATED_PROVIDER
UNDECORATED_PROVIDER = 2005Raised 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 = 8111A function in an event binding is not called.
For example:
<button (click)="myFunc"></button>This will not call
myFuncwhen the button is clicked. Instead, it should be<button (click)="myFunc()"></button>.
member UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION
UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION = 8117A function in a text interpolation is not invoked.
For example:
<p> {{ firstName }} </p>The
firstNamefunction is not invoked. Instead, it should be:<p> {{ firstName() }} </p>
member UNINVOKED_TRACK_FUNCTION
UNINVOKED_TRACK_FUNCTION = 8115The function passed to
@fortrack is not invoked.For example:
@for (item of items; track trackByName) {}For the track function to work properly, it must be invoked.
For example:
@for (item of items; track trackByName(item)) {}
member UNPARENTHESIZED_NULLISH_COALESCING
UNPARENTHESIZED_NULLISH_COALESCING = 8114An expression mixes nullish coalescing and logical and/or without parentheses.
member UNSUPPORTED_INITIALIZER_API_USAGE
UNSUPPORTED_INITIALIZER_API_USAGE = 8110Initializer-based APIs can only be invoked from inside of an initializer.
// AllowedmyInput = input();// Not allowedfunction myInput() {return input();}
member UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD
UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD = 2026Raised for
@Componentfields that aren't supported in a selectorless context.
member UNUSED_LET_DECLARATION
UNUSED_LET_DECLARATION = 8112A
@letdeclaration 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 = 8113A symbol referenced in
@Component.importsisn't being used within the template.
member VALUE_HAS_WRONG_TYPE
VALUE_HAS_WRONG_TYPE = 1010member VALUE_NOT_LITERAL
VALUE_NOT_LITERAL = 1011member WARN_NGMODULE_ID_UNNECESSARY
WARN_NGMODULE_ID_UNNECESSARY = 6100Indicates 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 = 8005The 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 IdentifierKind
enum IdentifierKind { Property = 0, Method = 1, Element = 2, Template = 3, Attribute = 4, Reference = 5, Variable = 6, LetDeclaration = 7, Component = 8, Directive = 9,}Describes the kind of identifier found in a template.
enum InliningMode
enum InliningMode { InlineOps = 0, Error = 1, CopySourceToTcb = 2,}How a type-checking context should handle operations which would require inlining.
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', Interface = 'interface', TypeAlias = 'type_alias',}Types of class members
enum MetaKind
enum MetaKind { Directive = 0, Pipe = 1, NgModule = 2,}Disambiguates different kinds of compiler metadata objects.
enum OptimizeFor
enum OptimizeFor { SingleFile = 0, WholeProgram = 1,}Describes the scope of the caller's interest in template type-checking results.
member SingleFile
SingleFile = 0Indicates that a consumer of a
TemplateTypeCheckeris only interested in results for a given file, and wants them as fast as possible.Calling
TemplateTypeCheckermethods successively for multiple files while specifyingOptimizeFor.SingleFilecan result in significant unnecessary overhead overall.
member WholeProgram
WholeProgram = 1Indicates that a consumer of a
TemplateTypeCheckerintends 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.
enum PerfPhase
enum PerfPhase { Unaccounted = 0, Setup = 1, TypeScriptProgramCreate = 2, Reconciliation = 3, ResourceUpdate = 4, TypeScriptDiagnostics = 5, Analysis = 6, Resolve = 7, CycleDetection = 8, TcbGeneration = 9, TcbUpdateProgram = 10, TypeScriptEmit = 11, Compile = 12, TtcAutocompletion = 13, TtcDiagnostics = 14, TtcSuggestionDiagnostics = 15, TtcSymbol = 16, LsReferencesAndRenames = 17, LsQuickInfo = 18, LsDefinition = 19, LsCompletions = 20, LsTcb = 21, LsDiagnostics = 22, LsSuggestionDiagnostics = 23, LsComponentLocations = 24, LsSignatureHelp = 25, OutliningSpans = 26, LsCodeFixes = 27, LsCodeFixesAll = 28, LSComputeApplicableRefactorings = 29, LSApplyRefactoring = 30, LSSemanticClassification = 31, LAST = 32,}A phase of compilation for which time is tracked in a distinct bucket.
member Analysis
Analysis = 6Time spent in Angular analysis of individual classes in the program.
member Compile
Compile = 12Time spent by Angular performing code transformations of ASTs as they're about to be emitted.
This includes the actual code generation step for templates, and occurs during the emit phase (but is tracked separately from
TypeScriptEmittime).
member CycleDetection
CycleDetection = 8Time spent building the import graph of the program in order to perform cycle detection.
member LAST
LAST = 32Tracks the number of
PerfPhases, and must appear at the end of the list.
member LSApplyRefactoring
LSApplyRefactoring = 30Time spent computing changes for applying a given refactoring.
member LsCodeFixes
LsCodeFixes = 27Time spent by the Angular Language Service calculating code fixes.
member LsCodeFixesAll
LsCodeFixesAll = 28Time spent by the Angular Language Service to fix all detected same type errors.
member LsCompletions
LsCompletions = 20Time spent by the Angular Language Service calculating a "get completions" (AKA autocomplete) operation.
member LsComponentLocations
LsComponentLocations = 24Time spent by the Angular Language Service calculating a "get component locations for template" operation.
member LSComputeApplicableRefactorings
LSComputeApplicableRefactorings = 29Time spent computing possible Angular refactorings.
member LsDefinition
LsDefinition = 19Time spent by the Angular Language Service calculating a "get type definition" or "get definition" operation.
member LsDiagnostics
LsDiagnostics = 22Time spent by the Angular Language Service calculating diagnostics.
member LsQuickInfo
LsQuickInfo = 18Time spent by the Angular Language Service calculating a "quick info" operation.
member LsReferencesAndRenames
LsReferencesAndRenames = 17Time spent by the Angular Language Service calculating a "get references" or a renaming operation.
member LSSemanticClassification
LSSemanticClassification = 31Time spent by the Angular Language Service calculating semantic classifications.
member LsSignatureHelp
LsSignatureHelp = 25Time spent by the Angular Language Service calculating signature help.
member LsSuggestionDiagnostics
LsSuggestionDiagnostics = 23Time spent by the Angular Language Service calculating suggestion diagnostics.
member LsTcb
LsTcb = 21Time spent by the Angular Language Service calculating a "view template typecheck block" operation.
member OutliningSpans
OutliningSpans = 26Time spent by the Angular Language Service calculating outlining spans.
member Reconciliation
Reconciliation = 3Time spent reconciling the contents of an old
ts.Programwith the new incremental one.Only present in incremental compilations.
member Resolve
Resolve = 7Time spent in Angular global analysis (synthesis of analysis information into a complete understanding of the program).
member ResourceUpdate
ResourceUpdate = 4Time spent updating an
NgCompilerinstance with a resource-only change.Only present in incremental compilations where the change was resource-only.
member Setup
Setup = 1Time spent setting up the compiler, before a TypeScript program is created.
This includes operations like configuring the
ts.CompilerHostand any wrappers.
member TcbGeneration
TcbGeneration = 9Time spent generating the text of Type Check Blocks in order to perform template type checking.
member TcbUpdateProgram
TcbUpdateProgram = 10Time spent updating the
ts.Programwith new Type Check Block code.
member TtcAutocompletion
TtcAutocompletion = 13Time spent performing a
TemplateTypeCheckerautocompletion operation.
member TtcDiagnostics
TtcDiagnostics = 14Time spent computing template type-checking diagnostics.
member TtcSuggestionDiagnostics
TtcSuggestionDiagnostics = 15Time spent computing template type-checking suggestion diagnostics.
member TtcSymbol
TtcSymbol = 16Time spent getting a
Symbolfrom theTemplateTypeChecker.
member TypeScriptDiagnostics
TypeScriptDiagnostics = 5Time spent calculating the plain TypeScript diagnostics (structural and semantic).
member TypeScriptEmit
TypeScriptEmit = 11Time spent by TypeScript performing its emit operations, including downleveling and writing output files.
member TypeScriptProgramCreate
TypeScriptProgramCreate = 2Time spent in
ts.createProgram, including reading and parsingts.SourceFiles in thets.CompilerHost.This might be an incremental program creation operation.
member Unaccounted
Unaccounted = 0The "default" phase which tracks time not spent in any other phase.
enum PotentialImportKind
enum PotentialImportKind { NgModule = 0, Standalone = 1,}Which kind of Angular Trait the import targets.
member NgModule
NgModule = 0member Standalone
Standalone = 1enum PotentialImportMode
enum PotentialImportMode { Normal = 0, ForceDirect = 1,}Possible modes in which to look up a potential import.
member ForceDirect
ForceDirect = 1An import is assumed to be standalone and is imported directly. This is useful for migrations where a declaration wasn't standalone when the program was created, but will become standalone as a part of the migration.
member Normal
Normal = 0Whether an import is standalone is inferred based on its metadata.
enum SymbolKind
enum SymbolKind { Input = 0, Output = 1, Binding = 2, Reference = 3, Variable = 4, Directive = 5, Element = 6, Template = 7, Expression = 8, DomBinding = 9, Pipe = 10, LetDeclaration = 11, SelectorlessComponent = 12, SelectorlessDirective = 13,}member Binding
Binding = 2member Directive
Directive = 5member DomBinding
DomBinding = 9member Element
Element = 6member Expression
Expression = 8member Input
Input = 0member LetDeclaration
LetDeclaration = 11member Output
Output = 1member Pipe
Pipe = 10member Reference
Reference = 3member SelectorlessComponent
SelectorlessComponent = 12member SelectorlessDirective
SelectorlessDirective = 13member Template
Template = 7member Variable
Variable = 4Type Aliases
type AbsoluteFsPath
type AbsoluteFsPath = BrandedPath<'AbsoluteFsPath'>;A fully qualified path in the file system, in POSIX form.
type ClassDeclaration
type ClassDeclaration<T extends DeclarationNode = DeclarationNode> = T & { name: ts.Identifier;};The
ts.Declarationof a "class".Classes are represented differently in different code formats: - In TS code, they are typically defined using the
classkeyword. - In ES2015 code, they are usually defined using theclasskeyword, but they can also be variable declarations, which are initialized to a class expression (e.g.let Foo = Foo1 = class Foo {}). - In ES5 code, they are typically defined as variable declarations being assigned the return value of an IIFE. The actual "class" is implemented as a constructor function inside the IIFE, but the outer variable declaration represents the "class" to the rest of the program.For
ReflectionHostpurposes, a class declaration should always have anameidentifier, because we need to be able to reference it in other parts of the program.
type CompilationTicket
type CompilationTicket = | FreshCompilationTicket | IncrementalTypeScriptCompilationTicket | IncrementalResourceCompilationTicket;A request to begin Angular compilation, either starting from scratch or from a known prior state.
CompilationTickets are used to initialize (or update) anNgCompilerinstance, the core of the Angular compiler. They abstract the starting state of compilation and allowNgCompilerto be managed independently of any incremental compilation lifecycle.
type Completion
type Completion = | ReferenceCompletion | VariableCompletion | LetDeclarationCompletion;An autocompletion source of any kind.
type ConfigurationHost
type ConfigurationHost = Pick< ReadonlyFileSystem, | 'readFile' | 'exists' | 'lstat' | 'resolve' | 'join' | 'dirname' | 'extname' | 'pwd' | 'readdir'>;Used to read configuration files.
type DeclarationNode
type DeclarationNode = ts.Declaration;A type that is used to identify a declaration.
type DirectiveHostIdentifier
type DirectiveHostIdentifier<T = DeclarationNode> = | ElementIdentifier<T> | TemplateNodeIdentifier<T> | ComponentNodeIdentifier<T> | DirectiveNodeIdentifier<T>;Identifiers that can bring in directives to the template.
type DirectiveSymbol
type DirectiveSymbol = | (DirectiveSymbolBase & { matchSource: MatchSource.Selector; }) | (DirectiveSymbolBase & { matchSource: MatchSource.HostDirective; exposedInputs: Record<string, string> | null; exposedOutputs: Record<string, string> | null; });A representation of a directive/component whose selector matches a node in a component template.
type FunctionEntry
type FunctionEntry = FunctionDefinitionEntry & DocEntry & { implementation: FunctionSignatureMetadata; };type InputMapping
type InputMapping = InputOrOutput & { required: boolean; /** * Transform for the input. Null if no transform is configured. * * For signal-based inputs, this is always `null` even if a transform * is configured. Signal inputs capture their transform write type * automatically in the `InputSignal`, nor is there a need to emit a * reference to the transform. * * For zone-based decorator `@Input`s this is different because the transform * write type needs to be captured in a coercion member as the decorator information * is lost in the `.d.ts` for type-checking. */ transform: DecoratorInputTransform | null;};Metadata for a single input mapping.
type InterfaceMemberEntry
type InterfaceMemberEntry = MemberEntry & InterfaceEntry;Sub-entry for an interface (included via namespace).
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 NgTemplateDiagnostic
type NgTemplateDiagnostic<T extends ErrorCode> = TemplateDiagnostic & { __ngCode: T;};A
TemplateDiagnosticwith a specific error code.
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;type SourceMapping
type SourceMapping = | DirectSourceMapping | IndirectSourceMapping | ExternalTemplateSourceMapping;type Symbol
type Symbol = | InputBindingSymbol | OutputBindingSymbol | ElementSymbol | ReferenceSymbol | VariableSymbol | ExpressionSymbol | DirectiveSymbol | TemplateSymbol | DomBindingSymbol | PipeSymbol | LetDeclarationSymbol | SelectorlessComponentSymbol | SelectorlessDirectiveSymbol;A representation of an entity in the
TemplateAst.
type TemplateDeclarationSymbol
type TemplateDeclarationSymbol = ReferenceSymbol | VariableSymbol;A
Symbolwhich declares a new named entity in the template scope.
type TopLevelIdentifier
type TopLevelIdentifier<T = DeclarationNode> = | PropertyIdentifier<T> | ElementIdentifier<T> | TemplateNodeIdentifier<T> | ReferenceIdentifier<T> | VariableIdentifier | MethodIdentifier<T> | LetDeclarationIdentifier | ComponentNodeIdentifier<T> | DirectiveNodeIdentifier<T>;Identifiers recorded at the top level of the template, without any context about the HTML nodes they were discovered in.
type TypeAliasMemberEntry
type TypeAliasMemberEntry = MemberEntry & TypeAliasEntry;Sub-entry for a type alias (included via namespace).
Package Files (55)
- index.d.ts
- private/tooling.d.ts
- src/ngtsc/annotations/common/src/util.d.ts
- src/ngtsc/core/api/src/adapter.d.ts
- src/ngtsc/core/api/src/options.d.ts
- src/ngtsc/core/src/compiler.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/invalid_file_system.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/imports/src/emitter.d.ts
- src/ngtsc/imports/src/references.d.ts
- src/ngtsc/incremental/src/strategy.d.ts
- src/ngtsc/indexer/src/api.d.ts
- src/ngtsc/logging/src/console_logger.d.ts
- src/ngtsc/logging/src/logger.d.ts
- src/ngtsc/metadata/src/api.d.ts
- src/ngtsc/metadata/src/resource_registry.d.ts
- src/ngtsc/perf/src/api.d.ts
- src/ngtsc/program.d.ts
- src/ngtsc/program_driver/src/api.d.ts
- src/ngtsc/reflection/src/host.d.ts
- src/ngtsc/reflection/src/util.d.ts
- src/ngtsc/shims/src/expando.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/translator/src/import_manager/import_manager.d.ts
- src/ngtsc/tsc_plugin.d.ts
- src/ngtsc/typecheck/api/api.d.ts
- src/ngtsc/typecheck/api/checker.d.ts
- src/ngtsc/typecheck/api/completion.d.ts
- src/ngtsc/typecheck/api/context.d.ts
- src/ngtsc/typecheck/api/scope.d.ts
- src/ngtsc/typecheck/api/symbols.d.ts
- src/ngtsc/typecheck/src/comments.d.ts
- src/ngtsc/typecheck/src/dom.d.ts
- src/ngtsc/typecheck/src/environment.d.ts
- src/ngtsc/typecheck/src/tcb_util.d.ts
- src/ngtsc/typecheck/src/template_symbol_builder.d.ts
- src/ngtsc/util/src/typescript.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 (2)
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[](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 10982 ms. - Missing or incorrect documentation? Open an issue for this package.
