@angular/core 20.0.0-next.1 → 20.0.0-next.2
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/fesm2022/core.mjs +374 -1796
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -589
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +18 -8
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +7 -32
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +119 -138
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref-DrMdAIDh.mjs +12 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs.map +1 -0
- package/index.d.ts +14343 -15225
- package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
- package/package.json +2 -2
- package/primitives/di/index.d.ts +42 -50
- package/primitives/event-dispatch/index.d.ts +205 -309
- package/primitives/signals/index.d.ts +158 -195
- package/rxjs-interop/index.d.ts +71 -91
- package/schematics/bundles/{apply_import_manager-e2a7fe5b.js → apply_import_manager-CyRT0UvU.js} +12 -16
- package/schematics/bundles/{checker-af521da6.js → checker-DF8ZaFW5.js} +3084 -1122
- package/schematics/bundles/cleanup-unused-imports.js +21 -27
- package/schematics/bundles/{compiler_host-5a29293c.js → compiler_host-Da636uJ8.js} +19 -23
- package/schematics/bundles/control-flow-migration.js +81 -38
- package/schematics/bundles/{imports-047fbbc8.js → imports-CIX-JgAN.js} +9 -14
- package/schematics/bundles/{index-1bef3025.js → index-DnkWgagp.js} +55 -59
- package/schematics/bundles/{index-ef1bffbb.js → index-vGJcp5M7.js} +4 -4
- package/schematics/bundles/inject-flags.js +181 -0
- package/schematics/bundles/inject-migration.js +121 -127
- package/schematics/bundles/{leading_space-f8944434.js → leading_space-D9nQ8UQC.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-2a3e9e6b.js → migrate_ts_type_references-DtkOnnv0.js} +106 -111
- package/schematics/bundles/{ng_decorators-b0d8b324.js → ng_decorators-DznZ5jMl.js} +4 -8
- package/schematics/bundles/{nodes-7758dbf6.js → nodes-B16H9JUd.js} +2 -6
- package/schematics/bundles/output-migration.js +39 -45
- package/schematics/bundles/{program-a449f9bf.js → program-BZk27Ndu.js} +844 -2651
- package/schematics/bundles/{project_paths-17dc204d.js → project_paths-Jtbi76Bs.js} +25 -23
- package/schematics/bundles/{project_tsconfig_paths-b558633b.js → project_tsconfig_paths-CDVxT6Ov.js} +1 -1
- package/schematics/bundles/{property_name-ac18447e.js → property_name-BBwFuqMe.js} +3 -7
- package/schematics/bundles/route-lazy-loading.js +35 -41
- package/schematics/bundles/self-closing-tags-migration.js +19 -25
- package/schematics/bundles/signal-input-migration.js +60 -67
- package/schematics/bundles/signal-queries-migration.js +47 -54
- package/schematics/bundles/signals.js +9 -11
- package/schematics/bundles/standalone-migration.js +178 -184
- package/schematics/migrations.json +4 -15
- package/testing/index.d.ts +289 -469
- package/weak_ref.d-ttyj86RV.d.ts +9 -0
- package/schematics/bundles/explicit-standalone-flag.js +0 -184
- package/schematics/bundles/pending-tasks.js +0 -103
- package/schematics/bundles/provide-initializer.js +0 -186
|
@@ -1,166 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-next.
|
|
2
|
+
* @license Angular v20.0.0-next.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
export declare type ComputationFn<S, D> = (source: S, previous?: {
|
|
9
|
-
source: S;
|
|
10
|
-
value: D;
|
|
11
|
-
}) => D;
|
|
12
|
-
|
|
13
|
-
declare type ComputedGetter<T> = (() => T) & {
|
|
14
|
-
[SIGNAL]: ComputedNode<T>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* A computation, which derives a value from a declarative reactive expression.
|
|
19
|
-
*
|
|
20
|
-
* `Computed`s are both producers and consumers of reactivity.
|
|
21
|
-
*/
|
|
22
|
-
export declare interface ComputedNode<T> extends ReactiveNode {
|
|
23
|
-
/**
|
|
24
|
-
* Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`,
|
|
25
|
-
* `ERROR`).
|
|
26
|
-
*/
|
|
27
|
-
value: T;
|
|
28
|
-
/**
|
|
29
|
-
* If `value` is `ERRORED`, the error caught from the last computation attempt which will
|
|
30
|
-
* be re-thrown.
|
|
31
|
-
*/
|
|
32
|
-
error: unknown;
|
|
33
|
-
/**
|
|
34
|
-
* The computation function which will produce a new value.
|
|
35
|
-
*/
|
|
36
|
-
computation: () => T;
|
|
37
|
-
equal: ValueEqualityFn<T>;
|
|
38
|
-
}
|
|
7
|
+
export { s as setAlternateWeakRefImpl } from '../../weak_ref.d-ttyj86RV.js';
|
|
39
8
|
|
|
40
9
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* Must be called by subclasses which represent reactive computations, after those computations
|
|
44
|
-
* have finished.
|
|
45
|
-
*/
|
|
46
|
-
export declare function consumerAfterComputation(node: ReactiveNode | null, prevConsumer: ReactiveNode | null): void;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Prepare this consumer to run a computation in its reactive context.
|
|
50
|
-
*
|
|
51
|
-
* Must be called by subclasses which represent reactive computations, before those computations
|
|
52
|
-
* begin.
|
|
53
|
-
*/
|
|
54
|
-
export declare function consumerBeforeComputation(node: ReactiveNode | null): ReactiveNode | null;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Disconnect this consumer from the graph.
|
|
58
|
-
*/
|
|
59
|
-
export declare function consumerDestroy(node: ReactiveNode): void;
|
|
60
|
-
|
|
61
|
-
export declare function consumerMarkDirty(node: ReactiveNode): void;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Determine whether this consumer has any dependencies which have changed since the last time
|
|
65
|
-
* they were read.
|
|
66
|
-
*/
|
|
67
|
-
export declare function consumerPollProducersForChange(node: ReactiveNode): boolean;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Create a computed signal which derives a reactive value from an expression.
|
|
71
|
-
*/
|
|
72
|
-
export declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
|
|
73
|
-
|
|
74
|
-
export declare function createLinkedSignal<S, D>(sourceFn: () => S, computationFn: ComputationFn<S, D>, equalityFn?: ValueEqualityFn<D>): LinkedSignalGetter<S, D>;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Create a `Signal` that can be set or updated directly.
|
|
10
|
+
* A comparison function which can determine if two values are equal.
|
|
78
11
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export declare function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, schedule: (watch: Watch) => void, allowSignalWrites: boolean): Watch;
|
|
82
|
-
|
|
12
|
+
type ValueEqualityFn<T> = (a: T, b: T) => boolean;
|
|
83
13
|
/**
|
|
84
14
|
* The default equality function used for `signal` and `computed`, which uses referential equality.
|
|
85
15
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export declare function getActiveConsumer(): ReactiveNode | null;
|
|
16
|
+
declare function defaultEquals<T>(a: T, b: T): boolean;
|
|
89
17
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export declare function isReactive(value: unknown): value is Reactive;
|
|
93
|
-
|
|
94
|
-
export declare type LinkedSignalGetter<S, D> = (() => D) & {
|
|
95
|
-
[SIGNAL]: LinkedSignalNode<S, D>;
|
|
18
|
+
type Version = number & {
|
|
19
|
+
__brand: 'Version';
|
|
96
20
|
};
|
|
97
|
-
|
|
98
|
-
export declare interface LinkedSignalNode<S, D> extends ReactiveNode {
|
|
99
|
-
/**
|
|
100
|
-
* Value of the source signal that was used to derive the computed value.
|
|
101
|
-
*/
|
|
102
|
-
sourceValue: S;
|
|
103
|
-
/**
|
|
104
|
-
* Current state value, or one of the sentinel values (`UNSET`, `COMPUTING`,
|
|
105
|
-
* `ERROR`).
|
|
106
|
-
*/
|
|
107
|
-
value: D;
|
|
108
|
-
/**
|
|
109
|
-
* If `value` is `ERRORED`, the error caught from the last computation attempt which will
|
|
110
|
-
* be re-thrown.
|
|
111
|
-
*/
|
|
112
|
-
error: unknown;
|
|
113
|
-
/**
|
|
114
|
-
* The source function represents reactive dependency based on which the linked state is reset.
|
|
115
|
-
*/
|
|
116
|
-
source: () => S;
|
|
117
|
-
/**
|
|
118
|
-
* The computation function which will produce a new value based on the source and, optionally - previous values.
|
|
119
|
-
*/
|
|
120
|
-
computation: ComputationFn<S, D>;
|
|
121
|
-
equal: ValueEqualityFn<D>;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export declare function linkedSignalSetFn<S, D>(node: LinkedSignalNode<S, D>, newValue: D): void;
|
|
125
|
-
|
|
126
|
-
export declare function linkedSignalUpdateFn<S, D>(node: LinkedSignalNode<S, D>, updater: (value: D) => D): void;
|
|
127
|
-
|
|
128
21
|
/**
|
|
129
|
-
*
|
|
130
|
-
*/
|
|
131
|
-
export declare function producerAccessed(node: ReactiveNode): void;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Increment the global epoch counter.
|
|
22
|
+
* Symbol used to tell `Signal`s apart from other functions.
|
|
135
23
|
*
|
|
136
|
-
*
|
|
137
|
-
*/
|
|
138
|
-
export declare function producerIncrementEpoch(): void;
|
|
139
|
-
|
|
140
|
-
export declare function producerMarkClean(node: ReactiveNode): void;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Propagate a dirty notification to live consumers of this producer.
|
|
144
|
-
*/
|
|
145
|
-
export declare function producerNotifyConsumers(node: ReactiveNode): void;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,
|
|
149
|
-
* based on the current consumer context.
|
|
150
|
-
*/
|
|
151
|
-
export declare function producerUpdatesAllowed(): boolean;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Ensure this producer's `version` is up-to-date.
|
|
24
|
+
* This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
|
|
155
25
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
26
|
+
declare const SIGNAL: unique symbol;
|
|
27
|
+
declare function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null;
|
|
28
|
+
declare function getActiveConsumer(): ReactiveNode | null;
|
|
29
|
+
declare function isInNotificationPhase(): boolean;
|
|
30
|
+
interface Reactive {
|
|
159
31
|
[SIGNAL]: ReactiveNode;
|
|
160
32
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
33
|
+
declare function isReactive(value: unknown): value is Reactive;
|
|
34
|
+
declare const REACTIVE_NODE: ReactiveNode;
|
|
164
35
|
/**
|
|
165
36
|
* A producer and/or consumer which participates in the reactive graph.
|
|
166
37
|
*
|
|
@@ -173,7 +44,7 @@ export declare const REACTIVE_NODE: ReactiveNode;
|
|
|
173
44
|
*
|
|
174
45
|
* A `ReactiveNode` may be both a producer and consumer.
|
|
175
46
|
*/
|
|
176
|
-
|
|
47
|
+
interface ReactiveNode {
|
|
177
48
|
/**
|
|
178
49
|
* Version of the value that this node produces.
|
|
179
50
|
*
|
|
@@ -270,56 +141,153 @@ export declare interface ReactiveNode {
|
|
|
270
141
|
*/
|
|
271
142
|
kind: string;
|
|
272
143
|
}
|
|
273
|
-
|
|
274
|
-
export declare function runPostSignalSetFn(): void;
|
|
275
|
-
|
|
276
|
-
export declare function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
export declare function setAlternateWeakRefImpl(impl: unknown): void;
|
|
280
|
-
|
|
281
|
-
export declare function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null;
|
|
282
|
-
|
|
283
|
-
export declare function setThrowInvalidWriteToSignalError(fn: <T>(node: SignalNode<T>) => never): void;
|
|
284
|
-
|
|
285
144
|
/**
|
|
286
|
-
*
|
|
145
|
+
* Called by implementations when a producer's signal is read.
|
|
146
|
+
*/
|
|
147
|
+
declare function producerAccessed(node: ReactiveNode): void;
|
|
148
|
+
/**
|
|
149
|
+
* Increment the global epoch counter.
|
|
287
150
|
*
|
|
288
|
-
*
|
|
151
|
+
* Called by source producers (that is, not computeds) whenever their values change.
|
|
289
152
|
*/
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
153
|
+
declare function producerIncrementEpoch(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Ensure this producer's `version` is up-to-date.
|
|
156
|
+
*/
|
|
157
|
+
declare function producerUpdateValueVersion(node: ReactiveNode): void;
|
|
158
|
+
/**
|
|
159
|
+
* Propagate a dirty notification to live consumers of this producer.
|
|
160
|
+
*/
|
|
161
|
+
declare function producerNotifyConsumers(node: ReactiveNode): void;
|
|
162
|
+
/**
|
|
163
|
+
* Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,
|
|
164
|
+
* based on the current consumer context.
|
|
165
|
+
*/
|
|
166
|
+
declare function producerUpdatesAllowed(): boolean;
|
|
167
|
+
declare function consumerMarkDirty(node: ReactiveNode): void;
|
|
168
|
+
declare function producerMarkClean(node: ReactiveNode): void;
|
|
169
|
+
/**
|
|
170
|
+
* Prepare this consumer to run a computation in its reactive context.
|
|
171
|
+
*
|
|
172
|
+
* Must be called by subclasses which represent reactive computations, before those computations
|
|
173
|
+
* begin.
|
|
174
|
+
*/
|
|
175
|
+
declare function consumerBeforeComputation(node: ReactiveNode | null): ReactiveNode | null;
|
|
176
|
+
/**
|
|
177
|
+
* Finalize this consumer's state after a reactive computation has run.
|
|
178
|
+
*
|
|
179
|
+
* Must be called by subclasses which represent reactive computations, after those computations
|
|
180
|
+
* have finished.
|
|
181
|
+
*/
|
|
182
|
+
declare function consumerAfterComputation(node: ReactiveNode | null, prevConsumer: ReactiveNode | null): void;
|
|
183
|
+
/**
|
|
184
|
+
* Determine whether this consumer has any dependencies which have changed since the last time
|
|
185
|
+
* they were read.
|
|
186
|
+
*/
|
|
187
|
+
declare function consumerPollProducersForChange(node: ReactiveNode): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Disconnect this consumer from the graph.
|
|
190
|
+
*/
|
|
191
|
+
declare function consumerDestroy(node: ReactiveNode): void;
|
|
293
192
|
|
|
294
|
-
|
|
295
|
-
|
|
193
|
+
/**
|
|
194
|
+
* A computation, which derives a value from a declarative reactive expression.
|
|
195
|
+
*
|
|
196
|
+
* `Computed`s are both producers and consumers of reactivity.
|
|
197
|
+
*/
|
|
198
|
+
interface ComputedNode<T> extends ReactiveNode {
|
|
199
|
+
/**
|
|
200
|
+
* Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`,
|
|
201
|
+
* `ERROR`).
|
|
202
|
+
*/
|
|
203
|
+
value: T;
|
|
204
|
+
/**
|
|
205
|
+
* If `value` is `ERRORED`, the error caught from the last computation attempt which will
|
|
206
|
+
* be re-thrown.
|
|
207
|
+
*/
|
|
208
|
+
error: unknown;
|
|
209
|
+
/**
|
|
210
|
+
* The computation function which will produce a new value.
|
|
211
|
+
*/
|
|
212
|
+
computation: () => T;
|
|
213
|
+
equal: ValueEqualityFn<T>;
|
|
214
|
+
}
|
|
215
|
+
type ComputedGetter<T> = (() => T) & {
|
|
216
|
+
[SIGNAL]: ComputedNode<T>;
|
|
296
217
|
};
|
|
218
|
+
/**
|
|
219
|
+
* Create a computed signal which derives a reactive value from an expression.
|
|
220
|
+
*/
|
|
221
|
+
declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
|
|
297
222
|
|
|
298
|
-
|
|
299
|
-
|
|
223
|
+
type ComputationFn<S, D> = (source: S, previous?: {
|
|
224
|
+
source: S;
|
|
225
|
+
value: D;
|
|
226
|
+
}) => D;
|
|
227
|
+
interface LinkedSignalNode<S, D> extends ReactiveNode {
|
|
228
|
+
/**
|
|
229
|
+
* Value of the source signal that was used to derive the computed value.
|
|
230
|
+
*/
|
|
231
|
+
sourceValue: S;
|
|
232
|
+
/**
|
|
233
|
+
* Current state value, or one of the sentinel values (`UNSET`, `COMPUTING`,
|
|
234
|
+
* `ERROR`).
|
|
235
|
+
*/
|
|
236
|
+
value: D;
|
|
237
|
+
/**
|
|
238
|
+
* If `value` is `ERRORED`, the error caught from the last computation attempt which will
|
|
239
|
+
* be re-thrown.
|
|
240
|
+
*/
|
|
241
|
+
error: unknown;
|
|
242
|
+
/**
|
|
243
|
+
* The source function represents reactive dependency based on which the linked state is reset.
|
|
244
|
+
*/
|
|
245
|
+
source: () => S;
|
|
246
|
+
/**
|
|
247
|
+
* The computation function which will produce a new value based on the source and, optionally - previous values.
|
|
248
|
+
*/
|
|
249
|
+
computation: ComputationFn<S, D>;
|
|
250
|
+
equal: ValueEqualityFn<D>;
|
|
300
251
|
}
|
|
252
|
+
type LinkedSignalGetter<S, D> = (() => D) & {
|
|
253
|
+
[SIGNAL]: LinkedSignalNode<S, D>;
|
|
254
|
+
};
|
|
255
|
+
declare function createLinkedSignal<S, D>(sourceFn: () => S, computationFn: ComputationFn<S, D>, equalityFn?: ValueEqualityFn<D>): LinkedSignalGetter<S, D>;
|
|
256
|
+
declare function linkedSignalSetFn<S, D>(node: LinkedSignalNode<S, D>, newValue: D): void;
|
|
257
|
+
declare function linkedSignalUpdateFn<S, D>(node: LinkedSignalNode<S, D>, updater: (value: D) => D): void;
|
|
301
258
|
|
|
302
|
-
|
|
259
|
+
interface SignalNode<T> extends ReactiveNode {
|
|
303
260
|
value: T;
|
|
304
261
|
equal: ValueEqualityFn<T>;
|
|
305
262
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
263
|
+
type SignalBaseGetter<T> = (() => T) & {
|
|
264
|
+
readonly [SIGNAL]: unknown;
|
|
265
|
+
};
|
|
266
|
+
interface SignalGetter<T> extends SignalBaseGetter<T> {
|
|
267
|
+
readonly [SIGNAL]: SignalNode<T>;
|
|
268
|
+
}
|
|
312
269
|
/**
|
|
313
|
-
*
|
|
270
|
+
* Create a `Signal` that can be set or updated directly.
|
|
314
271
|
*/
|
|
315
|
-
|
|
272
|
+
declare function createSignal<T>(initialValue: T): SignalGetter<T>;
|
|
273
|
+
declare function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null;
|
|
274
|
+
declare function signalSetFn<T>(node: SignalNode<T>, newValue: T): void;
|
|
275
|
+
declare function signalUpdateFn<T>(node: SignalNode<T>, updater: (value: T) => T): void;
|
|
276
|
+
declare function runPostSignalSetFn(): void;
|
|
277
|
+
declare const SIGNAL_NODE: SignalNode<unknown>;
|
|
316
278
|
|
|
279
|
+
declare function setThrowInvalidWriteToSignalError(fn: <T>(node: SignalNode<T>) => never): void;
|
|
317
280
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
281
|
+
/**
|
|
282
|
+
* A cleanup function that can be optionally registered from the watch logic. If registered, the
|
|
283
|
+
* cleanup logic runs before the next watch execution.
|
|
284
|
+
*/
|
|
285
|
+
type WatchCleanupFn = () => void;
|
|
286
|
+
/**
|
|
287
|
+
* A callback passed to the watch function that makes it possible to register cleanup logic.
|
|
288
|
+
*/
|
|
289
|
+
type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void;
|
|
290
|
+
interface Watch {
|
|
323
291
|
notify(): void;
|
|
324
292
|
/**
|
|
325
293
|
* Execute the reactive expression in the context of this `Watch` consumer.
|
|
@@ -337,24 +305,19 @@ export declare interface Watch {
|
|
|
337
305
|
destroy(): void;
|
|
338
306
|
[SIGNAL]: WatchNode;
|
|
339
307
|
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* A cleanup function that can be optionally registered from the watch logic. If registered, the
|
|
343
|
-
* cleanup logic runs before the next watch execution.
|
|
344
|
-
*/
|
|
345
|
-
export declare type WatchCleanupFn = () => void;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* A callback passed to the watch function that makes it possible to register cleanup logic.
|
|
349
|
-
*/
|
|
350
|
-
export declare type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void;
|
|
351
|
-
|
|
352
|
-
declare interface WatchNode extends ReactiveNode {
|
|
308
|
+
interface WatchNode extends ReactiveNode {
|
|
353
309
|
hasRun: boolean;
|
|
354
310
|
fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null;
|
|
355
311
|
schedule: ((watch: Watch) => void) | null;
|
|
356
312
|
cleanupFn: WatchCleanupFn;
|
|
357
313
|
ref: Watch;
|
|
358
314
|
}
|
|
315
|
+
declare function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, schedule: (watch: Watch) => void, allowSignalWrites: boolean): Watch;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
|
|
319
|
+
* can, optionally, return a value.
|
|
320
|
+
*/
|
|
321
|
+
declare function untracked<T>(nonReactiveReadsFn: () => T): T;
|
|
359
322
|
|
|
360
|
-
export { }
|
|
323
|
+
export { type ComputationFn, type ComputedNode, type LinkedSignalGetter, type LinkedSignalNode, REACTIVE_NODE, type Reactive, type ReactiveNode, SIGNAL, SIGNAL_NODE, type SignalGetter, type SignalNode, type ValueEqualityFn, type Watch, type WatchCleanupFn, type WatchCleanupRegisterFn, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createComputed, createLinkedSignal, createSignal, createWatch, defaultEquals, getActiveConsumer, isInNotificationPhase, isReactive, linkedSignalSetFn, linkedSignalUpdateFn, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, runPostSignalSetFn, setActiveConsumer, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalSetFn, signalUpdateFn, untracked };
|
package/rxjs-interop/index.d.ts
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-next.
|
|
2
|
+
* @license Angular v20.0.0-next.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import { DestroyRef } from '@angular/core';
|
|
10
|
-
import { Injector } from '@angular/core';
|
|
11
|
-
import { MonoTypeOperatorFunction } from 'rxjs';
|
|
12
|
-
import { Observable } from 'rxjs';
|
|
13
|
-
import { OutputOptions } from '@angular/core';
|
|
14
|
-
import { OutputRef } from '@angular/core';
|
|
15
|
-
import { ResourceLoaderParams } from '@angular/core';
|
|
16
|
-
import { ResourceRef } from '@angular/core';
|
|
17
|
-
import { Signal } from '@angular/core';
|
|
18
|
-
import { Subscribable } from 'rxjs';
|
|
7
|
+
import { OutputOptions, OutputRef, DestroyRef, Signal, Injector, BaseResourceOptions, ResourceLoaderParams, ResourceRef } from '@angular/core';
|
|
8
|
+
import { Observable, MonoTypeOperatorFunction, Subscribable } from 'rxjs';
|
|
19
9
|
import { ValueEqualityFn } from '@angular/core/primitives/signals';
|
|
20
10
|
|
|
21
11
|
/**
|
|
@@ -42,7 +32,7 @@ import { ValueEqualityFn } from '@angular/core/primitives/signals';
|
|
|
42
32
|
*
|
|
43
33
|
* @publicApi
|
|
44
34
|
*/
|
|
45
|
-
|
|
35
|
+
declare function outputFromObservable<T>(observable: Observable<T>, opts?: OutputOptions): OutputRef<T>;
|
|
46
36
|
|
|
47
37
|
/**
|
|
48
38
|
* Converts an Angular output declared via `output()` or `outputFromObservable()`
|
|
@@ -52,45 +42,7 @@ export declare function outputFromObservable<T>(observable: Observable<T>, opts?
|
|
|
52
42
|
*
|
|
53
43
|
* @publicApi
|
|
54
44
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Operator which makes the application unstable until the observable emits, complets, errors, or is unsubscribed.
|
|
59
|
-
*
|
|
60
|
-
* Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.
|
|
61
|
-
*
|
|
62
|
-
* @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).
|
|
63
|
-
*
|
|
64
|
-
* @experimental
|
|
65
|
-
*/
|
|
66
|
-
export declare function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T>;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the
|
|
70
|
-
* resource's value.
|
|
71
|
-
*
|
|
72
|
-
* @experimental
|
|
73
|
-
*/
|
|
74
|
-
export declare function rxResource<T, R>(opts: RxResourceOptions<T, R> & {
|
|
75
|
-
defaultValue: NoInfer<T>;
|
|
76
|
-
}): ResourceRef<T>;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the
|
|
80
|
-
* resource's value.
|
|
81
|
-
*
|
|
82
|
-
* @experimental
|
|
83
|
-
*/
|
|
84
|
-
export declare function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Like `ResourceOptions` but uses an RxJS-based `loader`.
|
|
88
|
-
*
|
|
89
|
-
* @experimental
|
|
90
|
-
*/
|
|
91
|
-
export declare interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {
|
|
92
|
-
loader: (params: ResourceLoaderParams<R>) => Observable<T>;
|
|
93
|
-
}
|
|
45
|
+
declare function outputToObservable<T>(ref: OutputRef<T>): Observable<T>;
|
|
94
46
|
|
|
95
47
|
/**
|
|
96
48
|
* Operator which completes the Observable when the calling context (component, directive, service,
|
|
@@ -102,25 +54,14 @@ export declare interface RxResourceOptions<T, R> extends BaseResourceOptions<T,
|
|
|
102
54
|
*
|
|
103
55
|
* @publicApi
|
|
104
56
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Exposes the value of an Angular `Signal` as an RxJS `Observable`.
|
|
109
|
-
*
|
|
110
|
-
* The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.
|
|
111
|
-
*
|
|
112
|
-
* `toObservable` must be called in an injection context unless an injector is provided via options.
|
|
113
|
-
*
|
|
114
|
-
* @developerPreview
|
|
115
|
-
*/
|
|
116
|
-
export declare function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T>;
|
|
57
|
+
declare function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T>;
|
|
117
58
|
|
|
118
59
|
/**
|
|
119
60
|
* Options for `toObservable`.
|
|
120
61
|
*
|
|
121
62
|
* @developerPreview
|
|
122
63
|
*/
|
|
123
|
-
|
|
64
|
+
interface ToObservableOptions {
|
|
124
65
|
/**
|
|
125
66
|
* The `Injector` to use when creating the underlying `effect` which watches the signal.
|
|
126
67
|
*
|
|
@@ -129,35 +70,23 @@ export declare interface ToObservableOptions {
|
|
|
129
70
|
*/
|
|
130
71
|
injector?: Injector;
|
|
131
72
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
requireSync?: false;
|
|
143
|
-
}): Signal<T | null>;
|
|
144
|
-
|
|
145
|
-
export declare function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T>> & {
|
|
146
|
-
initialValue?: undefined;
|
|
147
|
-
requireSync: true;
|
|
148
|
-
}): Signal<T>;
|
|
149
|
-
|
|
150
|
-
export declare function toSignal<T, const U extends T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | U>> & {
|
|
151
|
-
initialValue: U;
|
|
152
|
-
requireSync?: false;
|
|
153
|
-
}): Signal<T | U>;
|
|
73
|
+
/**
|
|
74
|
+
* Exposes the value of an Angular `Signal` as an RxJS `Observable`.
|
|
75
|
+
*
|
|
76
|
+
* The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.
|
|
77
|
+
*
|
|
78
|
+
* `toObservable` must be called in an injection context unless an injector is provided via options.
|
|
79
|
+
*
|
|
80
|
+
* @developerPreview
|
|
81
|
+
*/
|
|
82
|
+
declare function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T>;
|
|
154
83
|
|
|
155
84
|
/**
|
|
156
85
|
* Options for `toSignal`.
|
|
157
86
|
*
|
|
158
87
|
* @publicApi
|
|
159
88
|
*/
|
|
160
|
-
|
|
89
|
+
interface ToSignalOptions<T> {
|
|
161
90
|
/**
|
|
162
91
|
* Initial value for the signal produced by `toSignal`.
|
|
163
92
|
*
|
|
@@ -204,7 +133,58 @@ export declare interface ToSignalOptions<T> {
|
|
|
204
133
|
*/
|
|
205
134
|
equal?: ValueEqualityFn<T>;
|
|
206
135
|
}
|
|
136
|
+
declare function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;
|
|
137
|
+
declare function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | undefined>> & {
|
|
138
|
+
initialValue?: undefined;
|
|
139
|
+
requireSync?: false;
|
|
140
|
+
}): Signal<T | undefined>;
|
|
141
|
+
declare function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | null>> & {
|
|
142
|
+
initialValue?: null;
|
|
143
|
+
requireSync?: false;
|
|
144
|
+
}): Signal<T | null>;
|
|
145
|
+
declare function toSignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T>> & {
|
|
146
|
+
initialValue?: undefined;
|
|
147
|
+
requireSync: true;
|
|
148
|
+
}): Signal<T>;
|
|
149
|
+
declare function toSignal<T, const U extends T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | U>> & {
|
|
150
|
+
initialValue: U;
|
|
151
|
+
requireSync?: false;
|
|
152
|
+
}): Signal<T | U>;
|
|
207
153
|
|
|
208
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Operator which makes the application unstable until the observable emits, complets, errors, or is unsubscribed.
|
|
156
|
+
*
|
|
157
|
+
* Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.
|
|
158
|
+
*
|
|
159
|
+
* @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).
|
|
160
|
+
*
|
|
161
|
+
* @experimental
|
|
162
|
+
*/
|
|
163
|
+
declare function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Like `ResourceOptions` but uses an RxJS-based `loader`.
|
|
167
|
+
*
|
|
168
|
+
* @experimental
|
|
169
|
+
*/
|
|
170
|
+
interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {
|
|
171
|
+
loader: (params: ResourceLoaderParams<R>) => Observable<T>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the
|
|
175
|
+
* resource's value.
|
|
176
|
+
*
|
|
177
|
+
* @experimental
|
|
178
|
+
*/
|
|
179
|
+
declare function rxResource<T, R>(opts: RxResourceOptions<T, R> & {
|
|
180
|
+
defaultValue: NoInfer<T>;
|
|
181
|
+
}): ResourceRef<T>;
|
|
182
|
+
/**
|
|
183
|
+
* Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the
|
|
184
|
+
* resource's value.
|
|
185
|
+
*
|
|
186
|
+
* @experimental
|
|
187
|
+
*/
|
|
188
|
+
declare function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;
|
|
209
189
|
|
|
210
|
-
export { }
|
|
190
|
+
export { type RxResourceOptions, type ToObservableOptions, type ToSignalOptions, outputFromObservable, outputToObservable, pendingUntilEvent, rxResource, takeUntilDestroyed, toObservable, toSignal };
|