static-injector 5.0.1 → 6.0.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/change_detection/scheduling/zoneless_scheduling.d.ts +37 -0
- package/import/change_detection/scheduling/zoneless_scheduling_impl.d.ts +16 -0
- package/import/core_reactivity_export_internal.d.ts +17 -0
- package/import/di/contextual.d.ts +36 -0
- package/{typings → import}/di/create_injector.d.ts +1 -1
- package/{typings → import}/di/forward_ref.d.ts +2 -2
- package/import/di/index.d.ts +3 -0
- package/{typings → import}/di/initializer_token.d.ts +8 -1
- package/{typings → import}/di/inject_switch.d.ts +2 -2
- package/{typings → import}/di/injectable.d.ts +4 -4
- package/{typings → import}/di/injection_token.d.ts +3 -4
- package/{typings → import}/di/injector.d.ts +4 -4
- package/{typings → import}/di/injector_compatibility.d.ts +1 -1
- package/{typings → import}/di/injector_marker.d.ts +1 -1
- package/{typings → import}/di/injector_token.d.ts +1 -1
- package/{typings → import}/di/interface/defs.d.ts +1 -1
- package/{typings → import}/di/interface/injector.d.ts +1 -1
- package/{typings → import}/di/interface/provider.d.ts +16 -18
- package/{typings → import}/di/internal_tokens.d.ts +1 -1
- package/{typings → import}/di/metadata.d.ts +9 -13
- package/{typings → import}/di/null_injector.d.ts +1 -1
- package/{typings → import}/di/provider_collection.d.ts +32 -4
- package/{typings → import}/di/provider_token.d.ts +1 -1
- package/{typings → import}/di/r3_injector.d.ts +2 -2
- package/{typings → import}/di/scope.d.ts +1 -1
- package/{typings → import}/di.d.ts +1 -1
- package/import/error_handler.d.ts +45 -0
- package/{typings → import}/errors.d.ts +13 -7
- package/import/index.d.ts +37 -0
- package/{typings → import}/interface/lifecycle_hooks.d.ts +2 -2
- package/{typings → import}/interface/type.d.ts +4 -9
- package/import/linker/destroy_ref.d.ts +44 -0
- package/import/pending_tasks.d.ts +78 -0
- package/{typings → import}/render3/definition_factory.d.ts +1 -1
- package/{typings → import}/render3/errors_di.d.ts +1 -1
- package/{typings → import}/render3/fields.d.ts +1 -1
- package/{typings → import}/render3/instructions/di.d.ts +1 -1
- package/import/render3/reactivity/api.d.ts +27 -0
- package/import/render3/reactivity/asserts.d.ts +16 -0
- package/import/render3/reactivity/computed.d.ts +25 -0
- package/import/render3/reactivity/effect.d.ts +121 -0
- package/import/render3/reactivity/linked_signal.d.ts +33 -0
- package/import/render3/reactivity/microtask_effect.d.ts +21 -0
- package/import/render3/reactivity/patch.d.ts +11 -0
- package/import/render3/reactivity/root_effect_scheduler.d.ts +54 -0
- package/import/render3/reactivity/signal.d.ts +61 -0
- package/import/render3/reactivity/untracked.d.ts +12 -0
- package/import/resource/api.d.ts +219 -0
- package/{es2022/di/injectable.js → import/resource/index.d.ts} +3 -2
- package/import/resource/resource.d.ts +89 -0
- package/import/util/callback_scheduler.d.ts +35 -0
- package/{typings → import}/util/closure.d.ts +1 -1
- package/{typings → import}/util/decorators.d.ts +3 -3
- package/{typings → import}/util/empty.d.ts +1 -1
- package/{es2022/di/provider_token.js → import/util/noop.d.ts} +2 -2
- package/{typings → import}/util/property.d.ts +1 -1
- package/{typings → import}/util/stringify.d.ts +1 -1
- package/index.js +2349 -0
- package/index.js.map +7 -0
- package/index.mjs +2258 -0
- package/index.mjs.map +7 -0
- package/package.json +19 -10
- package/primitives/signals/index.d.ts +15 -0
- package/primitives/signals/src/computed.d.ts +55 -0
- package/primitives/signals/src/equality.d.ts +15 -0
- package/primitives/signals/src/errors.d.ts +10 -0
- package/primitives/signals/src/graph.d.ts +182 -0
- package/primitives/signals/src/linked_signal.d.ts +72 -0
- package/primitives/signals/src/signal.d.ts +29 -0
- package/primitives/signals/src/watch.d.ts +43 -0
- package/{es2022/di/injector_marker.js → primitives/signals/src/weak_ref.d.ts} +2 -2
- package/readme.md +18 -14
- package/commonjs/index.js +0 -1576
- package/es2022/di/create_injector.js +0 -32
- package/es2022/di/forward_ref.js +0 -80
- package/es2022/di/index.js +0 -1
- package/es2022/di/initializer_token.js +0 -15
- package/es2022/di/inject_switch.js +0 -51
- package/es2022/di/injection_token.js +0 -93
- package/es2022/di/injector.js +0 -60
- package/es2022/di/injector_compatibility.js +0 -265
- package/es2022/di/injector_token.js +0 -20
- package/es2022/di/interface/defs.js +0 -110
- package/es2022/di/interface/injector.js +0 -26
- package/es2022/di/interface/provider.js +0 -10
- package/es2022/di/internal_tokens.js +0 -9
- package/es2022/di/metadata.js +0 -49
- package/es2022/di/null_injector.js +0 -19
- package/es2022/di/provider_collection.js +0 -104
- package/es2022/di/r3_injector.js +0 -449
- package/es2022/di/scope.js +0 -14
- package/es2022/di.js +0 -24
- package/es2022/errors.js +0 -44
- package/es2022/index.js +0 -11
- package/es2022/interface/lifecycle_hooks.js +0 -8
- package/es2022/interface/type.js +0 -21
- package/es2022/render3/definition_factory.js +0 -10
- package/es2022/render3/errors_di.js +0 -13
- package/es2022/render3/fields.js +0 -22
- package/es2022/render3/instructions/di.js +0 -23
- package/es2022/render3/util/stringify_utils.js +0 -38
- package/es2022/util/closure.js +0 -19
- package/es2022/util/decorators.js +0 -31
- package/es2022/util/empty.js +0 -18
- package/es2022/util/property.js +0 -15
- package/es2022/util/stringify.js +0 -45
- package/fesm2022/index.js +0 -1539
- package/typings/di/index.d.ts +0 -1
- package/typings/index.d.ts +0 -11
- package/typings/render3/util/stringify_utils.d.ts +0 -21
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
* Used for stringify render output in Ivy.
|
|
10
|
-
* Important! This function is very performance-sensitive and we should
|
|
11
|
-
* be extra careful not to introduce megamorphic reads in it.
|
|
12
|
-
* Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.
|
|
13
|
-
*/
|
|
14
|
-
export function renderStringify(value) {
|
|
15
|
-
if (typeof value === 'string')
|
|
16
|
-
return value;
|
|
17
|
-
if (value == null)
|
|
18
|
-
return '';
|
|
19
|
-
// Use `String` so that it invokes the `toString` method of the value. Note that this
|
|
20
|
-
// appears to be faster than calling `value.toString` (see `render_stringify` benchmark).
|
|
21
|
-
return String(value);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Used to stringify a value so that it can be displayed in an error message.
|
|
25
|
-
*
|
|
26
|
-
* Important! This function contains a megamorphic read and should only be
|
|
27
|
-
* used for error messages.
|
|
28
|
-
*/
|
|
29
|
-
export function stringifyForError(value) {
|
|
30
|
-
if (typeof value === 'function')
|
|
31
|
-
return value.name || value.toString();
|
|
32
|
-
if (typeof value === 'object' &&
|
|
33
|
-
value != null &&
|
|
34
|
-
typeof value.type === 'function') {
|
|
35
|
-
return value.type.name || value.type.toString();
|
|
36
|
-
}
|
|
37
|
-
return renderStringify(value);
|
|
38
|
-
}
|
package/es2022/util/closure.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
* Convince closure compiler that the wrapped function has no side-effects.
|
|
10
|
-
*
|
|
11
|
-
* Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
|
|
12
|
-
* allow us to execute a function but have closure compiler mark the call as no-side-effects.
|
|
13
|
-
* It is important that the return value for the `noSideEffects` function be assigned
|
|
14
|
-
* to something which is retained otherwise the call to `noSideEffects` will be removed by closure
|
|
15
|
-
* compiler.
|
|
16
|
-
*/
|
|
17
|
-
export function noSideEffects(fn) {
|
|
18
|
-
return { toString: fn }.toString();
|
|
19
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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 { noSideEffects } from './closure';
|
|
9
|
-
export const PARAMETERS = '__parameters__';
|
|
10
|
-
function makeMetadataCtor(props) {
|
|
11
|
-
return function ctor(...args) {
|
|
12
|
-
if (props) {
|
|
13
|
-
const values = props(...args);
|
|
14
|
-
for (const propName in values) {
|
|
15
|
-
this[propName] = values[propName];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export function makeParamDecorator(name, props, parentClass) {
|
|
21
|
-
return noSideEffects(() => {
|
|
22
|
-
const metaCtor = makeMetadataCtor(props);
|
|
23
|
-
function ParamDecoratorFactory(...args) {
|
|
24
|
-
metaCtor.apply(this, args);
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
if (parentClass) {
|
|
28
|
-
}
|
|
29
|
-
return ParamDecoratorFactory;
|
|
30
|
-
});
|
|
31
|
-
}
|
package/es2022/util/empty.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
* This file contains reuseable "empty" symbols that can be used as default return values
|
|
10
|
-
* in different parts of the rendering code. Because the same symbols are returned, this
|
|
11
|
-
* allows for identity checks against these values to be consistently used by the framework
|
|
12
|
-
* code.
|
|
13
|
-
*/
|
|
14
|
-
export const EMPTY_OBJ = {};
|
|
15
|
-
export const EMPTY_ARRAY = [];
|
|
16
|
-
// freezing the values prevents any code from accidentally inserting new values in
|
|
17
|
-
if (false) {
|
|
18
|
-
}
|
package/es2022/util/property.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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 function getClosureSafeProperty(objWithPropertyToExtract) {
|
|
9
|
-
for (let key in objWithPropertyToExtract) {
|
|
10
|
-
if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
|
|
11
|
-
return key;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
throw Error('Could not find renamed property on target object.');
|
|
15
|
-
}
|
package/es2022/util/stringify.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
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 function stringify(token) {
|
|
9
|
-
if (typeof token === 'string') {
|
|
10
|
-
return token;
|
|
11
|
-
}
|
|
12
|
-
if (Array.isArray(token)) {
|
|
13
|
-
return '[' + token.map(stringify).join(', ') + ']';
|
|
14
|
-
}
|
|
15
|
-
if (token == null) {
|
|
16
|
-
return '' + token;
|
|
17
|
-
}
|
|
18
|
-
if (token.overriddenName) {
|
|
19
|
-
return `${token.overriddenName}`;
|
|
20
|
-
}
|
|
21
|
-
if (token.name) {
|
|
22
|
-
return `${token.name}`;
|
|
23
|
-
}
|
|
24
|
-
const res = token.toString();
|
|
25
|
-
if (res == null) {
|
|
26
|
-
return '' + res;
|
|
27
|
-
}
|
|
28
|
-
const newLineIndex = res.indexOf('\n');
|
|
29
|
-
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Ellipses the string in the middle when longer than the max length
|
|
33
|
-
*
|
|
34
|
-
* @param string
|
|
35
|
-
* @param maxLength of the output string
|
|
36
|
-
* @returns ellipsed string with ... in the middle
|
|
37
|
-
*/
|
|
38
|
-
export function truncateMiddle(str, maxLength = 100) {
|
|
39
|
-
if (!str || maxLength < 1 || str.length <= maxLength)
|
|
40
|
-
return str;
|
|
41
|
-
if (maxLength == 1)
|
|
42
|
-
return str.substring(0, 1) + '...';
|
|
43
|
-
const halfLimit = Math.round(maxLength / 2);
|
|
44
|
-
return (str.substring(0, halfLimit) + '...' + str.substring(str.length - halfLimit));
|
|
45
|
-
}
|