static-injector 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/import/commonjs/index.js +6 -6
- package/import/es2015/di/r3_injector.js +6 -6
- package/import/fesm2015/index.js +6 -6
- package/import/typings/di/injectable.d.ts +1 -1
- package/import/typings/di/interface/provider.d.ts +2 -2
- package/import/typings/di/provider_collection.d.ts +1 -1
- package/import/typings/di/provider_token.d.ts +1 -1
- package/import/typings/di/r3_injector.d.ts +1 -1
- package/import/typings/di/scope.d.ts +1 -1
- package/import/typings/render3/definition_factory.d.ts +1 -1
- package/package.json +3 -3
- package/transform/compiler/compiler.d.ts +8 -0
- package/transform/compiler/compiler.js +28 -0
- package/transform/compiler/index.d.ts +8 -5
- package/transform/compiler/index.js +12 -5
- package/transform/compiler/public_api.d.ts +13 -0
- package/transform/compiler/public_api.js +30 -0
- package/transform/compiler/src/compiler.d.ts +27 -0
- package/transform/compiler/src/compiler.js +47 -0
- package/transform/compiler/src/output/output_ast.d.ts +1 -1
- package/transform/compiler/src/render3/partial/api.d.ts +1 -1
- package/transform/compiler/src/render3/partial/api.js +7 -0
- package/transform/compiler/src/render3/r3_factory.d.ts +8 -15
- package/transform/compiler/src/render3/r3_factory.js +37 -56
- package/transform/compiler/src/render3/view/util.d.ts +0 -8
- package/transform/compiler/src/render3/view/util.js +0 -8
- package/transform/compiler-cli/src/ngtsc/annotations/common/index.d.ts +10 -0
- package/transform/compiler-cli/src/ngtsc/annotations/common/index.js +26 -0
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/di.d.ts +37 -0
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/di.js +197 -0
- package/transform/compiler-cli/src/ngtsc/annotations/{src → common/src}/factory.d.ts +3 -3
- package/transform/compiler-cli/src/ngtsc/annotations/{src → common/src}/factory.js +2 -2
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.d.ts +3 -34
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.js +18 -216
- package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.d.ts +3 -4
- package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.js +31 -50
- package/transform/compiler-cli/src/ngtsc/diagnostics/index.d.ts +9 -2
- package/transform/compiler-cli/src/ngtsc/diagnostics/index.js +7 -0
- package/transform/compiler-cli/src/ngtsc/imports/index.d.ts +7 -0
- package/transform/compiler-cli/src/ngtsc/imports/index.js +7 -0
- package/transform/compiler-cli/src/ngtsc/imports/src/default.d.ts +19 -0
- package/transform/compiler-cli/src/ngtsc/imports/src/default.js +28 -0
- package/transform/compiler-cli/src/ngtsc/reflection/index.d.ts +10 -3
- package/transform/compiler-cli/src/ngtsc/reflection/index.js +7 -0
- package/transform/compiler-cli/src/ngtsc/reflection/src/host.d.ts +12 -13
- package/transform/compiler-cli/src/ngtsc/reflection/src/host.js +7 -28
- package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.d.ts +1 -1
- package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.js +17 -41
- package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.d.ts +1 -1
- package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.js +46 -65
- package/transform/compiler-cli/src/ngtsc/reflection/src/util.d.ts +2 -2
- package/transform/compiler-cli/src/ngtsc/reflection/src/util.js +7 -27
- package/transform/compiler-cli/src/ngtsc/transform/index.d.ts +9 -2
- package/transform/compiler-cli/src/ngtsc/transform/index.js +7 -0
- package/transform/compiler-cli/src/ngtsc/transform/src/api.d.ts +4 -4
- package/transform/compiler-cli/src/ngtsc/transform/src/utils.d.ts +1 -1
- package/transform/compiler-cli/src/ngtsc/transform/src/utils.js +15 -35
- package/transform/compiler-cli/src/ngtsc/translator/index.d.ts +12 -5
- package/transform/compiler-cli/src/ngtsc/translator/index.js +7 -0
- package/transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.d.ts +5 -5
- package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.d.ts +2 -2
- package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.js +4 -24
- package/transform/compiler-cli/src/ngtsc/translator/src/translator.d.ts +2 -2
- package/transform/compiler-cli/src/ngtsc/translator/src/translator.js +1 -1
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -1
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.js +76 -95
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_translator.d.ts +4 -4
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +20 -126
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.js +23 -147
- package/transform/compiler-cli/src/ngtsc/util/src/typescript.d.ts +1 -8
- package/transform/compiler-cli/src/ngtsc/util/src/typescript.js +4 -31
- package/transform/injectable-transform.js +36 -7
package/import/commonjs/index.js
CHANGED
|
@@ -953,6 +953,12 @@ function getNullInjector() {
|
|
|
953
953
|
class EnvironmentInjector {
|
|
954
954
|
}
|
|
955
955
|
class R3Injector extends EnvironmentInjector {
|
|
956
|
+
/**
|
|
957
|
+
* Flag indicating that this injector was previously destroyed.
|
|
958
|
+
*/
|
|
959
|
+
get destroyed() {
|
|
960
|
+
return this._destroyed;
|
|
961
|
+
}
|
|
956
962
|
constructor(providers, parent, source, scopes) {
|
|
957
963
|
super();
|
|
958
964
|
this.parent = parent;
|
|
@@ -986,12 +992,6 @@ class R3Injector extends EnvironmentInjector {
|
|
|
986
992
|
}
|
|
987
993
|
this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, exports.InjectFlags.Self));
|
|
988
994
|
}
|
|
989
|
-
/**
|
|
990
|
-
* Flag indicating that this injector was previously destroyed.
|
|
991
|
-
*/
|
|
992
|
-
get destroyed() {
|
|
993
|
-
return this._destroyed;
|
|
994
|
-
}
|
|
995
995
|
/**
|
|
996
996
|
* Destroy the injector and release references to every instance or provider associated with it.
|
|
997
997
|
*
|
|
@@ -49,6 +49,12 @@ export function getNullInjector() {
|
|
|
49
49
|
export class EnvironmentInjector {
|
|
50
50
|
}
|
|
51
51
|
export class R3Injector extends EnvironmentInjector {
|
|
52
|
+
/**
|
|
53
|
+
* Flag indicating that this injector was previously destroyed.
|
|
54
|
+
*/
|
|
55
|
+
get destroyed() {
|
|
56
|
+
return this._destroyed;
|
|
57
|
+
}
|
|
52
58
|
constructor(providers, parent, source, scopes) {
|
|
53
59
|
super();
|
|
54
60
|
this.parent = parent;
|
|
@@ -82,12 +88,6 @@ export class R3Injector extends EnvironmentInjector {
|
|
|
82
88
|
}
|
|
83
89
|
this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));
|
|
84
90
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Flag indicating that this injector was previously destroyed.
|
|
87
|
-
*/
|
|
88
|
-
get destroyed() {
|
|
89
|
-
return this._destroyed;
|
|
90
|
-
}
|
|
91
91
|
/**
|
|
92
92
|
* Destroy the injector and release references to every instance or provider associated with it.
|
|
93
93
|
*
|
package/import/fesm2015/index.js
CHANGED
|
@@ -951,6 +951,12 @@ function getNullInjector() {
|
|
|
951
951
|
class EnvironmentInjector {
|
|
952
952
|
}
|
|
953
953
|
class R3Injector extends EnvironmentInjector {
|
|
954
|
+
/**
|
|
955
|
+
* Flag indicating that this injector was previously destroyed.
|
|
956
|
+
*/
|
|
957
|
+
get destroyed() {
|
|
958
|
+
return this._destroyed;
|
|
959
|
+
}
|
|
954
960
|
constructor(providers, parent, source, scopes) {
|
|
955
961
|
super();
|
|
956
962
|
this.parent = parent;
|
|
@@ -984,12 +990,6 @@ class R3Injector extends EnvironmentInjector {
|
|
|
984
990
|
}
|
|
985
991
|
this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));
|
|
986
992
|
}
|
|
987
|
-
/**
|
|
988
|
-
* Flag indicating that this injector was previously destroyed.
|
|
989
|
-
*/
|
|
990
|
-
get destroyed() {
|
|
991
|
-
return this._destroyed;
|
|
992
|
-
}
|
|
993
993
|
/**
|
|
994
994
|
* Destroy the injector and release references to every instance or provider associated with it.
|
|
995
995
|
*
|
|
@@ -13,7 +13,7 @@ import { TypeDecorator } from '../util/decorators';
|
|
|
13
13
|
*
|
|
14
14
|
* @publicApi
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
|
|
17
17
|
/**
|
|
18
18
|
* Type of the Injectable decorator / constructor function.
|
|
19
19
|
*
|
|
@@ -236,7 +236,7 @@ export interface FactoryProvider extends FactorySansProvider {
|
|
|
236
236
|
*
|
|
237
237
|
* @publicApi
|
|
238
238
|
*/
|
|
239
|
-
export
|
|
239
|
+
export type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
|
|
240
240
|
/**
|
|
241
241
|
* Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.
|
|
242
242
|
*
|
|
@@ -304,4 +304,4 @@ export interface ClassProvider extends ClassSansProvider {
|
|
|
304
304
|
*
|
|
305
305
|
* @publicApi
|
|
306
306
|
*/
|
|
307
|
-
export
|
|
307
|
+
export type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
|
|
@@ -11,7 +11,7 @@ import { ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider,
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal type for a single provider in a deep provider array.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
|
|
15
15
|
/**
|
|
16
16
|
* The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone
|
|
17
17
|
* `ComponentType`, and all of its transitive providers and collects providers.
|
|
@@ -14,7 +14,7 @@ import { InjectorScope } from './scope';
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal type for a single provider in a deep provider array.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
|
|
18
18
|
export declare function getNullInjector(): Injector;
|
|
19
19
|
/**
|
|
20
20
|
* An `Injector` that's part of the environment injector hierarchy, which exists outside of the
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { InjectionToken } from './injection_token';
|
|
9
|
-
export
|
|
9
|
+
export type InjectorScope = 'root' | 'platform' | 'environment';
|
|
10
10
|
/**
|
|
11
11
|
* An internal token whose presence in an injector indicates that the injector should treat itself
|
|
12
12
|
* as a root scoped injector when processing requests for unknown tokens which may indicate
|
|
@@ -9,7 +9,7 @@ import { Type } from '../interface/type';
|
|
|
9
9
|
/**
|
|
10
10
|
* Definition of what a factory function should look like.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type FactoryFn<T> = {
|
|
13
13
|
/**
|
|
14
14
|
* Subclasses without an explicit constructor call through to the factory of their base
|
|
15
15
|
* definition, providing it with their own constructor to instantiate.
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "static-injector",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Angular的静态注入器独立使用版本",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"injector",
|
|
8
8
|
"typescript",
|
|
9
|
-
"typescript 4.
|
|
9
|
+
"typescript 4.9",
|
|
10
10
|
"injectable",
|
|
11
11
|
"static-inject"
|
|
12
12
|
],
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "wszgrcy",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"typescript": "^4.
|
|
32
|
+
"typescript": "^4.9.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {},
|
|
35
35
|
"sideEffects": false
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
// This file is not used to build this module. It is only used during editing
|
|
25
|
+
// by the TypeScript language service and during build for verification. `ngc`
|
|
26
|
+
// replaces this file with production index.ts when it rewrites private symbol
|
|
27
|
+
// names.
|
|
28
|
+
__exportStar(require("./public_api"), exports);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
export * from './compiler';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
10
|
if (k2 === undefined) k2 = k;
|
|
4
11
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -14,8 +21,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
22
|
};
|
|
16
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__exportStar(require("./
|
|
24
|
+
// This file is not used to build this module. It is only used during editing
|
|
25
|
+
// by the TypeScript language service and during build for verification. `ngc`
|
|
26
|
+
// replaces this file with production index.ts when it rewrites private symbol
|
|
27
|
+
// names.
|
|
28
|
+
__exportStar(require("./compiler"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @module
|
|
10
|
+
* @description
|
|
11
|
+
* Entry point for all public APIs of this package.
|
|
12
|
+
*/
|
|
13
|
+
export * from './src/compiler';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
/**
|
|
25
|
+
* @module
|
|
26
|
+
* @description
|
|
27
|
+
* Entry point for all public APIs of this package.
|
|
28
|
+
*/
|
|
29
|
+
__exportStar(require("./src/compiler"), exports);
|
|
30
|
+
// This file only reexports content of the `src` folder. Keep it that way.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @module
|
|
10
|
+
* @description
|
|
11
|
+
* Entry point for all APIs of the compiler package.
|
|
12
|
+
*
|
|
13
|
+
* <div class="callout is-critical">
|
|
14
|
+
* <header>Unstable APIs</header>
|
|
15
|
+
* <p>
|
|
16
|
+
* All compiler apis are currently considered experimental and private!
|
|
17
|
+
* </p>
|
|
18
|
+
* <p>
|
|
19
|
+
* We expect the APIs in this package to keep on changing. Do not rely on them.
|
|
20
|
+
* </p>
|
|
21
|
+
* </div>
|
|
22
|
+
*/
|
|
23
|
+
export * from './injectable_compiler_2';
|
|
24
|
+
export * from './render3/r3_factory';
|
|
25
|
+
export * from './output/output_ast';
|
|
26
|
+
export * from './render3/util';
|
|
27
|
+
export * from './parse_util';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
21
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
//////////////////////////////////////
|
|
25
|
+
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
26
|
+
// (see bottom of file) //
|
|
27
|
+
//////////////////////////////////////
|
|
28
|
+
/**
|
|
29
|
+
* @module
|
|
30
|
+
* @description
|
|
31
|
+
* Entry point for all APIs of the compiler package.
|
|
32
|
+
*
|
|
33
|
+
* <div class="callout is-critical">
|
|
34
|
+
* <header>Unstable APIs</header>
|
|
35
|
+
* <p>
|
|
36
|
+
* All compiler apis are currently considered experimental and private!
|
|
37
|
+
* </p>
|
|
38
|
+
* <p>
|
|
39
|
+
* We expect the APIs in this package to keep on changing. Do not rely on them.
|
|
40
|
+
* </p>
|
|
41
|
+
* </div>
|
|
42
|
+
*/
|
|
43
|
+
__exportStar(require("./injectable_compiler_2"), exports);
|
|
44
|
+
__exportStar(require("./render3/r3_factory"), exports);
|
|
45
|
+
__exportStar(require("./output/output_ast"), exports);
|
|
46
|
+
__exportStar(require("./render3/util"), exports);
|
|
47
|
+
__exportStar(require("./parse_util"), exports);
|
|
@@ -17,7 +17,7 @@ export interface R3PartialDeclaration {
|
|
|
17
17
|
*/
|
|
18
18
|
version: string;
|
|
19
19
|
/**
|
|
20
|
-
* A reference to the `
|
|
20
|
+
* A reference to the `@angular/core` ES module, which allows access
|
|
21
21
|
* to all Angular exports, including Ivy instructions.
|
|
22
22
|
*/
|
|
23
23
|
ngImport: o.Expression;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.FactoryTarget = void 0;
|
|
4
11
|
var FactoryTarget;
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import * as outputAst from '../output/output_ast';
|
|
1
|
+
import * as o from '../output/output_ast';
|
|
9
2
|
import { R3CompiledExpression, R3Reference } from './util';
|
|
10
3
|
/**
|
|
11
4
|
* Metadata required by the factory generator to generate a `factory` function for a type.
|
|
@@ -26,7 +19,7 @@ export interface R3ConstructorFactoryMetadata {
|
|
|
26
19
|
* This can differ from the outer `type` if the class is being compiled by ngcc and is inside
|
|
27
20
|
* an IIFE structure that uses a different name internally.
|
|
28
21
|
*/
|
|
29
|
-
internalType:
|
|
22
|
+
internalType: o.Expression;
|
|
30
23
|
/** Number of arguments for the `type`. */
|
|
31
24
|
typeArgumentCount: number;
|
|
32
25
|
/**
|
|
@@ -48,14 +41,14 @@ export declare enum R3FactoryDelegateType {
|
|
|
48
41
|
Function = 1
|
|
49
42
|
}
|
|
50
43
|
export interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {
|
|
51
|
-
delegate:
|
|
44
|
+
delegate: o.Expression;
|
|
52
45
|
delegateType: R3FactoryDelegateType;
|
|
53
46
|
delegateDeps: R3DependencyMetadata[];
|
|
54
47
|
}
|
|
55
48
|
export interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata {
|
|
56
|
-
expression:
|
|
49
|
+
expression: o.Expression;
|
|
57
50
|
}
|
|
58
|
-
export
|
|
51
|
+
export type R3FactoryMetadata = R3ConstructorFactoryMetadata | R3DelegatedFnOrClassMetadata | R3ExpressionFactoryMetadata;
|
|
59
52
|
export declare enum FactoryTarget {
|
|
60
53
|
Directive = 0,
|
|
61
54
|
Component = 1,
|
|
@@ -68,13 +61,13 @@ export interface R3DependencyMetadata {
|
|
|
68
61
|
* An expression representing the token or value to be injected.
|
|
69
62
|
* Or `null` if the dependency could not be resolved - making it invalid.
|
|
70
63
|
*/
|
|
71
|
-
token:
|
|
64
|
+
token: o.Expression | null;
|
|
72
65
|
/**
|
|
73
66
|
* If an @Attribute decorator is present, this is the literal type of the attribute name, or
|
|
74
67
|
* the unknown type if no literal type is available (e.g. the attribute name is an expression).
|
|
75
68
|
* Otherwise it is null;
|
|
76
69
|
*/
|
|
77
|
-
attributeNameType:
|
|
70
|
+
attributeNameType: o.Expression | null;
|
|
78
71
|
/**
|
|
79
72
|
* Whether the dependency has an @Optional qualifier.
|
|
80
73
|
*/
|
|
@@ -92,6 +85,6 @@ export interface R3DependencyMetadata {
|
|
|
92
85
|
* Construct a factory function expression for the given `R3FactoryMetadata`.
|
|
93
86
|
*/
|
|
94
87
|
export declare function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression;
|
|
95
|
-
export declare function createFactoryType(meta: R3FactoryMetadata):
|
|
88
|
+
export declare function createFactoryType(meta: R3FactoryMetadata): o.ExpressionType;
|
|
96
89
|
export declare function isDelegatedFactoryMetadata(meta: R3FactoryMetadata): meta is R3DelegatedFnOrClassMetadata;
|
|
97
90
|
export declare function isExpressionFactoryMetadata(meta: R3FactoryMetadata): meta is R3ExpressionFactoryMetadata;
|