@angular/core 20.0.0-next.3 → 20.0.0-next.5

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 (72) hide show
  1. package/api.d-mxcXqDpA.d.ts +297 -0
  2. package/discovery.d-CyYpOJ7j.d.ts +7393 -0
  3. package/event_dispatcher.d-PWnbqZDx.d.ts +346 -0
  4. package/fesm2022/attribute-B17mgaqe.mjs +24 -0
  5. package/fesm2022/attribute-B17mgaqe.mjs.map +1 -0
  6. package/fesm2022/core.mjs +579 -36730
  7. package/fesm2022/core.mjs.map +1 -1
  8. package/fesm2022/debug_node-xKpCIZm-.mjs +32070 -0
  9. package/fesm2022/debug_node-xKpCIZm-.mjs.map +1 -0
  10. package/fesm2022/primitives/di.mjs +2 -2
  11. package/fesm2022/primitives/di.mjs.map +1 -1
  12. package/fesm2022/primitives/event-dispatch.mjs +2 -16
  13. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  14. package/fesm2022/primitives/signals.mjs +5 -609
  15. package/fesm2022/primitives/signals.mjs.map +1 -1
  16. package/fesm2022/resource-BPpYEDic.mjs +621 -0
  17. package/fesm2022/resource-BPpYEDic.mjs.map +1 -0
  18. package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs +3816 -0
  19. package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs.map +1 -0
  20. package/fesm2022/rxjs-interop.mjs +91 -7
  21. package/fesm2022/rxjs-interop.mjs.map +1 -1
  22. package/fesm2022/signal-DhRAAi7R.mjs +522 -0
  23. package/fesm2022/signal-DhRAAi7R.mjs.map +1 -0
  24. package/fesm2022/testing.mjs +105 -103
  25. package/fesm2022/testing.mjs.map +1 -1
  26. package/fesm2022/untracked-DaaW3JJm.mjs +117 -0
  27. package/fesm2022/untracked-DaaW3JJm.mjs.map +1 -0
  28. package/fesm2022/weak_ref-DrMdAIDh.mjs +1 -1
  29. package/graph.d-StYigYp1.d.ts +195 -0
  30. package/index.d.ts +2616 -10854
  31. package/ng_i18n_closure_mode.d-DLxSUiDr.d.ts +832 -0
  32. package/package.json +3 -3
  33. package/primitives/di/index.d.ts +3 -2
  34. package/primitives/event-dispatch/index.d.ts +5 -340
  35. package/primitives/signals/index.d.ts +7 -209
  36. package/rxjs-interop/index.d.ts +16 -4
  37. package/schematics/bundles/{apply_import_manager-BXQEjo09.js → apply_import_manager-C-ysxahq.js} +3 -3
  38. package/schematics/bundles/{compiler_host-Bk3repE2.js → change_tracker-0Ktek5Xl.js} +3 -121
  39. package/schematics/bundles/checker-DqUKCGda.js +17702 -0
  40. package/schematics/bundles/cleanup-unused-imports.js +6 -5
  41. package/schematics/bundles/{checker-BHb19MHt.js → compiler-CuoiHqkc.js} +578 -18086
  42. package/schematics/bundles/compiler_host-CAfDJO3W.js +129 -0
  43. package/schematics/bundles/control-flow-migration.js +59 -50
  44. package/schematics/bundles/document-core.js +96 -0
  45. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  46. package/schematics/bundles/{index-BL9kAIe5.js → index-CwFQSYXZ.js} +30 -29
  47. package/schematics/bundles/{index-I8VbxQcO.js → index-WFXCe5Q0.js} +527 -524
  48. package/schematics/bundles/inject-flags.js +6 -5
  49. package/schematics/bundles/inject-migration.js +29 -10
  50. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  51. package/schematics/bundles/{migrate_ts_type_references-KlOTWeDl.js → migrate_ts_type_references-BNuHufqZ.js} +6 -5
  52. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  53. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  54. package/schematics/bundles/output-migration.js +15 -10
  55. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  56. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  57. package/schematics/bundles/route-lazy-loading.js +7 -5
  58. package/schematics/bundles/{run_in_devkit-C0JPtK2u.js → run_in_devkit-CmHxABFr.js} +4 -3
  59. package/schematics/bundles/self-closing-tags-migration.js +10 -9
  60. package/schematics/bundles/signal-input-migration.js +8 -7
  61. package/schematics/bundles/signal-queries-migration.js +27 -14
  62. package/schematics/bundles/signals.js +8 -7
  63. package/schematics/bundles/standalone-migration.js +11 -9
  64. package/schematics/bundles/symbol-VPWguRxr.js +1 -1
  65. package/schematics/bundles/test-bed-get.js +5 -4
  66. package/schematics/collection.json +0 -6
  67. package/schematics/migrations.json +11 -0
  68. package/signal.d-BeaTIeOE.d.ts +31 -0
  69. package/testing/index.d.ts +13 -9
  70. package/weak_ref.d-ttyj86RV.d.ts +1 -1
  71. package/navigation_types.d-u4EOrrdZ.d.ts +0 -121
  72. package/schematics/ng-generate/control-flow-migration/schema.json +0 -20
