@angular/core 17.0.0-next.2 → 17.0.0-next.4
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/esm2022/src/core_reactivity_export_internal.mjs +3 -3
- package/esm2022/src/core_render3_private_export.mjs +2 -2
- package/esm2022/src/di/initializer_token.mjs +1 -1
- package/esm2022/src/di/internal_tokens.mjs +1 -1
- package/esm2022/src/di/r3_injector.mjs +3 -4
- package/esm2022/src/hydration/annotate.mjs +9 -6
- package/esm2022/src/hydration/cleanup.mjs +2 -2
- package/esm2022/src/linker/template_ref.mjs +3 -3
- package/esm2022/src/linker/view_container_ref.mjs +80 -25
- package/esm2022/src/metadata/directives.mjs +1 -1
- package/esm2022/src/metadata/resource_loading.mjs +27 -14
- package/esm2022/src/render3/after_render_hooks.mjs +83 -49
- package/esm2022/src/render3/component.mjs +4 -3
- package/esm2022/src/render3/component_ref.mjs +3 -4
- package/esm2022/src/render3/di.mjs +1 -1
- package/esm2022/src/render3/index.mjs +2 -2
- package/esm2022/src/render3/instructions/all.mjs +2 -1
- package/esm2022/src/render3/instructions/change_detection.mjs +7 -8
- package/esm2022/src/render3/instructions/component_instance.mjs +23 -0
- package/esm2022/src/render3/instructions/control_flow.mjs +20 -4
- package/esm2022/src/render3/instructions/defer.mjs +100 -39
- package/esm2022/src/render3/instructions/shared.mjs +20 -14
- package/esm2022/src/render3/interfaces/defer.mjs +1 -1
- package/esm2022/src/render3/interfaces/definition.mjs +1 -1
- package/esm2022/src/render3/interfaces/injector.mjs +1 -1
- package/esm2022/src/render3/interfaces/node.mjs +16 -1
- package/esm2022/src/render3/interfaces/styling.mjs +4 -7
- package/esm2022/src/render3/interfaces/view.mjs +1 -1
- package/esm2022/src/render3/jit/directive.mjs +6 -2
- package/esm2022/src/render3/jit/environment.mjs +2 -1
- package/esm2022/src/render3/node_manipulation.mjs +4 -3
- package/esm2022/src/render3/pipe.mjs +2 -1
- package/esm2022/src/render3/reactive_lview_consumer.mjs +25 -45
- package/esm2022/src/render3/reactivity/effect.mjs +147 -44
- package/esm2022/src/render3/util/injector_utils.mjs +1 -1
- package/esm2022/src/render3/view_manipulation.mjs +13 -2
- package/esm2022/src/signals/index.mjs +4 -4
- package/esm2022/src/signals/src/api.mjs +2 -11
- package/esm2022/src/signals/src/computed.mjs +43 -93
- package/esm2022/src/signals/src/graph.mjs +241 -162
- package/esm2022/src/signals/src/signal.mjs +59 -79
- package/esm2022/src/signals/src/watch.mjs +38 -52
- package/esm2022/src/signals/src/weak_ref.mjs +2 -29
- package/esm2022/src/util/security/trusted_type_defs.mjs +1 -1
- package/esm2022/src/util/security/trusted_types.mjs +1 -1
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/src/zone/ng_zone.mjs +16 -1
- package/esm2022/testing/src/component_fixture.mjs +4 -2
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed.mjs +14 -3
- package/esm2022/testing/src/test_bed_compiler.mjs +3 -3
- package/fesm2022/core.mjs +6654 -6366
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +19 -6
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +201 -142
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +264 -201
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +10 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.0.0-next.
|
|
2
|
+
* @license Angular v17.0.0-next.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -164,16 +164,6 @@ export declare function afterNextRender(callback: VoidFunction, options?: AfterR
|
|
|
164
164
|
*/
|
|
165
165
|
export declare function afterRender(callback: VoidFunction, options?: AfterRenderOptions): AfterRenderRef;
|
|
166
166
|
|
|
167
|
-
/**
|
|
168
|
-
* A wrapper around a function to be used as an after render callback.
|
|
169
|
-
* @private
|
|
170
|
-
*/
|
|
171
|
-
declare class AfterRenderCallback {
|
|
172
|
-
private callback;
|
|
173
|
-
constructor(callback: VoidFunction);
|
|
174
|
-
invoke(): void;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
167
|
/**
|
|
178
168
|
* Options passed to `afterRender` and `afterNextRender`.
|
|
179
169
|
*
|
|
@@ -1123,15 +1113,19 @@ export declare interface Component extends Directive {
|
|
|
1123
1113
|
*/
|
|
1124
1114
|
template?: string;
|
|
1125
1115
|
/**
|
|
1126
|
-
* One
|
|
1116
|
+
* One relative paths or an absolute URL for files containing CSS stylesheet to use
|
|
1127
1117
|
* in this component.
|
|
1128
1118
|
*/
|
|
1119
|
+
styleUrl?: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* Relative paths or absolute URLs for files containing CSS stylesheets to use in this component.
|
|
1122
|
+
*/
|
|
1129
1123
|
styleUrls?: string[];
|
|
1130
1124
|
/**
|
|
1131
1125
|
* One or more inline CSS stylesheets to use
|
|
1132
1126
|
* in this component.
|
|
1133
1127
|
*/
|
|
1134
|
-
styles?: string[];
|
|
1128
|
+
styles?: string | string[];
|
|
1135
1129
|
/**
|
|
1136
1130
|
* One or more animation `trigger()` calls, containing
|
|
1137
1131
|
* [`state()`](api/animations/state) and `transition()` definitions.
|
|
@@ -1942,17 +1936,18 @@ declare const CONTEXT = 8;
|
|
|
1942
1936
|
* const applicationRef = await bootstrapApplication(RootComponent);
|
|
1943
1937
|
*
|
|
1944
1938
|
* // Locate a DOM node that would be used as a host.
|
|
1945
|
-
* const
|
|
1939
|
+
* const hostElement = document.getElementById('hello-component-host');
|
|
1946
1940
|
*
|
|
1947
1941
|
* // Get an `EnvironmentInjector` instance from the `ApplicationRef`.
|
|
1948
1942
|
* const environmentInjector = applicationRef.injector;
|
|
1949
1943
|
*
|
|
1950
1944
|
* // We can now create a `ComponentRef` instance.
|
|
1951
|
-
* const componentRef = createComponent(HelloComponent, {
|
|
1945
|
+
* const componentRef = createComponent(HelloComponent, {hostElement, environmentInjector});
|
|
1952
1946
|
*
|
|
1953
1947
|
* // Last step is to register the newly created ref using the `ApplicationRef` instance
|
|
1954
1948
|
* // to include the component view into change detection cycles.
|
|
1955
1949
|
* applicationRef.attachView(componentRef.hostView);
|
|
1950
|
+
* componentRef.changeDetectorRef.detectChanges();
|
|
1956
1951
|
* ```
|
|
1957
1952
|
*
|
|
1958
1953
|
* @param component Component class reference.
|
|
@@ -2412,12 +2407,14 @@ export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, Iter
|
|
|
2412
2407
|
declare const enum DeferDependenciesLoadingState {
|
|
2413
2408
|
/** Initial state, dependency loading is not yet triggered */
|
|
2414
2409
|
NOT_STARTED = 0,
|
|
2410
|
+
/** Dependency loading was scheduled (e.g. `on idle`), but has not started yet */
|
|
2411
|
+
SCHEDULED = 1,
|
|
2415
2412
|
/** Dependency loading is in progress */
|
|
2416
|
-
IN_PROGRESS =
|
|
2413
|
+
IN_PROGRESS = 2,
|
|
2417
2414
|
/** Dependency loading has completed successfully */
|
|
2418
|
-
COMPLETE =
|
|
2415
|
+
COMPLETE = 3,
|
|
2419
2416
|
/** Dependency loading has failed */
|
|
2420
|
-
FAILED =
|
|
2417
|
+
FAILED = 4
|
|
2421
2418
|
}
|
|
2422
2419
|
|
|
2423
2420
|
/** Configuration object for a `{:loading}` block as it is stored in the component constants. */
|
|
@@ -3244,19 +3241,6 @@ export declare type EffectCleanupFn = () => void;
|
|
|
3244
3241
|
*/
|
|
3245
3242
|
declare type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
|
|
3246
3243
|
|
|
3247
|
-
/**
|
|
3248
|
-
* Tracks all effects registered within a given application and runs them via `flush`.
|
|
3249
|
-
*/
|
|
3250
|
-
declare class EffectManager {
|
|
3251
|
-
private all;
|
|
3252
|
-
private queue;
|
|
3253
|
-
create(effectFn: (onCleanup: (cleanupFn: EffectCleanupFn) => void) => void, destroyRef: DestroyRef | null, allowSignalWrites: boolean): EffectRef;
|
|
3254
|
-
flush(): void;
|
|
3255
|
-
get isQueueEmpty(): boolean;
|
|
3256
|
-
/** @nocollapse */
|
|
3257
|
-
static ɵprov: unknown;
|
|
3258
|
-
}
|
|
3259
|
-
|
|
3260
3244
|
/**
|
|
3261
3245
|
* A global reactive effect, which can be manually destroyed.
|
|
3262
3246
|
*
|
|
@@ -3403,7 +3387,7 @@ declare const ENVIRONMENT = 10;
|
|
|
3403
3387
|
*
|
|
3404
3388
|
* @publicApi
|
|
3405
3389
|
*/
|
|
3406
|
-
export declare const ENVIRONMENT_INITIALIZER: InjectionToken<() => void>;
|
|
3390
|
+
export declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => void)[]>;
|
|
3407
3391
|
|
|
3408
3392
|
/**
|
|
3409
3393
|
* An `Injector` that's part of the environment injector hierarchy, which exists outside of the
|
|
@@ -5780,7 +5764,7 @@ declare interface LViewEnvironment {
|
|
|
5780
5764
|
/** An optional custom sanitizer. */
|
|
5781
5765
|
sanitizer: Sanitizer | null;
|
|
5782
5766
|
/** Container for reactivity system `effect`s. */
|
|
5783
|
-
|
|
5767
|
+
inlineEffectRunner: ɵFlushableEffectRunner | null;
|
|
5784
5768
|
/** Container for after render hooks */
|
|
5785
5769
|
afterRenderEventManager: ɵAfterRenderEventManager | null;
|
|
5786
5770
|
}
|
|
@@ -7375,116 +7359,94 @@ declare const REACTIVE_HOST_BINDING_CONSUMER = 24;
|
|
|
7375
7359
|
|
|
7376
7360
|
declare const REACTIVE_TEMPLATE_CONSUMER = 23;
|
|
7377
7361
|
|
|
7378
|
-
declare
|
|
7379
|
-
|
|
7380
|
-
private _lView;
|
|
7381
|
-
set lView(lView: LView);
|
|
7382
|
-
protected onConsumerDependencyMayHaveChanged(): void;
|
|
7383
|
-
protected onProducerUpdateValueVersion(): void;
|
|
7384
|
-
get hasReadASignal(): boolean;
|
|
7385
|
-
runInContext(fn: HostBindingsFunction<unknown> | ComponentTemplate<unknown>, rf: ɵRenderFlags, ctx: unknown): void;
|
|
7386
|
-
destroy(): void;
|
|
7362
|
+
declare interface ReactiveLViewConsumer extends ReactiveNode {
|
|
7363
|
+
lView: LView | null;
|
|
7387
7364
|
}
|
|
7388
7365
|
|
|
7389
7366
|
/**
|
|
7390
|
-
* A
|
|
7391
|
-
*
|
|
7392
|
-
* Nodes can be producers of reactive values, consumers of other reactive values, or both.
|
|
7393
|
-
*
|
|
7394
|
-
* Producers are nodes that produce values, and can be depended upon by consumer nodes.
|
|
7395
|
-
*
|
|
7396
|
-
* Producers expose a monotonic `valueVersion` counter, and are responsible for incrementing this
|
|
7397
|
-
* version when their value semantically changes. Some producers may produce their values lazily and
|
|
7398
|
-
* thus at times need to be polled for potential updates to their value (and by extension their
|
|
7399
|
-
* `valueVersion`). This is accomplished via the `onProducerUpdateValueVersion` method for
|
|
7400
|
-
* implemented by producers, which should perform whatever calculations are necessary to ensure
|
|
7401
|
-
* `valueVersion` is up to date.
|
|
7367
|
+
* A producer and/or consumer which participates in the reactive graph.
|
|
7402
7368
|
*
|
|
7403
|
-
*
|
|
7404
|
-
*
|
|
7369
|
+
* Producer `ReactiveNode`s which are accessed when a consumer `ReactiveNode` is the
|
|
7370
|
+
* `activeConsumer` are tracked as dependencies of that consumer.
|
|
7405
7371
|
*
|
|
7406
|
-
*
|
|
7407
|
-
*
|
|
7408
|
-
*
|
|
7372
|
+
* Certain consumers are also tracked as "live" consumers and create edges in the other direction,
|
|
7373
|
+
* from producer to consumer. These edges are used to propagate change notifications when a
|
|
7374
|
+
* producer's value is updated.
|
|
7409
7375
|
*
|
|
7410
|
-
*
|
|
7411
|
-
* `trackingVersion` counter, which increments whenever the consumer is about to re-run any reactive
|
|
7412
|
-
* reads it needs and establish a new set of dependencies as a result.
|
|
7413
|
-
*
|
|
7414
|
-
* Producers store the last `trackingVersion` they've seen from `Consumer`s which have read them.
|
|
7415
|
-
* This allows a producer to identify whether its record of the dependency is current or stale, by
|
|
7416
|
-
* comparing the consumer's `trackingVersion` to the version at which the dependency was
|
|
7417
|
-
* last observed.
|
|
7376
|
+
* A `ReactiveNode` may be both a producer and consumer.
|
|
7418
7377
|
*/
|
|
7419
|
-
declare
|
|
7420
|
-
private readonly id;
|
|
7421
|
-
/**
|
|
7422
|
-
* A cached weak reference to this node, which will be used in `ReactiveEdge`s.
|
|
7423
|
-
*/
|
|
7424
|
-
private readonly ref;
|
|
7378
|
+
declare interface ReactiveNode {
|
|
7425
7379
|
/**
|
|
7426
|
-
*
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
* Edges to consumers on which this node depends (in its producer capacity).
|
|
7431
|
-
*/
|
|
7432
|
-
private readonly consumers;
|
|
7433
|
-
/**
|
|
7434
|
-
* Monotonically increasing counter representing a version of this `Consumer`'s
|
|
7435
|
-
* dependencies.
|
|
7436
|
-
*/
|
|
7437
|
-
protected trackingVersion: number;
|
|
7438
|
-
/**
|
|
7439
|
-
* Monotonically increasing counter which increases when the value of this `Producer`
|
|
7440
|
-
* semantically changes.
|
|
7380
|
+
* Version of the value that this node produces.
|
|
7381
|
+
*
|
|
7382
|
+
* This is incremented whenever a new value is produced by this node which is not equal to the
|
|
7383
|
+
* previous value (by whatever definition of equality is in use).
|
|
7441
7384
|
*/
|
|
7442
|
-
|
|
7385
|
+
version: Version_2;
|
|
7443
7386
|
/**
|
|
7444
|
-
* Whether
|
|
7387
|
+
* Whether this node (in its consumer capacity) is dirty.
|
|
7388
|
+
*
|
|
7389
|
+
* Only live consumers become dirty, when receiving a change notification from a dependency
|
|
7390
|
+
* producer.
|
|
7445
7391
|
*/
|
|
7446
|
-
|
|
7392
|
+
dirty: boolean;
|
|
7447
7393
|
/**
|
|
7448
|
-
*
|
|
7449
|
-
*
|
|
7394
|
+
* Producers which are dependencies of this consumer.
|
|
7395
|
+
*
|
|
7396
|
+
* Uses the same indices as the `producerLastReadVersion` and `producerIndexOfThis` arrays.
|
|
7450
7397
|
*/
|
|
7451
|
-
|
|
7398
|
+
producerNode: ReactiveNode[] | undefined;
|
|
7452
7399
|
/**
|
|
7453
|
-
*
|
|
7454
|
-
*
|
|
7400
|
+
* `Version` of the value last read by a given producer.
|
|
7401
|
+
*
|
|
7402
|
+
* Uses the same indices as the `producerNode` and `producerIndexOfThis` arrays.
|
|
7455
7403
|
*/
|
|
7456
|
-
|
|
7404
|
+
producerLastReadVersion: Version_2[] | undefined;
|
|
7457
7405
|
/**
|
|
7458
|
-
*
|
|
7406
|
+
* Index of `this` (consumer) in each producer's `liveConsumers` array.
|
|
7459
7407
|
*
|
|
7460
|
-
*
|
|
7461
|
-
*
|
|
7462
|
-
*
|
|
7408
|
+
* This value is only meaningful if this node is live (`liveConsumers.length > 0`). Otherwise
|
|
7409
|
+
* these indices are stale.
|
|
7410
|
+
*
|
|
7411
|
+
* Uses the same indices as the `producerNode` and `producerLastReadVersion` arrays.
|
|
7463
7412
|
*/
|
|
7464
|
-
|
|
7413
|
+
producerIndexOfThis: number[] | undefined;
|
|
7465
7414
|
/**
|
|
7466
|
-
*
|
|
7415
|
+
* Index into the producer arrays that the next dependency of this node as a consumer will use.
|
|
7416
|
+
*
|
|
7417
|
+
* This index is zeroed before this node as a consumer begins executing. When a producer is read,
|
|
7418
|
+
* it gets inserted into the producers arrays at this index. There may be an existing dependency
|
|
7419
|
+
* in this location which may or may not match the incoming producer, depending on whether the
|
|
7420
|
+
* same producers were read in the same order as the last computation.
|
|
7467
7421
|
*/
|
|
7468
|
-
|
|
7422
|
+
nextProducerIndex: number;
|
|
7469
7423
|
/**
|
|
7470
|
-
*
|
|
7424
|
+
* Array of consumers of this producer that are "live" (they require push notifications).
|
|
7425
|
+
*
|
|
7426
|
+
* `liveConsumerNode.length` is effectively our reference count for this node.
|
|
7471
7427
|
*/
|
|
7472
|
-
|
|
7428
|
+
liveConsumerNode: ReactiveNode[] | undefined;
|
|
7473
7429
|
/**
|
|
7474
|
-
*
|
|
7430
|
+
* Index of `this` (producer) in each consumer's `producerNode` array.
|
|
7431
|
+
*
|
|
7432
|
+
* Uses the same indices as the `liveConsumerNode` array.
|
|
7475
7433
|
*/
|
|
7476
|
-
|
|
7434
|
+
liveConsumerIndexOfThis: number[] | undefined;
|
|
7477
7435
|
/**
|
|
7478
|
-
* Whether
|
|
7479
|
-
*
|
|
7436
|
+
* Whether writes to signals are allowed when this consumer is the `activeConsumer`.
|
|
7437
|
+
*
|
|
7438
|
+
* This is used to enforce guardrails such as preventing writes to writable signals in the
|
|
7439
|
+
* computation function of computed signals, which is supposed to be pure.
|
|
7480
7440
|
*/
|
|
7481
|
-
|
|
7441
|
+
consumerAllowSignalWrites: boolean;
|
|
7442
|
+
readonly consumerIsAlwaysLive: boolean;
|
|
7482
7443
|
/**
|
|
7483
|
-
*
|
|
7484
|
-
*
|
|
7485
|
-
* this `Producer`.
|
|
7444
|
+
* Tracks whether producers need to recompute their value independently of the reactive graph (for
|
|
7445
|
+
* example, if no initial value has been computed).
|
|
7486
7446
|
*/
|
|
7487
|
-
|
|
7447
|
+
producerMustRecompute(node: unknown): boolean;
|
|
7448
|
+
producerRecomputeValue(node: unknown): void;
|
|
7449
|
+
consumerMarkedDirty(node: unknown): void;
|
|
7488
7450
|
}
|
|
7489
7451
|
|
|
7490
7452
|
/**
|
|
@@ -7935,6 +7897,11 @@ export declare abstract class Sanitizer {
|
|
|
7935
7897
|
*/
|
|
7936
7898
|
declare type SanitizerFn = (value: any, tagName?: string, propName?: string) => string | TrustedHTML | TrustedScript | TrustedScriptURL;
|
|
7937
7899
|
|
|
7900
|
+
declare interface SchedulableEffect {
|
|
7901
|
+
run(): void;
|
|
7902
|
+
creationZone: unknown;
|
|
7903
|
+
}
|
|
7904
|
+
|
|
7938
7905
|
|
|
7939
7906
|
/**
|
|
7940
7907
|
* A schema definition associated with an NgModule.
|
|
@@ -9536,17 +9503,17 @@ export declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
|
|
|
9536
9503
|
* https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/trusted-types/index.d.ts
|
|
9537
9504
|
* but restricted to the API surface used within Angular.
|
|
9538
9505
|
*/
|
|
9539
|
-
declare
|
|
9506
|
+
declare type TrustedHTML = string & {
|
|
9540
9507
|
__brand__: 'TrustedHTML';
|
|
9541
|
-
}
|
|
9508
|
+
};
|
|
9542
9509
|
|
|
9543
|
-
declare
|
|
9510
|
+
declare type TrustedScript = string & {
|
|
9544
9511
|
__brand__: 'TrustedScript';
|
|
9545
|
-
}
|
|
9512
|
+
};
|
|
9546
9513
|
|
|
9547
|
-
declare
|
|
9514
|
+
declare type TrustedScriptURL = string & {
|
|
9548
9515
|
__brand__: 'TrustedScriptURL';
|
|
9549
|
-
}
|
|
9516
|
+
};
|
|
9550
9517
|
|
|
9551
9518
|
/**
|
|
9552
9519
|
* Value stored in the `TData` which is needed to re-concatenate the styling.
|
|
@@ -9595,9 +9562,9 @@ declare type TStylingKeyPrimitive = string | null | false;
|
|
|
9595
9562
|
*
|
|
9596
9563
|
* NOTE: `0` has special significance and represents `null` as in no additional pointer.
|
|
9597
9564
|
*/
|
|
9598
|
-
declare
|
|
9565
|
+
declare type TStylingRange = number & {
|
|
9599
9566
|
__brand__: 'TStylingRange';
|
|
9600
|
-
}
|
|
9567
|
+
};
|
|
9601
9568
|
|
|
9602
9569
|
/**
|
|
9603
9570
|
* Store the static values for the styling binding.
|
|
@@ -10080,6 +10047,10 @@ export declare class Version {
|
|
|
10080
10047
|
constructor(full: string);
|
|
10081
10048
|
}
|
|
10082
10049
|
|
|
10050
|
+
declare type Version_2 = number & {
|
|
10051
|
+
__brand: 'Version';
|
|
10052
|
+
};
|
|
10053
|
+
|
|
10083
10054
|
declare const VIEW_REFS = 8;
|
|
10084
10055
|
|
|
10085
10056
|
/**
|
|
@@ -10262,6 +10233,40 @@ export declare interface ViewChildrenDecorator {
|
|
|
10262
10233
|
* A view container instance can contain other view containers,
|
|
10263
10234
|
* creating a [view hierarchy](guide/glossary#view-hierarchy).
|
|
10264
10235
|
*
|
|
10236
|
+
* @usageNotes
|
|
10237
|
+
*
|
|
10238
|
+
* The example below demonstrates how the `createComponent` function can be used
|
|
10239
|
+
* to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,
|
|
10240
|
+
* so that it gets included into change detection cycles.
|
|
10241
|
+
*
|
|
10242
|
+
* Note: the example uses standalone components, but the function can also be used for
|
|
10243
|
+
* non-standalone components (declared in an NgModule) as well.
|
|
10244
|
+
*
|
|
10245
|
+
* ```typescript
|
|
10246
|
+
* @Component({
|
|
10247
|
+
* standalone: true,
|
|
10248
|
+
* selector: 'dynamic',
|
|
10249
|
+
* template: `<span>This is a content of a dynamic component.</span>`,
|
|
10250
|
+
* })
|
|
10251
|
+
* class DynamicComponent {
|
|
10252
|
+
* vcr = inject(ViewContainerRef);
|
|
10253
|
+
* }
|
|
10254
|
+
*
|
|
10255
|
+
* @Component({
|
|
10256
|
+
* standalone: true,
|
|
10257
|
+
* selector: 'app',
|
|
10258
|
+
* template: `<main>Hi! This is the main content.</main>`,
|
|
10259
|
+
* })
|
|
10260
|
+
* class AppComponent {
|
|
10261
|
+
* vcr = inject(ViewContainerRef);
|
|
10262
|
+
*
|
|
10263
|
+
* ngAfterViewInit() {
|
|
10264
|
+
* const compRef = this.vcr.createComponent(DynamicComponent);
|
|
10265
|
+
* compRef.changeDetectorRef.detectChanges();
|
|
10266
|
+
* }
|
|
10267
|
+
* }
|
|
10268
|
+
* ```
|
|
10269
|
+
*
|
|
10265
10270
|
* @see {@link ComponentRef}
|
|
10266
10271
|
* @see {@link EmbeddedViewRef}
|
|
10267
10272
|
*
|
|
@@ -10500,14 +10505,6 @@ declare interface ViewRefTracker {
|
|
|
10500
10505
|
detachView(viewRef: ViewRef): void;
|
|
10501
10506
|
}
|
|
10502
10507
|
|
|
10503
|
-
declare interface WeakRef<T extends object> {
|
|
10504
|
-
deref(): T | undefined;
|
|
10505
|
-
}
|
|
10506
|
-
|
|
10507
|
-
declare interface WeakRefCtor {
|
|
10508
|
-
new <T extends object>(value: T): WeakRef<T>;
|
|
10509
|
-
}
|
|
10510
|
-
|
|
10511
10508
|
/**
|
|
10512
10509
|
* A `Signal` with a value that can be mutated via a setter interface.
|
|
10513
10510
|
*
|
|
@@ -10546,25 +10543,21 @@ export declare function ɵ_sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string
|
|
|
10546
10543
|
export declare function ɵ_sanitizeUrl(url: string): string;
|
|
10547
10544
|
|
|
10548
10545
|
/**
|
|
10549
|
-
* Implements `afterRender` and `afterNextRender`
|
|
10546
|
+
* Implements core timing for `afterRender` and `afterNextRender` events.
|
|
10547
|
+
* Delegates to an optional `AfterRenderCallbackHandler` for implementation.
|
|
10550
10548
|
*/
|
|
10551
10549
|
export declare class ɵAfterRenderEventManager {
|
|
10552
|
-
private callbacks;
|
|
10553
|
-
private deferredCallbacks;
|
|
10554
10550
|
private renderDepth;
|
|
10555
|
-
private runningCallbacks;
|
|
10556
10551
|
/**
|
|
10557
10552
|
* Mark the beginning of a render operation (i.e. CD cycle).
|
|
10558
|
-
* Throws if called
|
|
10553
|
+
* Throws if called while executing callbacks.
|
|
10559
10554
|
*/
|
|
10560
10555
|
begin(): void;
|
|
10561
10556
|
/**
|
|
10562
|
-
* Mark the end of a render operation.
|
|
10563
|
-
*
|
|
10557
|
+
* Mark the end of a render operation. Callbacks will be
|
|
10558
|
+
* executed if there are no more pending operations.
|
|
10564
10559
|
*/
|
|
10565
10560
|
end(): void;
|
|
10566
|
-
register(callback: AfterRenderCallback): void;
|
|
10567
|
-
unregister(callback: AfterRenderCallback): void;
|
|
10568
10561
|
ngOnDestroy(): void;
|
|
10569
10562
|
/** @nocollapse */
|
|
10570
10563
|
static ɵprov: unknown;
|
|
@@ -10896,6 +10889,7 @@ export declare interface ɵComponentDef<T> extends ɵDirectiveDef<T> {
|
|
|
10896
10889
|
*/
|
|
10897
10890
|
readonly data: {
|
|
10898
10891
|
[kind: string]: any;
|
|
10892
|
+
animation?: any[];
|
|
10899
10893
|
};
|
|
10900
10894
|
/** Whether or not this component's ChangeDetectionStrategy is OnPush */
|
|
10901
10895
|
readonly onPush: boolean;
|
|
@@ -11189,6 +11183,20 @@ export declare interface ɵDirectiveType<T> extends Type<T> {
|
|
|
11189
11183
|
ɵfac: unknown;
|
|
11190
11184
|
}
|
|
11191
11185
|
|
|
11186
|
+
/**
|
|
11187
|
+
* A scheduler which manages the execution of effects.
|
|
11188
|
+
*/
|
|
11189
|
+
export declare abstract class ɵEffectScheduler {
|
|
11190
|
+
/**
|
|
11191
|
+
* Schedule the given effect to be executed at a later time.
|
|
11192
|
+
*
|
|
11193
|
+
* It is an error to attempt to execute any effects synchronously during a scheduling operation.
|
|
11194
|
+
*/
|
|
11195
|
+
abstract scheduleEffect(e: SchedulableEffect): void;
|
|
11196
|
+
/** @nocollapse */
|
|
11197
|
+
static ɵprov: unknown;
|
|
11198
|
+
}
|
|
11199
|
+
|
|
11192
11200
|
/**
|
|
11193
11201
|
* Internal token to collect all SSR-related features enabled for this application.
|
|
11194
11202
|
*
|
|
@@ -11215,6 +11223,16 @@ export declare const enum ɵExtraLocaleDataIndex {
|
|
|
11215
11223
|
*/
|
|
11216
11224
|
export declare function ɵfindLocaleData(locale: string): any;
|
|
11217
11225
|
|
|
11226
|
+
/**
|
|
11227
|
+
* Interface to an `EffectScheduler` capable of running scheduled effects synchronously.
|
|
11228
|
+
*/
|
|
11229
|
+
export declare interface ɵFlushableEffectRunner {
|
|
11230
|
+
/**
|
|
11231
|
+
* Run any scheduled effects.
|
|
11232
|
+
*/
|
|
11233
|
+
flush(): void;
|
|
11234
|
+
}
|
|
11235
|
+
|
|
11218
11236
|
/**
|
|
11219
11237
|
* Loops over queued module definitions, if a given module definition has all of its
|
|
11220
11238
|
* declarations resolved, it dequeues that module definition and sets the scope on
|
|
@@ -12094,7 +12112,8 @@ export declare interface ɵSafeValue {
|
|
|
12094
12112
|
*/
|
|
12095
12113
|
export declare function ɵsetAllowDuplicateNgModuleIdsForTest(allowDuplicates: boolean): void;
|
|
12096
12114
|
|
|
12097
|
-
|
|
12115
|
+
|
|
12116
|
+
export declare function ɵsetAlternateWeakRefImpl(impl: unknown): void;
|
|
12098
12117
|
|
|
12099
12118
|
/**
|
|
12100
12119
|
* Adds decorator, constructor, and property metadata to a given type via static metadata fields
|
|
@@ -12438,6 +12457,26 @@ export declare function ɵwithDomHydration(): EnvironmentProviders;
|
|
|
12438
12457
|
*/
|
|
12439
12458
|
export declare const ɵXSS_SECURITY_URL = "https://g.co/ng/security#xss";
|
|
12440
12459
|
|
|
12460
|
+
/**
|
|
12461
|
+
* An `EffectScheduler` which is capable of queueing scheduled effects per-zone, and flushing them
|
|
12462
|
+
* as an explicit operation.
|
|
12463
|
+
*/
|
|
12464
|
+
export declare class ɵZoneAwareQueueingScheduler implements ɵEffectScheduler, ɵFlushableEffectRunner {
|
|
12465
|
+
private queuedEffectCount;
|
|
12466
|
+
private queues;
|
|
12467
|
+
scheduleEffect(handle: SchedulableEffect): void;
|
|
12468
|
+
/**
|
|
12469
|
+
* Run all scheduled effects.
|
|
12470
|
+
*
|
|
12471
|
+
* Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
|
|
12472
|
+
* ordering guarantee between effects scheduled in different zones.
|
|
12473
|
+
*/
|
|
12474
|
+
flush(): void;
|
|
12475
|
+
private flushQueue;
|
|
12476
|
+
/** @nocollapse */
|
|
12477
|
+
static ɵprov: unknown;
|
|
12478
|
+
}
|
|
12479
|
+
|
|
12441
12480
|
/**
|
|
12442
12481
|
* Advances to an element for later binding instructions.
|
|
12443
12482
|
*
|
|
@@ -13099,6 +13138,15 @@ export declare type ɵɵComponentDeclaration<T, Selector extends String, ExportA
|
|
|
13099
13138
|
[key: string]: string;
|
|
13100
13139
|
}, QueryFields extends string[], NgContentSelectors extends string[], IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
|
|
13101
13140
|
|
|
13141
|
+
/**
|
|
13142
|
+
* Instruction that returns the component instance in which the current instruction is executing.
|
|
13143
|
+
* This is a constant-time version of `nextContent` for the case where we know that we need the
|
|
13144
|
+
* component instance specifically, rather than the context of a particular template.
|
|
13145
|
+
*
|
|
13146
|
+
* @codeGenApi
|
|
13147
|
+
*/
|
|
13148
|
+
export declare function ɵɵcomponentInstance(): unknown;
|
|
13149
|
+
|
|
13102
13150
|
/**
|
|
13103
13151
|
* The conditional instruction represents the basic building block on the runtime side to support
|
|
13104
13152
|
* built-in "if" and "switch". On the high level this instruction is responsible for adding and
|
|
@@ -14808,9 +14856,20 @@ export declare function ɵɵrepeater(metadataSlotIdx: number, collection: Iterab
|
|
|
14808
14856
|
* - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty
|
|
14809
14857
|
* block
|
|
14810
14858
|
*
|
|
14859
|
+
* @param index Index at which to store the metadata of the repeater.
|
|
14860
|
+
* @param templateFn Reference to the template of the main repeater block.
|
|
14861
|
+
* @param decls The number of nodes, local refs, and pipes for the main block.
|
|
14862
|
+
* @param vars The number of bindings for the main block.
|
|
14863
|
+
* @param trackByFn Reference to the tracking function.
|
|
14864
|
+
* @param trackByUsesComponentInstance Whether the tracking function has any references to the
|
|
14865
|
+
* component instance. If it doesn't, we can avoid rebinding it.
|
|
14866
|
+
* @param emptyTemplateFn Reference to the template function of the empty block.
|
|
14867
|
+
* @param emptyDecls The number of nodes, local refs, and pipes for the empty block.
|
|
14868
|
+
* @param emptyVars The number of bindings for the empty block.
|
|
14869
|
+
*
|
|
14811
14870
|
* @codeGenApi
|
|
14812
14871
|
*/
|
|
14813
|
-
export declare function ɵɵrepeaterCreate(index: number, templateFn: ComponentTemplate<unknown>, decls: number, vars: number, trackByFn: TrackByFunction<unknown>, emptyTemplateFn?: ComponentTemplate<unknown>, emptyDecls?: number, emptyVars?: number): void;
|
|
14872
|
+
export declare function ɵɵrepeaterCreate(index: number, templateFn: ComponentTemplate<unknown>, decls: number, vars: number, trackByFn: TrackByFunction<unknown>, trackByUsesComponentInstance?: boolean, emptyTemplateFn?: ComponentTemplate<unknown>, emptyDecls?: number, emptyVars?: number): void;
|
|
14814
14873
|
|
|
14815
14874
|
/**
|
|
14816
14875
|
* A built-in trackBy function used for situations where users specified collection item reference
|
package/package.json
CHANGED
package/rxjs-interop/index.d.ts
CHANGED