2017-01-27 20:39:48 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @module
|
|
|
|
* @description
|
|
|
|
* Entry point for all APIs of the compiler package.
|
|
|
|
*
|
|
|
|
* <div class="callout is-critical">
|
|
|
|
* <header>Unstable APIs</header>
|
|
|
|
* <p>
|
|
|
|
* All compiler apis are currently considered experimental and private!
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* We expect the APIs in this package to keep on changing. Do not rely on them.
|
|
|
|
* </p>
|
|
|
|
* </div>
|
|
|
|
*/
|
2017-08-16 12:00:03 -04:00
|
|
|
|
|
|
|
import * as core from './core';
|
|
|
|
|
|
|
|
export {core};
|
|
|
|
|
|
|
|
export * from './version';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './template_parser/template_ast';
|
2017-07-28 09:58:28 -04:00
|
|
|
export {CompilerConfig, preserveWhitespacesDefault} from './config';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './compile_metadata';
|
|
|
|
export * from './aot/compiler_factory';
|
|
|
|
export * from './aot/compiler';
|
2017-03-14 12:16:15 -04:00
|
|
|
export * from './aot/generated_file';
|
2017-02-19 00:28:27 -05:00
|
|
|
export * from './aot/compiler_options';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './aot/compiler_host';
|
2017-11-14 20:49:47 -05:00
|
|
|
export * from './aot/formatted_error';
|
2017-11-20 13:21:17 -05:00
|
|
|
export * from './aot/partial_module';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './aot/static_reflector';
|
|
|
|
export * from './aot/static_symbol';
|
|
|
|
export * from './aot/static_symbol_resolver';
|
|
|
|
export * from './aot/summary_resolver';
|
2017-10-23 20:51:19 -04:00
|
|
|
export {isLoweredSymbol, createLoweredSymbol} from './aot/util';
|
2017-10-20 12:46:41 -04:00
|
|
|
export {LazyRoute} from './aot/lazy_routes';
|
2017-05-09 19:16:50 -04:00
|
|
|
export * from './ast_path';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './summary_resolver';
|
2017-08-16 12:00:03 -04:00
|
|
|
export {Identifiers} from './identifiers';
|
2017-01-27 20:39:48 -05:00
|
|
|
export {JitCompiler} from './jit/compiler';
|
2017-05-18 16:46:51 -04:00
|
|
|
export * from './compile_reflector';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './url_resolver';
|
|
|
|
export * from './resource_loader';
|
2018-05-09 11:35:25 -04:00
|
|
|
export {ConstantPool} from './constant_pool';
|
2017-01-27 20:39:48 -05:00
|
|
|
export {DirectiveResolver} from './directive_resolver';
|
|
|
|
export {PipeResolver} from './pipe_resolver';
|
|
|
|
export {NgModuleResolver} from './ng_module_resolver';
|
|
|
|
export {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './ml_parser/interpolation_config';
|
|
|
|
export * from './schema/element_schema_registry';
|
|
|
|
export * from './i18n/index';
|
|
|
|
export * from './directive_normalizer';
|
|
|
|
export * from './expression_parser/ast';
|
|
|
|
export * from './expression_parser/lexer';
|
|
|
|
export * from './expression_parser/parser';
|
|
|
|
export * from './metadata_resolver';
|
|
|
|
export * from './ml_parser/ast';
|
|
|
|
export * from './ml_parser/html_parser';
|
|
|
|
export * from './ml_parser/html_tags';
|
|
|
|
export * from './ml_parser/interpolation_config';
|
|
|
|
export * from './ml_parser/tags';
|
|
|
|
export {NgModuleCompiler} from './ng_module_compiler';
|
fix(ivy): use 'typeof' and 'never' for type metadata (#24862)
Previously ngtsc would use a tuple of class types for listing metadata
in .d.ts files. For example, an @NgModule's declarations might be
represented with the type:
[NgIf, NgForOf, NgClass]
If the module had no declarations, an empty tuple [] would be produced.
This has two problems.
1. If the class type has generic type parameters, TypeScript will
complain that they're not provided.
2. The empty tuple type is not actually legal.
This commit addresses both problems.
1. Class types are now represented using the `typeof` operator, so the
above declarations would be represented as:
[typeof NgIf, typeof NgForOf, typeof NgClass].
Since typeof operates on a value, it doesn't require generic type
arguments.
2. Instead of an empty tuple, `never` is used to indicate no metadata.
PR Close #24862
2018-07-17 16:34:20 -04:00
|
|
|
export {ArrayType, AssertNotNull, BinaryOperator, BinaryOperatorExpr, BuiltinMethod, BuiltinType, BuiltinTypeName, BuiltinVar, CastExpr, ClassField, ClassMethod, ClassStmt, CommaExpr, CommentStmt, ConditionalExpr, DeclareFunctionStmt, DeclareVarStmt, Expression, ExpressionStatement, ExpressionType, ExpressionVisitor, ExternalExpr, ExternalReference, FunctionExpr, IfStmt, InstantiateExpr, InvokeFunctionExpr, InvokeMethodExpr, JSDocCommentStmt, LiteralArrayExpr, LiteralExpr, LiteralMapExpr, MapType, NotExpr, ReadKeyExpr, ReadPropExpr, ReadVarExpr, ReturnStatement, StatementVisitor, ThrowStmt, TryCatchStmt, Type, TypeVisitor, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, StmtModifier, Statement, TypeofExpr, collectExternalReferences} from './output/output_ast';
|
2017-06-01 13:13:50 -04:00
|
|
|
export {EmitterVisitorContext} from './output/abstract_emitter';
|
2017-01-27 20:39:48 -05:00
|
|
|
export * from './output/ts_emitter';
|
|
|
|
export * from './parse_util';
|
|
|
|
export * from './schema/dom_element_schema_registry';
|
|
|
|
export * from './selector';
|
|
|
|
export * from './style_compiler';
|
|
|
|
export * from './template_parser/template_parser';
|
|
|
|
export {ViewCompiler} from './view_compiler/view_compiler';
|
2017-08-16 12:00:03 -04:00
|
|
|
export {getParseErrors, isSyntaxError, syntaxError, Version} from './util';
|
2017-12-16 14:35:47 -05:00
|
|
|
export {SourceMap} from './output/source_map';
|
2018-04-06 12:53:10 -04:00
|
|
|
export * from './injectable_compiler_2';
|
2018-05-09 11:35:25 -04:00
|
|
|
export * from './render3/view/api';
|
2018-05-21 11:15:19 -04:00
|
|
|
export {jitExpression} from './render3/r3_jit';
|
2018-05-09 11:35:25 -04:00
|
|
|
export {R3DependencyMetadata, R3FactoryMetadata, R3ResolvedDependencyType} from './render3/r3_factory';
|
2018-06-18 19:28:02 -04:00
|
|
|
export {compileInjector, compileNgModule, R3InjectorMetadata, R3NgModuleMetadata} from './render3/r3_module_compiler';
|
2018-06-26 13:43:06 -04:00
|
|
|
export {compilePipeFromMetadata, R3PipeMetadata} from './render3/r3_pipe_compiler';
|
2018-05-09 11:35:25 -04:00
|
|
|
export {makeBindingParser, parseTemplate} from './render3/view/template';
|
fix(ivy): force new imports for .d.ts files (#25080)
When ngtsc encounters a reference to a type (for example, a Component
type listed in an NgModule declarations array), it traces the import
of that type and attempts to determine the best way to refer to it.
In the event the type is defined in the same file where a reference
is being generated, the identifier of the type is used. If the type
was imported, ngtsc has a choice. It can use the identifier from the
original import, or it can write a new import to the module where the
type came from.
ngtsc has a bug currently when it elects to rely on the user's import.
When writing a .d.ts file, the user's import may have been elided as
the type was not referred to from the type side of the program. Thus,
in .d.ts files ngtsc must always assume the import may not exist, and
generate a new one.
In .js output the import is guaranteed to still exist, so it's
preferable for ngtsc to continue using the existing import if one is
available.
This commit changes how @angular/compiler writes type definitions, and
allows it to use a different expression to write a type definition than
is used to write the value. This allows ngtsc to specify that types in
type definitions should always be imported. A corresponding change to
the staticallyResolve() Reference system allows the choice of which
type of import to use when generating an Expression from a Reference.
PR Close #25080
2018-07-24 19:10:15 -04:00
|
|
|
export {R3Reference} from './render3/util';
|
2018-08-07 15:04:39 -04:00
|
|
|
export {compileBaseDefFromMetadata, R3BaseRefMetaData, compileComponentFromMetadata, compileDirectiveFromMetadata, parseHostBindings} from './render3/view/compiler';
|
|
|
|
// This file only reexports content of the `src` folder. Keep it that way.
|