@angular/core 20.3.12 → 20.3.14
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.d.ts +8 -1
- package/chrome_dev_tools_performance.d.d.ts +11 -1
- package/discovery.d.d.ts +33 -2
- package/effect.d.d.ts +1 -1
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/core.mjs +29 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +12 -2
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/effect.mjs +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/resource.mjs +7 -1
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +22 -3
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +11 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/formatter.d.d.ts +1 -1
- package/index.d.ts +54 -3
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +11 -1
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
- package/schematics/bundles/apply_import_manager-D4J7SXHI.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/compiler_host-C306_97v.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/document-core.cjs +1 -1
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/index-AeYmwRJL.cjs +11 -11
- package/schematics/bundles/index-u3tqvIQa.cjs +1 -1
- package/schematics/bundles/inject-flags.cjs +1 -1
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/migrate_ts_type_references-D0f8FXVW.cjs +1 -1
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +1 -1
- package/schematics/bundles/project_paths-CMd3bdgw.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-CopGppNj.cjs +2 -2
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +1 -1
- package/schematics/bundles/router-current-navigation.cjs +1 -1
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +1 -1
- package/schematics/bundles/signal-queries-migration.cjs +1 -1
- package/schematics/bundles/signals.cjs +1 -1
- package/schematics/bundles/standalone-migration.cjs +1 -1
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +1 -1
- package/testing/index.d.ts +1 -1
- package/weak_ref.d.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.14
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -22,6 +22,8 @@ import './effect.mjs';
|
|
|
22
22
|
* passed explicitly to use `takeUntilDestroyed` outside of an [injection
|
|
23
23
|
* context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.
|
|
24
24
|
*
|
|
25
|
+
* @see [Unsubscribing with takeUntilDestroyed](ecosystem/rxjs-interop/take-until-destroyed)
|
|
26
|
+
*
|
|
25
27
|
* @publicApi 19.0
|
|
26
28
|
*/
|
|
27
29
|
function takeUntilDestroyed(destroyRef) {
|
|
@@ -94,6 +96,7 @@ class OutputFromObservableRef {
|
|
|
94
96
|
* nameChange = outputFromObservable(this.nameChange$);
|
|
95
97
|
* }
|
|
96
98
|
* ```
|
|
99
|
+
* @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)
|
|
97
100
|
*
|
|
98
101
|
* @publicApi 19.0
|
|
99
102
|
*/
|
|
@@ -109,6 +112,8 @@ function outputFromObservable(observable, opts) {
|
|
|
109
112
|
*
|
|
110
113
|
* You can subscribe to the output via `Observable.subscribe` then.
|
|
111
114
|
*
|
|
115
|
+
* @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)
|
|
116
|
+
*
|
|
112
117
|
* @publicApi 19.0
|
|
113
118
|
*/
|
|
114
119
|
function outputToObservable(ref) {
|
|
@@ -134,6 +139,9 @@ function outputToObservable(ref) {
|
|
|
134
139
|
*
|
|
135
140
|
* `toObservable` must be called in an injection context unless an injector is provided via options.
|
|
136
141
|
*
|
|
142
|
+
* @see [RxJS interop with Angular signals](ecosystem/rxjs-interop)
|
|
143
|
+
* @see [Create an RxJS Observable from a signal with toObservable](ecosystem/rxjs-interop#create-an-rxjs-observable-from-a-signal-with-toobservable)
|
|
144
|
+
*
|
|
137
145
|
* @publicApi 20.0
|
|
138
146
|
*/
|
|
139
147
|
function toObservable(source, options) {
|
|
@@ -181,6 +189,8 @@ function toObservable(source, options) {
|
|
|
181
189
|
* If the subscription should persist until the `Observable` itself completes, the `manualCleanup`
|
|
182
190
|
* option can be specified instead, which disables the automatic subscription teardown. No injection
|
|
183
191
|
* context is needed in this configuration as well.
|
|
192
|
+
*
|
|
193
|
+
* @see [RxJS interop with Angular signals](ecosystem/rxjs-interop)
|
|
184
194
|
*/
|
|
185
195
|
function toSignal(source, options) {
|
|
186
196
|
typeof ngDevMode !== 'undefined' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_signal.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/rx_resource.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @publicApi 19.0\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n ngDevMode && assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((subscriber) => {\n if (destroyRef.destroyed) {\n subscriber.next();\n return;\n }\n const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @publicApi 19.0\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '../../src/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n * It creates an observable that represents the stream of \"events firing\" in an output.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @publicApi 19.0\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n const unregisterOnDestroy = destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => {\n subscription.unsubscribe();\n unregisterOnDestroy?.();\n };\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '../../src/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @publicApi 20.0\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n * As it reflects a state, the observable will always emit the latest value upon subscription.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @publicApi 20.0\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(toObservable);\n }\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {ValueEqualityFn} from '../../primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi 20.0\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n\n if (ngDevMode && requiresCleanup && !options?.injector) {\n assertInInjectionContext(toSignal);\n }\n\n const cleanupRef = requiresCleanup\n ? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n let destroyUnregisterFn: (() => void) | undefined;\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n state.set({kind: StateKind.Error, error});\n destroyUnregisterFn?.();\n },\n complete: () => {\n destroyUnregisterFn?.();\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n destroyUnregisterFn = cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, completes, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @developerPreview 20.0\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n ngDevMode && assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ResourceStreamItem,\n} from '../../src/core';\nimport {Observable, Subscription} from 'rxjs';\nimport {encapsulateResourceError} from '../../src/resource/resource';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n stream: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n if (ngDevMode && !opts?.injector) {\n assertInInjectionContext(rxResource);\n }\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription | undefined;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub?.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n function send(value: ResourceStreamItem<T>): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n // TODO(alxhub): remove after g3 updated to rename loader -> stream\n const streamFn = opts.stream ?? (opts as {loader?: RxResourceOptions<T, R>['stream']}).loader;\n if (streamFn === undefined) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.MUST_PROVIDE_STREAM_OPTION,\n ngDevMode && `Must provide \\`stream\\` option.`,\n );\n }\n\n sub = streamFn(params).subscribe({\n next: (value) => send({value}),\n error: (error: unknown) => {\n send({error: encapsulateResourceError(error)});\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["ɵRuntimeError","ɵgetOutputDestroyRef"],"mappings":";;;;;;;;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,SAAS,IAAI,w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AAC,KAAc,KAAI;oBACxB,IAAI,CAAC,EAAC,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,EAAC,CAAC;oBAC9C,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;iBACzD;gBACD,QAAQ,EAAE,MAAK;oBACb,IAAI,OAAO,EAAE;AACX,wBAAA,IAAI,CAAC;AACH,4BAAA,KAAK,EAAE,IAAIA,YAAa,wEAEtB,SAAS,IAAI,6CAA6C,CAC3D;AACF,yBAAA,CAAC;;oBAEJ,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;iBACzD;AACF,aAAA,CAAC;AAEF,YAAA,OAAO,OAAO;SACf;AACF,KAAA,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_signal.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/rx_resource.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @see [Unsubscribing with takeUntilDestroyed](ecosystem/rxjs-interop/take-until-destroyed)\n *\n * @publicApi 19.0\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n ngDevMode && assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((subscriber) => {\n if (destroyRef.destroyed) {\n subscriber.next();\n return;\n }\n const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n * @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)\n *\n * @publicApi 19.0\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '../../src/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n * It creates an observable that represents the stream of \"events firing\" in an output.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)\n *\n * @publicApi 19.0\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n const unregisterOnDestroy = destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => {\n subscription.unsubscribe();\n unregisterOnDestroy?.();\n };\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '../../src/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @publicApi 20.0\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n * As it reflects a state, the observable will always emit the latest value upon subscription.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @see [RxJS interop with Angular signals](ecosystem/rxjs-interop)\n * @see [Create an RxJS Observable from a signal with toObservable](ecosystem/rxjs-interop#create-an-rxjs-observable-from-a-signal-with-toobservable)\n *\n * @publicApi 20.0\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(toObservable);\n }\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {ValueEqualityFn} from '../../primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi 20.0\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n *\n * @see [RxJS interop with Angular signals](ecosystem/rxjs-interop)\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n\n if (ngDevMode && requiresCleanup && !options?.injector) {\n assertInInjectionContext(toSignal);\n }\n\n const cleanupRef = requiresCleanup\n ? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n let destroyUnregisterFn: (() => void) | undefined;\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n state.set({kind: StateKind.Error, error});\n destroyUnregisterFn?.();\n },\n complete: () => {\n destroyUnregisterFn?.();\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n destroyUnregisterFn = cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, completes, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @developerPreview 20.0\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n ngDevMode && assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ResourceStreamItem,\n} from '../../src/core';\nimport {Observable, Subscription} from 'rxjs';\nimport {encapsulateResourceError} from '../../src/resource/resource';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n stream: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @see [Using rxResource for async data](ecosystem/rxjs-interop#using-rxresource-for-async-data)\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n if (ngDevMode && !opts?.injector) {\n assertInInjectionContext(rxResource);\n }\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription | undefined;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub?.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n function send(value: ResourceStreamItem<T>): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n // TODO(alxhub): remove after g3 updated to rename loader -> stream\n const streamFn = opts.stream ?? (opts as {loader?: RxResourceOptions<T, R>['stream']}).loader;\n if (streamFn === undefined) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.MUST_PROVIDE_STREAM_OPTION,\n ngDevMode && `Must provide \\`stream\\` option.`,\n );\n }\n\n sub = streamFn(params).subscribe({\n next: (value) => send({value}),\n error: (error: unknown) => {\n send({error: encapsulateResourceError(error)});\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["ɵRuntimeError","ɵgetOutputDestroyRef"],"mappings":";;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;AAWG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,SAAS,IAAI,wBAAwB,CAAC,kBAAkB,CAAC;AACzD,QAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGjC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAO,CAAC,UAAU,KAAI;AACrD,QAAA,IAAI,UAAU,CAAC,SAAS,EAAE;YACxB,UAAU,CAAC,IAAI,EAAE;YACjB;;AAEF,QAAA,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC3E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,yBAAA,CAAC;;oBAEJ,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;iBACzD;AACF,aAAA,CAAC;AAEF,YAAA,OAAO,OAAO;SACf;AACF,KAAA,CAAC;AACJ;;;;"}
|
package/fesm2022/signal.mjs
CHANGED
package/fesm2022/testing.mjs
CHANGED
package/fesm2022/weak_ref.mjs
CHANGED
package/formatter.d.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.14
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -20,6 +20,8 @@ import '@angular/core/primitives/di';
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @publicAPI
|
|
23
|
+
* @see [Input aliases](guide/components/inputs#input-aliases)
|
|
24
|
+
* @see [Input transforms](guide/components/inputs#input-transforms)
|
|
23
25
|
*
|
|
24
26
|
* Options for signal inputs.
|
|
25
27
|
*/
|
|
@@ -108,6 +110,9 @@ interface InputSignal<T> extends InputSignalWithTransform<T, T> {
|
|
|
108
110
|
* The function exposes an API for also declaring required inputs via the
|
|
109
111
|
* `input.required` function.
|
|
110
112
|
*
|
|
113
|
+
* @see [Accepting data with input properties](guide/components/inputs)
|
|
114
|
+
* @see [Required inputs](guide/components/inputs#required-inputs)
|
|
115
|
+
* @see [Input transforms](guide/components/inputs#input-transforms)
|
|
111
116
|
* @publicAPI
|
|
112
117
|
* @docsPrivate Ignored because `input` is the canonical API entry.
|
|
113
118
|
*/
|
|
@@ -252,6 +257,10 @@ interface ModelSignal<T> extends WritableSignal<T>, InputSignal<T>, OutputRef<T>
|
|
|
252
257
|
* The function exposes an API for also declaring required models via the
|
|
253
258
|
* `model.required` function.
|
|
254
259
|
*
|
|
260
|
+
* @see [Two-way binding between components](guide/templates/two-way-binding#two-way-binding-between-components)
|
|
261
|
+
* @see [Model inputs](guide/components/inputs#model-inputs)
|
|
262
|
+
* @see [Customizing model inputs](guide/components/inputs#customizing-model-inputs)
|
|
263
|
+
*
|
|
255
264
|
* @publicAPI
|
|
256
265
|
* @docsPrivate Ignored because `model` is the canonical API entry.
|
|
257
266
|
*/
|
|
@@ -316,6 +325,9 @@ interface ModelFunction {
|
|
|
316
325
|
* this.firstName.set(newFirstName);
|
|
317
326
|
* }
|
|
318
327
|
* ```
|
|
328
|
+
* @see [Two-way binding between components](guide/templates/two-way-binding#two-way-binding-between-components)
|
|
329
|
+
* @see [Model inputs](guide/components/inputs#model-inputs)
|
|
330
|
+
* @see [Customizing model inputs](guide/components/inputs#customizing-model-inputs)
|
|
319
331
|
*
|
|
320
332
|
* @publicApi 19.0
|
|
321
333
|
* @initializerApiFunction
|
|
@@ -468,6 +480,8 @@ interface ViewChildFunction {
|
|
|
468
480
|
*
|
|
469
481
|
* @publicApi 19.0
|
|
470
482
|
* @initializerApiFunction
|
|
483
|
+
* @see [Referencing component children with queries](guide/components/queries)
|
|
484
|
+
* @see [Required queries](guide/components/queries#required-queries)
|
|
471
485
|
*/
|
|
472
486
|
declare const viewChild: ViewChildFunction;
|
|
473
487
|
declare function viewChildren<LocatorT>(locator: ProviderToken<LocatorT> | string, opts?: {
|
|
@@ -1624,6 +1638,8 @@ declare const Host: HostDecorator;
|
|
|
1624
1638
|
* from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in
|
|
1625
1639
|
* any asynchronous callbacks or after any `await` points.
|
|
1626
1640
|
*
|
|
1641
|
+
* @see [Run within an injection context](guide/di/dependency-injection-context#run-within-an-injection-context)
|
|
1642
|
+
*
|
|
1627
1643
|
* @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`
|
|
1628
1644
|
* is executing
|
|
1629
1645
|
* @param fn the closure to be run in the context of `injector`
|
|
@@ -1693,7 +1709,7 @@ interface ForwardRefFn {
|
|
|
1693
1709
|
* hideParent = input.required<boolean>();
|
|
1694
1710
|
* }
|
|
1695
1711
|
* ```
|
|
1696
|
-
*
|
|
1712
|
+
* @see [Resolve circular dependencies with a forward reference](guide/di/di-in-action#resolve-circular-dependencies-with-a-forward-reference)
|
|
1697
1713
|
* @publicApi
|
|
1698
1714
|
*/
|
|
1699
1715
|
declare function forwardRef(forwardRefFn: ForwardRefFn): Type$1<any>;
|
|
@@ -1729,7 +1745,8 @@ interface InjectableDecorator {
|
|
|
1729
1745
|
* provided and injected as a dependency.
|
|
1730
1746
|
*
|
|
1731
1747
|
* @see [Introduction to Services and DI](guide/di)
|
|
1732
|
-
* @see [
|
|
1748
|
+
* @see [Creating and using services](guide/di/creating-and-using-services)
|
|
1749
|
+
* @see [Defining dependency providers](guide/di/defining-dependency-providers)
|
|
1733
1750
|
*
|
|
1734
1751
|
* @usageNotes
|
|
1735
1752
|
*
|
|
@@ -1755,6 +1772,7 @@ interface InjectableDecorator {
|
|
|
1755
1772
|
/**
|
|
1756
1773
|
* Type of the Injectable metadata.
|
|
1757
1774
|
*
|
|
1775
|
+
*
|
|
1758
1776
|
* @publicApi
|
|
1759
1777
|
*/
|
|
1760
1778
|
interface Injectable {
|
|
@@ -1826,6 +1844,7 @@ declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => void)[]>;
|
|
|
1826
1844
|
* attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});
|
|
1827
1845
|
* }
|
|
1828
1846
|
* ```
|
|
1847
|
+
* @see [Injecting host element attributes](guide/components/host-elements#injecting-host-element-attributes)
|
|
1829
1848
|
* @publicApi
|
|
1830
1849
|
*/
|
|
1831
1850
|
declare class HostAttributeToken {
|
|
@@ -2170,6 +2189,7 @@ interface CreateComputedOptions<T> {
|
|
|
2170
2189
|
}
|
|
2171
2190
|
/**
|
|
2172
2191
|
* Create a computed `Signal` which derives a reactive value from an expression.
|
|
2192
|
+
* @see [Computed signals](guide/signals#computed-signals)
|
|
2173
2193
|
*/
|
|
2174
2194
|
declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
|
|
2175
2195
|
|
|
@@ -2189,6 +2209,7 @@ declare function linkedSignal<D>(computation: () => D, options?: {
|
|
|
2189
2209
|
* Note: The computation is reactive, meaning the linked signal will automatically update whenever any of the signals used within the computation change.
|
|
2190
2210
|
*
|
|
2191
2211
|
* @publicApi 20.0
|
|
2212
|
+
* @see [Dependent state with linkedSignal](guide/signals/linked-signal)
|
|
2192
2213
|
*/
|
|
2193
2214
|
declare function linkedSignal<S, D>(options: {
|
|
2194
2215
|
source: () => S;
|
|
@@ -2203,6 +2224,7 @@ declare function linkedSignal<S, D>(options: {
|
|
|
2203
2224
|
/**
|
|
2204
2225
|
* Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
|
|
2205
2226
|
* can, optionally, return a value.
|
|
2227
|
+
* @see [Reading without tracking dependencies](guide/signals#reading-without-tracking-dependencies)
|
|
2206
2228
|
*/
|
|
2207
2229
|
declare function untracked<T>(nonReactiveReadsFn: () => T): T;
|
|
2208
2230
|
|
|
@@ -2306,6 +2328,8 @@ interface AfterRenderOptions {
|
|
|
2306
2328
|
* }
|
|
2307
2329
|
* ```
|
|
2308
2330
|
*
|
|
2331
|
+
* @see [afterEveryRender and afterNextRender](guide/components/lifecycle#aftereveryrender-and-afternextrender)
|
|
2332
|
+
*
|
|
2309
2333
|
* @publicApi 20.0
|
|
2310
2334
|
*/
|
|
2311
2335
|
declare function afterEveryRender<E = never, W = never, M = never>(spec: {
|
|
@@ -2445,6 +2469,7 @@ declare function afterEveryRender(callback: VoidFunction, options?: AfterRenderO
|
|
|
2445
2469
|
* ```
|
|
2446
2470
|
*
|
|
2447
2471
|
* @publicApi 20.0
|
|
2472
|
+
* @see [afterEveryRender and afterNextRender](guide/components/lifecycle#aftereveryrender-and-afternextrender)
|
|
2448
2473
|
*/
|
|
2449
2474
|
declare function afterNextRender<E = never, W = never, M = never>(spec: {
|
|
2450
2475
|
earlyRead?: () => E;
|
|
@@ -3942,6 +3967,7 @@ declare class ChangeDetectionSchedulerImpl implements ChangeDetectionScheduler {
|
|
|
3942
3967
|
* @publicApi 20.2
|
|
3943
3968
|
*
|
|
3944
3969
|
* @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}
|
|
3970
|
+
* @see [Angular without ZoneJS (Zoneless)](guide/zoneless)
|
|
3945
3971
|
*/
|
|
3946
3972
|
declare function provideZonelessChangeDetection(): EnvironmentProviders;
|
|
3947
3973
|
|
|
@@ -3985,6 +4011,9 @@ declare class PendingTasksInternal implements OnDestroy {
|
|
|
3985
4011
|
* taskCleanup();
|
|
3986
4012
|
* ```
|
|
3987
4013
|
*
|
|
4014
|
+
*
|
|
4015
|
+
* @see [PendingTasks for Server Side Rendering (SSR)](guide/zoneless#pendingtasks-for-server-side-rendering-ssr)
|
|
4016
|
+
*
|
|
3988
4017
|
* @publicApi 20.0
|
|
3989
4018
|
*/
|
|
3990
4019
|
declare class PendingTasks {
|
|
@@ -4735,6 +4764,8 @@ declare const INTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => voi
|
|
|
4735
4764
|
*
|
|
4736
4765
|
* The listeners added are for the window's 'unhandledrejection' and 'error' events.
|
|
4737
4766
|
*
|
|
4767
|
+
* @see [Global error listeners](best-practices/error-handling#global-error-listeners)
|
|
4768
|
+
*
|
|
4738
4769
|
* @publicApi
|
|
4739
4770
|
*/
|
|
4740
4771
|
declare function provideBrowserGlobalErrorListeners(): EnvironmentProviders;
|
|
@@ -5101,18 +5132,23 @@ declare function withDomHydration(): EnvironmentProviders;
|
|
|
5101
5132
|
/**
|
|
5102
5133
|
* Returns a set of providers required to setup support for i18n hydration.
|
|
5103
5134
|
* Requires hydration to be enabled separately.
|
|
5135
|
+
* @see [I18N](guide/hydration#i18n)
|
|
5104
5136
|
*/
|
|
5105
5137
|
declare function withI18nSupport(): Provider[];
|
|
5106
5138
|
/**
|
|
5107
5139
|
* Returns a set of providers required to setup support for incremental hydration.
|
|
5108
5140
|
* Requires hydration to be enabled separately.
|
|
5109
5141
|
* Enabling incremental hydration also enables event replay for the entire app.
|
|
5142
|
+
* @see [Incremental Hydration](guide/incremental-hydration#how-do-you-enable-incremental-hydration-in-angular)
|
|
5110
5143
|
*/
|
|
5111
5144
|
declare function withIncrementalHydration(): Provider[];
|
|
5112
5145
|
|
|
5113
5146
|
/**
|
|
5114
5147
|
* Returns a set of providers required to setup support for event replay.
|
|
5115
5148
|
* Requires hydration to be enabled separately.
|
|
5149
|
+
*
|
|
5150
|
+
* @see [Capturing and replaying event](guide/hydration#capturing-and-replaying-events)
|
|
5151
|
+
*
|
|
5116
5152
|
*/
|
|
5117
5153
|
declare function withEventReplay(): Provider[];
|
|
5118
5154
|
|
|
@@ -5520,6 +5556,8 @@ declare function _sanitizeUrl(url: string): string;
|
|
|
5520
5556
|
* ```
|
|
5521
5557
|
* @param value Value to be transformed.
|
|
5522
5558
|
*
|
|
5559
|
+
* @see [Built-in transformations](guide/components/inputs#built-in-transformations)
|
|
5560
|
+
*
|
|
5523
5561
|
* @publicApi
|
|
5524
5562
|
*/
|
|
5525
5563
|
declare function booleanAttribute(value: unknown): boolean;
|
|
@@ -5535,6 +5573,7 @@ declare function booleanAttribute(value: unknown): boolean;
|
|
|
5535
5573
|
* ```
|
|
5536
5574
|
*
|
|
5537
5575
|
* @publicApi
|
|
5576
|
+
* @see [Built-in transformations](guide/components/inputs#built-in-transformations)
|
|
5538
5577
|
*/
|
|
5539
5578
|
declare function numberAttribute(value: unknown, fallbackValue?: number): number;
|
|
5540
5579
|
|
|
@@ -5597,6 +5636,8 @@ declare function disableProfiling(): void;
|
|
|
5597
5636
|
* `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new
|
|
5598
5637
|
* request object becomes available, which could prematurely abort mutations.
|
|
5599
5638
|
*
|
|
5639
|
+
* @see [Async reactivity with resources](guide/signals/resource)
|
|
5640
|
+
*
|
|
5600
5641
|
* @experimental 19.0
|
|
5601
5642
|
*/
|
|
5602
5643
|
declare function resource<T, R>(options: ResourceOptions<T, R> & {
|
|
@@ -5611,6 +5652,7 @@ declare function resource<T, R>(options: ResourceOptions<T, R> & {
|
|
|
5611
5652
|
* request object becomes available, which could prematurely abort mutations.
|
|
5612
5653
|
*
|
|
5613
5654
|
* @experimental 19.0
|
|
5655
|
+
* @see [Async reactivity with resources](guide/signals/resource)
|
|
5614
5656
|
*/
|
|
5615
5657
|
declare function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined>;
|
|
5616
5658
|
type WrappedRequest = {
|
|
@@ -9213,6 +9255,9 @@ declare const depsTracker: DepsTracker;
|
|
|
9213
9255
|
* * `bindings` (optional): Bindings to apply to the root component.
|
|
9214
9256
|
* @returns ComponentRef instance that represents a given Component.
|
|
9215
9257
|
*
|
|
9258
|
+
* @see [Host view using `ViewContainerRef.createComponent`](guide/components/programmatic-rendering#host-view-using-viewcontainerrefcreatecomponent)
|
|
9259
|
+
* @see [Popup attached to `document.body` with `createComponent` + `hostElement`](guide/components/programmatic-rendering#popup-attached-to-documentbody-with-createcomponent--hostelement)
|
|
9260
|
+
*
|
|
9216
9261
|
* @publicApi
|
|
9217
9262
|
*/
|
|
9218
9263
|
declare function createComponent<C>(component: Type$1<C>, options: {
|
|
@@ -9342,6 +9387,8 @@ declare function mergeApplicationConfig(...configs: ApplicationConfig[]): Applic
|
|
|
9342
9387
|
*
|
|
9343
9388
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request `Request` on MDN}
|
|
9344
9389
|
*
|
|
9390
|
+
* @see [Accessing Request and Response via DI](guide/ssr#accessing-request-and-response-via-di)
|
|
9391
|
+
*
|
|
9345
9392
|
* @publicApi
|
|
9346
9393
|
*/
|
|
9347
9394
|
declare const REQUEST: InjectionToken<Request | null>;
|
|
@@ -9362,6 +9409,7 @@ declare const REQUEST: InjectionToken<Request | null>;
|
|
|
9362
9409
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response `ResponseInit` on MDN}
|
|
9363
9410
|
*
|
|
9364
9411
|
* @publicApi
|
|
9412
|
+
* @see [Accessing Request and Response via DI](guide/ssr#accessing-request-and-response-via-di)
|
|
9365
9413
|
*/
|
|
9366
9414
|
declare const RESPONSE_INIT: InjectionToken<ResponseInit | null>;
|
|
9367
9415
|
/**
|
|
@@ -9373,6 +9421,7 @@ declare const RESPONSE_INIT: InjectionToken<ResponseInit | null>;
|
|
|
9373
9421
|
* This token is only available during server-side rendering and will be `null` in other contexts.
|
|
9374
9422
|
*
|
|
9375
9423
|
* @publicApi
|
|
9424
|
+
* @see [Accessing Request and Response via DI](guide/ssr#accessing-request-and-response-via-di)
|
|
9376
9425
|
*/
|
|
9377
9426
|
declare const REQUEST_CONTEXT: InjectionToken<unknown>;
|
|
9378
9427
|
|
|
@@ -9381,6 +9430,8 @@ declare const REQUEST_CONTEXT: InjectionToken<unknown>;
|
|
|
9381
9430
|
* In a browser and SSR this is the DOM Document.
|
|
9382
9431
|
* When using SSR, that document is created by [Domino](https://github.com/angular/domino).
|
|
9383
9432
|
*
|
|
9433
|
+
* @see [Accessing Document via DI](guide/ssr#accessing-document-via-di)
|
|
9434
|
+
*
|
|
9384
9435
|
* @publicApi
|
|
9385
9436
|
*/
|
|
9386
9437
|
declare const DOCUMENT: InjectionToken<Document>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/core",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.14",
|
|
4
4
|
"description": "Angular - the core framework",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tslib": "^2.3.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/compiler": "20.3.
|
|
49
|
+
"@angular/compiler": "20.3.14",
|
|
50
50
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
51
51
|
"zone.js": "~0.15.0"
|
|
52
52
|
},
|
package/primitives/di/index.d.ts
CHANGED
package/rxjs-interop/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.14
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -31,6 +31,7 @@ import { Observable, MonoTypeOperatorFunction, Subscribable } from 'rxjs';
|
|
|
31
31
|
* nameChange = outputFromObservable(this.nameChange$);
|
|
32
32
|
* }
|
|
33
33
|
* ```
|
|
34
|
+
* @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)
|
|
34
35
|
*
|
|
35
36
|
* @publicApi 19.0
|
|
36
37
|
*/
|
|
@@ -43,6 +44,8 @@ declare function outputFromObservable<T>(observable: Observable<T>, opts?: Outpu
|
|
|
43
44
|
*
|
|
44
45
|
* You can subscribe to the output via `Observable.subscribe` then.
|
|
45
46
|
*
|
|
47
|
+
* @see [RxJS interop with component and directive outputs](ecosystem/rxjs-interop/output-interop)
|
|
48
|
+
*
|
|
46
49
|
* @publicApi 19.0
|
|
47
50
|
*/
|
|
48
51
|
declare function outputToObservable<T>(ref: OutputRef<T>): Observable<T>;
|
|
@@ -55,6 +58,8 @@ declare function outputToObservable<T>(ref: OutputRef<T>): Observable<T>;
|
|
|
55
58
|
* passed explicitly to use `takeUntilDestroyed` outside of an [injection
|
|
56
59
|
* context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.
|
|
57
60
|
*
|
|
61
|
+
* @see [Unsubscribing with takeUntilDestroyed](ecosystem/rxjs-interop/take-until-destroyed)
|
|
62
|
+
*
|
|
58
63
|
* @publicApi 19.0
|
|
59
64
|
*/
|
|
60
65
|
declare function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T>;
|
|
@@ -81,6 +86,9 @@ interface ToObservableOptions {
|
|
|
81
86
|
*
|
|
82
87
|
* `toObservable` must be called in an injection context unless an injector is provided via options.
|
|
83
88
|
*
|
|
89
|
+
* @see [RxJS interop with Angular signals](ecosystem/rxjs-interop)
|
|
90
|
+
* @see [Create an RxJS Observable from a signal with toObservable](ecosystem/rxjs-interop#create-an-rxjs-observable-from-a-signal-with-toobservable)
|
|
91
|
+
*
|
|
84
92
|
* @publicApi 20.0
|
|
85
93
|
*/
|
|
86
94
|
declare function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T>;
|
|
@@ -169,6 +177,8 @@ interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {
|
|
|
169
177
|
* Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the
|
|
170
178
|
* resource's value.
|
|
171
179
|
*
|
|
180
|
+
* @see [Using rxResource for async data](ecosystem/rxjs-interop#using-rxresource-for-async-data)
|
|
181
|
+
*
|
|
172
182
|
* @experimental
|
|
173
183
|
*/
|
|
174
184
|
declare function rxResource<T, R>(opts: RxResourceOptions<T, R> & {
|