@@ -0,0 +1,297 @@
1
+ /**
2
+ * @license Angular v20.0.0-next.5
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
+ * License: MIT
5
+ */
6
+
7
+ import { O as OutputRef, a as OutputRefSubscription, D as DestroyRef, S as Signal, W as WritableSignal, V as ValueEqualityFn, I as Injector } from './ng_i18n_closure_mode.d-DLxSUiDr.js';
8
+
9
+ /**
10
+ * An `OutputEmitterRef` is created by the `output()` function and can be
11
+ * used to emit values to consumers of your directive or component.
12
+ *
13
+ * Consumers of your directive/component can bind to the output and
14
+ * subscribe to changes via the bound event syntax. For example:
15
+ *
16
+ * ```html
17
+ * <my-comp (valueChange)="processNewValue($event)" />
18
+ * ```
19
+ *
20
+ * @publicAPI
21
+ */
22
+ declare class OutputEmitterRef<T> implements OutputRef<T> {
23
+ private destroyed;
24
+ private listeners;
25
+ private errorHandler;
26
+ constructor();
27
+ subscribe(callback: (value: T) => void): OutputRefSubscription;
28
+ /** Emits a new value to the output. */
29
+ emit(value: T): void;
30
+ }
31
+ /** Gets the owning `DestroyRef` for the given output. */
32
+ declare function getOutputDestroyRef(ref: OutputRef<unknown>): DestroyRef | undefined;
33
+
34
+ /**
35
+ * Options for declaring an output.
36
+ *
37
+ * @publicAPI
38
+ */
39
+ interface OutputOptions {
40
+ alias?: string;
41
+ }
42
+ /**
43
+ * The `output` function allows declaration of Angular outputs in
44
+ * directives and components.
45
+ *
46
+ * You can use outputs to emit values to parent directives and component.
47
+ * Parents can subscribe to changes via:
48
+ *
49
+ * - template event bindings. For example, `(myOutput)="doSomething($event)"`
50
+ * - programmatic subscription by using `OutputRef#subscribe`.
51
+ *
52
+ * @usageNotes
53
+ *
54
+ * To use `output()`, import the function from `@angular/core`.
55
+ *
56
+ * ```ts
57
+ * import {output} from '@angular/core';
58
+ * ```
59
+ *
60
+ * Inside your component, introduce a new class member and initialize
61
+ * it with a call to `output`.
62
+ *
63
+ * ```ts
64
+ * @Directive({
65
+ * ...
66
+ * })
67
+ * export class MyDir {
68
+ * nameChange = output<string>(); // OutputEmitterRef<string>
69
+ * onClick = output(); // OutputEmitterRef<void>
70
+ * }
71
+ * ```
72
+ *
73
+ * You can emit values to consumers of your directive, by using
74
+ * the `emit` method from `OutputEmitterRef`.
75
+ *
76
+ * ```ts
77
+ * updateName(newName: string): void {
78
+ * this.nameChange.emit(newName);
79
+ * }
80
+ * ```
81
+ * @initializerApiFunction {"showTypesInSignaturePreview": true}
82
+ * @publicAPI
83
+ */
84
+ declare function output<T = void>(opts?: OutputOptions): OutputEmitterRef<T>;
85
+
86
+ /**
87
+ * Status of a `Resource`.
88
+ *
89
+ * @experimental
90
+ */
91
+ declare enum ResourceStatus {
92
+ /**
93
+ * The resource has no valid request and will not perform any loading.
94
+ *
95
+ * `value()` will be `undefined`.
96
+ */
97
+ Idle = 0,
98
+ /**
99
+ * Loading failed with an error.
100
+ *
101
+ * `value()` will be `undefined`.
102
+ */
103
+ Error = 1,
104
+ /**
105
+ * The resource is currently loading a new value as a result of a change in its `request`.
106
+ *
107
+ * `value()` will be `undefined`.
108
+ */
109
+ Loading = 2,
110
+ /**
111
+ * The resource is currently reloading a fresh value for the same request.
112
+ *
113
+ * `value()` will continue to return the previously fetched value during the reloading operation.
114
+ */
115
+ Reloading = 3,
116
+ /**
117
+ * Loading has completed and the resource has the value returned from the loader.
118
+ */
119
+ Resolved = 4,
120
+ /**
121
+ * The resource's value was set locally via `.set()` or `.update()`.
122
+ */
123
+ Local = 5
124
+ }
125
+ /**
126
+ * A Resource is an asynchronous dependency (for example, the results of an API call) that is
127
+ * managed and delivered through signals.
128
+ *
129
+ * The usual way of creating a `Resource` is through the `resource` function, but various other APIs
130
+ * may present `Resource` instances to describe their own concepts.
131
+ *
132
+ * @experimental
133
+ */
134
+ interface Resource<T> {
135
+ /**
136
+ * The current value of the `Resource`, or `undefined` if there is no current value.
137
+ */
138
+ readonly value: Signal<T>;
139
+ /**
140
+ * The current status of the `Resource`, which describes what the resource is currently doing and
141
+ * what can be expected of its `value`.
142
+ */
143
+ readonly status: Signal<ResourceStatus>;
144
+ /**
145
+ * When in the `error` state, this returns the last known error from the `Resource`.
146
+ */
147
+ readonly error: Signal<unknown>;
148
+ /**
149
+ * Whether this resource is loading a new value (or reloading the existing one).
150
+ */
151
+ readonly isLoading: Signal<boolean>;
152
+ /**
153
+ * Whether this resource has a valid current value.
154
+ *
155
+ * This function is reactive.
156
+ */
157
+ hasValue(): this is Resource<Exclude<T, undefined>>;
158
+ /**
159
+ * Instructs the resource to re-load any asynchronous dependency it may have.
160
+ *
161
+ * Note that the resource will not enter its reloading state until the actual backend request is
162
+ * made.
163
+ *
164
+ * @returns true if a reload was initiated, false if a reload was unnecessary or unsupported
165
+ */
166
+ reload(): boolean;
167
+ }
168
+ /**
169
+ * A `Resource` with a mutable value.
170
+ *
171
+ * Overwriting the value of a resource sets it to the 'local' state.
172
+ *
173
+ * @experimental
174
+ */
175
+ interface WritableResource<T> extends Resource<T> {
176
+ readonly value: WritableSignal<T>;
177
+ hasValue(): this is WritableResource<Exclude<T, undefined>>;
178
+ /**
179
+ * Convenience wrapper for `value.set`.
180
+ */
181
+ set(value: T): void;
182
+ /**
183
+ * Convenience wrapper for `value.update`.
184
+ */
185
+ update(updater: (value: T) => T): void;
186
+ asReadonly(): Resource<T>;
187
+ }
188
+ /**
189
+ * A `WritableResource` created through the `resource` function.
190
+ *
191
+ * @experimental
192
+ */
193
+ interface ResourceRef<T> extends WritableResource<T> {
194
+ hasValue(): this is ResourceRef<Exclude<T, undefined>>;
195
+ /**
196
+ * Manually destroy the resource, which cancels pending requests and returns it to `idle` state.
197
+ */
198
+ destroy(): void;
199
+ }
200
+ /**
201
+ * Parameter to a `ResourceLoader` which gives the request and other options for the current loading
202
+ * operation.
203
+ *
204
+ * @experimental
205
+ */
206
+ interface ResourceLoaderParams<R> {
207
+ request: Exclude<NoInfer<R>, undefined>;
208
+ abortSignal: AbortSignal;
209
+ previous: {
210
+ status: ResourceStatus;
211
+ };
212
+ }
213
+ /**
214
+ * Loading function for a `Resource`.
215
+ *
216
+ * @experimental
217
+ */
218
+ type ResourceLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<T>;
219
+ /**
220
+ * Streaming loader for a `Resource`.
221
+ *
222
+ * @experimental
223
+ */
224
+ type ResourceStreamingLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<Signal<ResourceStreamItem<T>>>;
225
+ /**
226
+ * Options to the `resource` function, for creating a resource.
227
+ *
228
+ * @experimental
229
+ */
230
+ interface BaseResourceOptions<T, R> {
231
+ /**
232
+ * A reactive function which determines the request to be made. Whenever the request changes, the
233
+ * loader will be triggered to fetch a new value for the resource.
234
+ *
235
+ * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.
236
+ */
237
+ request?: () => R;
238
+ /**
239
+ * The value which will be returned from the resource when a server value is unavailable, such as
240
+ * when the resource is still loading, or in an error state.
241
+ */
242
+ defaultValue?: NoInfer<T>;
243
+ /**
244
+ * Equality function used to compare the return value of the loader.
245
+ */
246
+ equal?: ValueEqualityFn<T>;
247
+ /**
248
+ * Overrides the `Injector` used by `resource`.
249
+ */
250
+ injector?: Injector;
251
+ }
252
+ /**
253
+ * Options to the `resource` function, for creating a resource.
254
+ *
255
+ * @experimental
256
+ */
257
+ interface PromiseResourceOptions<T, R> extends BaseResourceOptions<T, R> {
258
+ /**
259
+ * Loading function which returns a `Promise` of the resource's value for a given request.
260
+ */
261
+ loader: ResourceLoader<T, R>;
262
+ /**
263
+ * Cannot specify `stream` and `loader` at the same time.
264
+ */
265
+ stream?: never;
266
+ }
267
+ /**
268
+ * Options to the `resource` function, for creating a resource.
269
+ *
270
+ * @experimental
271
+ */
272
+ interface StreamingResourceOptions<T, R> extends BaseResourceOptions<T, R> {
273
+ /**
274
+ * Loading function which returns a `Promise` of a signal of the resource's value for a given
275
+ * request, which can change over time as new values are received from a stream.
276
+ */
277
+ stream: ResourceStreamingLoader<T, R>;
278
+ /**
279
+ * Cannot specify `stream` and `loader` at the same time.
280
+ */
281
+ loader?: never;
282
+ }
283
+ /**
284
+ * @experimental
285
+ */
286
+ type ResourceOptions<T, R> = PromiseResourceOptions<T, R> | StreamingResourceOptions<T, R>;
287
+ /**
288
+ * @experimental
289
+ */
290
+ type ResourceStreamItem<T> = {
291
+ value: T;
292
+ } | {
293
+ error: unknown;
294
+ };
295
+
296
+ export { ResourceStatus as b, OutputEmitterRef as f, getOutputDestroyRef as g, output as o };
297
+ export type { BaseResourceOptions as B, OutputOptions as O, PromiseResourceOptions as P, ResourceLoaderParams as R, StreamingResourceOptions as S, WritableResource as W, ResourceRef as a, Resource as c, ResourceStreamingLoader as d, ResourceOptions as e, ResourceLoader as h, ResourceStreamItem as i };