static-injector 5.0.2 → 6.0.1

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.
Files changed (110) hide show
  1. package/import/change_detection/scheduling/zoneless_scheduling.d.ts +37 -0
  2. package/import/change_detection/scheduling/zoneless_scheduling_impl.d.ts +16 -0
  3. package/import/core_reactivity_export_internal.d.ts +17 -0
  4. package/import/di/contextual.d.ts +36 -0
  5. package/{typings → import}/di/create_injector.d.ts +1 -1
  6. package/{typings → import}/di/forward_ref.d.ts +2 -2
  7. package/import/di/index.d.ts +3 -0
  8. package/{typings → import}/di/initializer_token.d.ts +8 -1
  9. package/{typings → import}/di/inject_switch.d.ts +2 -2
  10. package/{typings → import}/di/injectable.d.ts +2 -2
  11. package/{typings → import}/di/injection_token.d.ts +3 -4
  12. package/{typings → import}/di/injector.d.ts +1 -1
  13. package/{typings → import}/di/injector_compatibility.d.ts +1 -1
  14. package/{typings → import}/di/injector_marker.d.ts +1 -1
  15. package/{typings → import}/di/injector_token.d.ts +1 -1
  16. package/{typings → import}/di/interface/defs.d.ts +1 -1
  17. package/{typings → import}/di/interface/injector.d.ts +1 -1
  18. package/{typings → import}/di/interface/provider.d.ts +1 -1
  19. package/{typings → import}/di/internal_tokens.d.ts +1 -1
  20. package/{typings → import}/di/metadata.d.ts +5 -9
  21. package/{typings → import}/di/null_injector.d.ts +1 -1
  22. package/{typings → import}/di/provider_collection.d.ts +31 -3
  23. package/{typings → import}/di/provider_token.d.ts +1 -1
  24. package/{typings → import}/di/r3_injector.d.ts +2 -2
  25. package/{typings → import}/di/scope.d.ts +1 -1
  26. package/{typings → import}/di.d.ts +1 -1
  27. package/import/error_handler.d.ts +45 -0
  28. package/{typings → import}/errors.d.ts +9 -7
  29. package/import/index.d.ts +37 -0
  30. package/{typings → import}/interface/lifecycle_hooks.d.ts +1 -1
  31. package/{typings → import}/interface/type.d.ts +4 -9
  32. package/import/linker/destroy_ref.d.ts +44 -0
  33. package/import/pending_tasks.d.ts +78 -0
  34. package/{typings → import}/render3/definition_factory.d.ts +1 -1
  35. package/{typings → import}/render3/errors_di.d.ts +1 -1
  36. package/{typings → import}/render3/fields.d.ts +1 -1
  37. package/{typings → import}/render3/instructions/di.d.ts +1 -1
  38. package/import/render3/reactivity/api.d.ts +27 -0
  39. package/import/render3/reactivity/asserts.d.ts +16 -0
  40. package/import/render3/reactivity/computed.d.ts +25 -0
  41. package/import/render3/reactivity/effect.d.ts +121 -0
  42. package/import/render3/reactivity/linked_signal.d.ts +33 -0
  43. package/import/render3/reactivity/microtask_effect.d.ts +21 -0
  44. package/import/render3/reactivity/patch.d.ts +11 -0
  45. package/import/render3/reactivity/root_effect_scheduler.d.ts +54 -0
  46. package/import/render3/reactivity/signal.d.ts +61 -0
  47. package/import/render3/reactivity/untracked.d.ts +12 -0
  48. package/import/resource/api.d.ts +219 -0
  49. package/{es2022/di/injectable.js → import/resource/index.d.ts} +3 -2
  50. package/import/resource/resource.d.ts +89 -0
  51. package/import/util/callback_scheduler.d.ts +35 -0
  52. package/{typings → import}/util/closure.d.ts +1 -1
  53. package/{typings → import}/util/decorators.d.ts +3 -3
  54. package/{typings → import}/util/empty.d.ts +1 -1
  55. package/{es2022/di/provider_token.js → import/util/noop.d.ts} +2 -2
  56. package/{typings → import}/util/property.d.ts +1 -1
  57. package/{typings → import}/util/stringify.d.ts +1 -1
  58. package/index.js +2349 -0
  59. package/index.js.map +7 -0
  60. package/index.mjs +2258 -0
  61. package/index.mjs.map +7 -0
  62. package/package.json +22 -11
  63. package/primitives/signals/index.d.ts +15 -0
  64. package/primitives/signals/src/computed.d.ts +55 -0
  65. package/primitives/signals/src/equality.d.ts +15 -0
  66. package/primitives/signals/src/errors.d.ts +10 -0
  67. package/primitives/signals/src/graph.d.ts +182 -0
  68. package/primitives/signals/src/linked_signal.d.ts +72 -0
  69. package/primitives/signals/src/signal.d.ts +29 -0
  70. package/primitives/signals/src/watch.d.ts +43 -0
  71. package/{es2022/di/injector_marker.js → primitives/signals/src/weak_ref.d.ts} +2 -2
  72. package/readme.md +19 -15
  73. package/commonjs/index.js +0 -1586
  74. package/es2022/di/create_injector.js +0 -32
  75. package/es2022/di/forward_ref.js +0 -80
  76. package/es2022/di/index.js +0 -1
  77. package/es2022/di/initializer_token.js +0 -15
  78. package/es2022/di/inject_switch.js +0 -51
  79. package/es2022/di/injection_token.js +0 -93
  80. package/es2022/di/injector.js +0 -60
  81. package/es2022/di/injector_compatibility.js +0 -265
  82. package/es2022/di/injector_token.js +0 -20
  83. package/es2022/di/interface/defs.js +0 -110
  84. package/es2022/di/interface/injector.js +0 -26
  85. package/es2022/di/interface/provider.js +0 -10
  86. package/es2022/di/internal_tokens.js +0 -9
  87. package/es2022/di/metadata.js +0 -48
  88. package/es2022/di/null_injector.js +0 -19
  89. package/es2022/di/provider_collection.js +0 -104
  90. package/es2022/di/r3_injector.js +0 -449
  91. package/es2022/di/scope.js +0 -14
  92. package/es2022/di.js +0 -24
  93. package/es2022/errors.js +0 -44
  94. package/es2022/index.js +0 -19
  95. package/es2022/interface/lifecycle_hooks.js +0 -8
  96. package/es2022/interface/type.js +0 -21
  97. package/es2022/render3/definition_factory.js +0 -10
  98. package/es2022/render3/errors_di.js +0 -13
  99. package/es2022/render3/fields.js +0 -22
  100. package/es2022/render3/instructions/di.js +0 -23
  101. package/es2022/render3/util/stringify_utils.js +0 -38
  102. package/es2022/util/closure.js +0 -19
  103. package/es2022/util/decorators.js +0 -31
  104. package/es2022/util/empty.js +0 -18
  105. package/es2022/util/property.js +0 -15
  106. package/es2022/util/stringify.js +0 -45
  107. package/fesm2022/index.js +0 -1547
  108. package/typings/di/index.d.ts +0 -1
  109. package/typings/index.d.ts +0 -18
  110. 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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }