@angular/core 20.0.0-next.4 → 20.0.0-next.6
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/api.d-DQLNOR5l.d.ts +297 -0
- package/discovery.d-CFs2MaLO.d.ts +7383 -0
- package/{event_dispatcher.d-pVP0-wST.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -2
- package/fesm2022/attribute-BWp59EjE.mjs +24 -0
- package/fesm2022/attribute-BWp59EjE.mjs.map +1 -0
- package/fesm2022/core.mjs +586 -36873
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node-z_3NG8qT.mjs +32079 -0
- package/fesm2022/debug_node-z_3NG8qT.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +18 -4
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -16
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +5 -3
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource-CPPwEcg7.mjs +619 -0
- package/fesm2022/resource-CPPwEcg7.mjs.map +1 -0
- package/fesm2022/root_effect_scheduler-VSXfCzDX.mjs +3847 -0
- package/fesm2022/root_effect_scheduler-VSXfCzDX.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +16 -9
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/{untracked-DkcXpNb_.mjs → signal-B6pMq7KS.mjs} +16 -114
- package/fesm2022/signal-B6pMq7KS.mjs.map +1 -0
- package/fesm2022/testing.mjs +265 -201
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-Bz5WMeU1.mjs +117 -0
- package/fesm2022/untracked-Bz5WMeU1.mjs.map +1 -0
- package/fesm2022/weak_ref-BaIq-pgY.mjs +12 -0
- package/fesm2022/weak_ref-BaIq-pgY.mjs.map +1 -0
- package/{weak_ref.d-BZ7gyRag.d.ts → graph.d-BcIOep_B.d.ts} +3 -24
- package/index.d.ts +2624 -10909
- package/ng_i18n_closure_mode.d-C9d2CaSt.d.ts +832 -0
- package/package.json +3 -3
- package/primitives/di/index.d.ts +3 -2
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +8 -4
- package/rxjs-interop/index.d.ts +10 -7
- package/schematics/bundles/{apply_import_manager-CeNv8GIG.js → apply_import_manager-DnMqg1pY.js} +6 -6
- package/schematics/bundles/{compiler_host-DwM3ugW3.js → change_tracker-UMPkv-eH.js} +3 -121
- package/schematics/bundles/checker-BFBQyesT.js +17719 -0
- package/schematics/bundles/cleanup-unused-imports.js +25 -19
- package/schematics/bundles/{checker-k591b6WQ.js → compiler-BQ7R7w2v.js} +1325 -18286
- package/schematics/bundles/compiler_host-CAfDJO3W.js +129 -0
- package/schematics/bundles/control-flow-migration.js +28 -40
- package/schematics/bundles/document-core.js +96 -0
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-B4OAlHh8.js → index-Cv4Q415G.js} +641 -547
- package/schematics/bundles/{index-BhELUmYx.js → index-D8tMJPKa.js} +35 -34
- package/schematics/bundles/inject-flags.js +14 -13
- package/schematics/bundles/inject-migration.js +29 -10
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Be0TNYen.js → migrate_ts_type_references-Cq_ZBuT4.js} +21 -20
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +88 -25
- package/schematics/bundles/{run_in_devkit-CkvEksWP.js → project_paths-ql6qcf_c.js} +254 -243
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/route-lazy-loading.js +7 -5
- package/schematics/bundles/self-closing-tags-migration.js +25 -19
- package/schematics/bundles/signal-input-migration.js +26 -20
- package/schematics/bundles/signal-queries-migration.js +51 -33
- package/schematics/bundles/signals.js +8 -7
- package/schematics/bundles/standalone-migration.js +11 -9
- package/schematics/bundles/symbol-VPWguRxr.js +1 -1
- package/schematics/bundles/test-bed-get.js +13 -12
- package/schematics/collection.json +0 -6
- package/schematics/migrations.json +11 -0
- package/signal.d-E0e5nW1p.d.ts +31 -0
- package/testing/index.d.ts +16 -28
- package/weak_ref.d-eGOEP9S1.d.ts +9 -0
- package/fesm2022/injector-BlLwZ2sr.mjs +0 -24
- package/fesm2022/injector-BlLwZ2sr.mjs.map +0 -1
- package/fesm2022/untracked-DkcXpNb_.mjs.map +0 -1
- package/navigation_types.d-DgDrF5rp.d.ts +0 -121
- package/schematics/ng-generate/control-flow-migration/schema.json +0 -20
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Angular v20.0.0-next.6
|
|
3
|
+
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { OutputRef, OutputRefSubscription, DestroyRef, Signal, WritableSignal, ValueEqualityFn, Injector } from './ng_i18n_closure_mode.d-C9d2CaSt.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 { OutputEmitterRef, ResourceStatus, getOutputDestroyRef, output };
|
|
297
|
+
export type { BaseResourceOptions, OutputOptions, PromiseResourceOptions, Resource, ResourceLoader, ResourceLoaderParams, ResourceOptions, ResourceRef, ResourceStreamItem, ResourceStreamingLoader, StreamingResourceOptions, WritableResource };
|