@angular/core 16.0.0-next.1 → 16.0.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/esm2020/src/application_config.mjs +21 -0
  2. package/esm2020/src/application_init.mjs +21 -30
  3. package/esm2020/src/application_ref.mjs +123 -115
  4. package/esm2020/src/application_tokens.mjs +28 -33
  5. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  6. package/esm2020/src/change_detection/constants.mjs +1 -49
  7. package/esm2020/src/compiler/compiler_facade_interface.mjs +1 -1
  8. package/esm2020/src/core.mjs +4 -3
  9. package/esm2020/src/core_private_export.mjs +6 -9
  10. package/esm2020/src/core_render3_private_export.mjs +2 -1
  11. package/esm2020/src/debug/debug_node.mjs +1 -5
  12. package/esm2020/src/di/contextual.mjs +37 -0
  13. package/esm2020/src/di/index.mjs +2 -1
  14. package/esm2020/src/di/r3_injector.mjs +1 -1
  15. package/esm2020/src/errors.mjs +1 -1
  16. package/esm2020/src/hydration/annotate.mjs +271 -0
  17. package/esm2020/src/hydration/api.mjs +128 -0
  18. package/esm2020/src/hydration/cleanup.mjs +50 -0
  19. package/esm2020/src/hydration/error_handling.mjs +37 -0
  20. package/esm2020/src/hydration/interfaces.mjs +17 -0
  21. package/esm2020/src/hydration/node_lookup_utils.mjs +83 -0
  22. package/esm2020/src/hydration/skip_hydration.mjs +49 -0
  23. package/esm2020/src/hydration/tokens.mjs +25 -0
  24. package/esm2020/src/hydration/utils.mjs +206 -0
  25. package/esm2020/src/hydration/views.mjs +80 -0
  26. package/esm2020/src/linker/template_ref.mjs +19 -4
  27. package/esm2020/src/linker/view_container_ref.mjs +110 -35
  28. package/esm2020/src/render3/component_ref.mjs +17 -10
  29. package/esm2020/src/render3/definition.mjs +114 -45
  30. package/esm2020/src/render3/i18n/i18n_util.mjs +3 -3
  31. package/esm2020/src/render3/instructions/element.mjs +58 -6
  32. package/esm2020/src/render3/instructions/element_container.mjs +53 -9
  33. package/esm2020/src/render3/instructions/listener.mjs +3 -3
  34. package/esm2020/src/render3/instructions/shared.mjs +71 -17
  35. package/esm2020/src/render3/instructions/template.mjs +57 -6
  36. package/esm2020/src/render3/instructions/text.mjs +36 -5
  37. package/esm2020/src/render3/interfaces/container.mjs +3 -2
  38. package/esm2020/src/render3/interfaces/node.mjs +1 -1
  39. package/esm2020/src/render3/interfaces/renderer_dom.mjs +1 -1
  40. package/esm2020/src/render3/interfaces/type_checks.mjs +2 -2
  41. package/esm2020/src/render3/interfaces/view.mjs +3 -2
  42. package/esm2020/src/render3/jit/directive.mjs +1 -2
  43. package/esm2020/src/render3/jit/module.mjs +3 -2
  44. package/esm2020/src/render3/ng_module_ref.mjs +9 -5
  45. package/esm2020/src/render3/node_manipulation.mjs +12 -1
  46. package/esm2020/src/render3/state.mjs +45 -1
  47. package/esm2020/src/render3/util/discovery_utils.mjs +3 -2
  48. package/esm2020/src/transfer_state.mjs +15 -10
  49. package/esm2020/src/util/lang.mjs +1 -11
  50. package/esm2020/src/util/ng_dev_mode.mjs +4 -1
  51. package/esm2020/src/version.mjs +1 -1
  52. package/esm2020/src/zone/ng_zone.mjs +62 -1
  53. package/esm2020/testing/src/logger.mjs +3 -3
  54. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  55. package/esm2020/testing/src/test_bed_compiler.mjs +4 -4
  56. package/fesm2015/core.mjs +2990 -1683
  57. package/fesm2015/core.mjs.map +1 -1
  58. package/fesm2015/testing.mjs +3615 -2533
  59. package/fesm2015/testing.mjs.map +1 -1
  60. package/fesm2020/core.mjs +2831 -1520
  61. package/fesm2020/core.mjs.map +1 -1
  62. package/fesm2020/testing.mjs +2390 -1305
  63. package/fesm2020/testing.mjs.map +1 -1
  64. package/index.d.ts +636 -584
  65. package/package.json +2 -2
  66. package/schematics/migrations/relative-link-resolution/bundle.js +7 -7
  67. package/schematics/migrations/router-link-with-href/bundle.js +10 -10
  68. package/schematics/ng-generate/standalone-migration/bundle.js +882 -758
  69. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  70. package/testing/index.d.ts +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.1
2
+ * @license Angular v16.0.0-next.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -187,13 +187,32 @@ export declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "B
187
187
  export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
188
188
 
189
189
  /**
190
- * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
190
+ * A [DI token](guide/glossary#di-token "DI token definition") representing a string ID, used
191
191
  * primarily for prefixing application attributes and CSS styles when
192
192
  * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
193
193
  *
194
- * BY default, the value is randomly generated and assigned to the application by Angular.
195
- * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
196
- * the root {@link Injector} that uses this token.
194
+ * The token is needed in cases when multiple applications are bootstrapped on a page
195
+ * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications
196
+ * have different `APP_ID` value setup. For example:
197
+ *
198
+ * ```
199
+ * bootstrapApplication(ComponentA, {
200
+ * providers: [
201
+ * { provide: APP_ID, useValue: 'app-a' },
202
+ * // ... other providers ...
203
+ * ]
204
+ * });
205
+ *
206
+ * bootstrapApplication(ComponentB, {
207
+ * providers: [
208
+ * { provide: APP_ID, useValue: 'app-b' },
209
+ * // ... other providers ...
210
+ * ]
211
+ * });
212
+ * ```
213
+ *
214
+ * By default, when there is only one application bootstrapped, you don't need to provide the
215
+ * `APP_ID` token (the `ng` will be used as an app ID).
197
216
  *
198
217
  * @publicApi
199
218
  */
@@ -271,7 +290,17 @@ export declare const APP_ID: InjectionToken<string>;
271
290
  */
272
291
  export declare const APP_INITIALIZER: InjectionToken<readonly (() => Observable<unknown> | Promise<unknown> | void)[]>;
273
292
 
274
- declare function _appIdRandomProviderFactory(): string;
293
+ /**
294
+ * Set of config options available during the application bootstrap operation.
295
+ *
296
+ * @publicApi
297
+ */
298
+ export declare interface ApplicationConfig {
299
+ /**
300
+ * List of providers that should be available to the root component and all its children.
301
+ */
302
+ providers: Array<Provider | EnvironmentProviders>;
303
+ }
275
304
 
276
305
  /**
277
306
  * A class that reflects the state of running {@link APP_INITIALIZER} functions.
@@ -279,14 +308,13 @@ declare function _appIdRandomProviderFactory(): string;
279
308
  * @publicApi
280
309
  */
281
310
  export declare class ApplicationInitStatus {
282
- private readonly appInits;
283
311
  private resolve;
284
312
  private reject;
285
313
  private initialized;
286
- readonly donePromise: Promise<any>;
287
314
  readonly done = false;
288
- constructor(appInits: ReadonlyArray<() => Observable<unknown> | Promise<unknown> | void>);
289
- static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationInitStatus, [{ optional: true; }]>;
315
+ readonly donePromise: Promise<any>;
316
+ private readonly appInits;
317
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationInitStatus, never>;
290
318
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationInitStatus>;
291
319
  }
292
320
 
@@ -308,7 +336,6 @@ export declare class ApplicationModule {
308
336
  * A reference to an Angular application running on a page.
309
337
  *
310
338
  * @usageNotes
311
- *
312
339
  * {@a is-stable-examples}
313
340
  * ### isStable examples and caveats
314
341
  *
@@ -398,15 +425,10 @@ export declare class ApplicationModule {
398
425
  * @publicApi
399
426
  */
400
427
  export declare class ApplicationRef {
401
- private _zone;
402
- private _injector;
403
- private _exceptionHandler;
404
- private _views;
405
428
  private _runningTick;
406
- private _stable;
407
- private _onMicrotaskEmptySubscription;
408
429
  private _destroyed;
409
430
  private _destroyListeners;
431
+ private readonly internalErrorHandler;
410
432
  /**
411
433
  * Indicates whether this instance was destroyed.
412
434
  */
@@ -422,10 +444,9 @@ export declare class ApplicationRef {
422
444
  readonly components: ComponentRef<any>[];
423
445
  /**
424
446
  * Returns an Observable that indicates when the application is stable or unstable.
425
- *
426
- * @see [Usage notes](#is-stable-examples) for examples and caveats when using this API.
427
447
  */
428
448
  readonly isStable: Observable<boolean>;
449
+ private readonly _injector;
429
450
  /**
430
451
  * The `EnvironmentInjector` used to create this application.
431
452
  */
@@ -1235,6 +1256,101 @@ declare interface ComponentDefFeature {
1235
1256
  ngInherit?: true;
1236
1257
  }
1237
1258
 
1259
+ declare interface ComponentDefinition<T> extends Omit<DirectiveDefinition<T>, 'features'> {
1260
+ /**
1261
+ * The number of nodes, local refs, and pipes in this component template.
1262
+ *
1263
+ * Used to calculate the length of this component's LView array, so we
1264
+ * can pre-fill the array and set the binding start index.
1265
+ */
1266
+ decls: number;
1267
+ /**
1268
+ * The number of bindings in this component template (including pure fn bindings).
1269
+ *
1270
+ * Used to calculate the length of this component's LView array, so we
1271
+ * can pre-fill the array and set the host binding start index.
1272
+ */
1273
+ vars: number;
1274
+ /**
1275
+ * Template function use for rendering DOM.
1276
+ *
1277
+ * This function has following structure.
1278
+ *
1279
+ * ```
1280
+ * function Template<T>(ctx:T, creationMode: boolean) {
1281
+ * if (creationMode) {
1282
+ * // Contains creation mode instructions.
1283
+ * }
1284
+ * // Contains binding update instructions
1285
+ * }
1286
+ * ```
1287
+ *
1288
+ * Common instructions are:
1289
+ * Creation mode instructions:
1290
+ * - `elementStart`, `elementEnd`
1291
+ * - `text`
1292
+ * - `container`
1293
+ * - `listener`
1294
+ *
1295
+ * Binding update instructions:
1296
+ * - `bind`
1297
+ * - `elementAttribute`
1298
+ * - `elementProperty`
1299
+ * - `elementClass`
1300
+ * - `elementStyle`
1301
+ *
1302
+ */
1303
+ template: ComponentTemplate<T>;
1304
+ /**
1305
+ * Constants for the nodes in the component's view.
1306
+ * Includes attribute arrays, local definition arrays etc.
1307
+ */
1308
+ consts?: TConstantsOrFactory;
1309
+ /**
1310
+ * An array of `ngContent[selector]` values that were found in the template.
1311
+ */
1312
+ ngContentSelectors?: string[];
1313
+ /**
1314
+ * A list of optional features to apply.
1315
+ *
1316
+ * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}
1317
+ */
1318
+ features?: ComponentDefFeature[];
1319
+ /**
1320
+ * Defines template and style encapsulation options available for Component's {@link Component}.
1321
+ */
1322
+ encapsulation?: ViewEncapsulation;
1323
+ /**
1324
+ * Defines arbitrary developer-defined data to be stored on a renderer instance.
1325
+ * This is useful for renderers that delegate to other renderers.
1326
+ *
1327
+ * see: animation
1328
+ */
1329
+ data?: {
1330
+ [kind: string]: any;
1331
+ };
1332
+ /**
1333
+ * A set of styles that the component needs to be present for component to render correctly.
1334
+ */
1335
+ styles?: string[];
1336
+ /**
1337
+ * The strategy that the default change detector uses to detect changes.
1338
+ * When set, takes effect the next time change detection is triggered.
1339
+ */
1340
+ changeDetection?: ChangeDetectionStrategy;
1341
+ /**
1342
+ * Registry of directives, components, and pipes that may be found in this component's view.
1343
+ *
1344
+ * This property is either an array of types or a function that returns the array of types. This
1345
+ * function may be necessary to support forward declarations.
1346
+ */
1347
+ dependencies?: TypeOrFactory<DependencyTypeList>;
1348
+ /**
1349
+ * The set of schemas that declare elements to be allowed in the component's template.
1350
+ */
1351
+ schemas?: SchemaMetadata[] | null;
1352
+ }
1353
+
1238
1354
  /**
1239
1355
  * Base class for a factory that can create a component dynamically.
1240
1356
  * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
@@ -1544,6 +1660,8 @@ declare type ConsumerId = number & {
1544
1660
  __consumer: true;
1545
1661
  };
1546
1662
 
1663
+ declare const CONTAINERS = "c";
1664
+
1547
1665
  /**
1548
1666
  * Type of the ContentChild metadata.
1549
1667
  *
@@ -2174,6 +2292,44 @@ export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, Iter
2174
2292
  */
2175
2293
  export declare const defineInjectable: typeof ɵɵdefineInjectable;
2176
2294
 
2295
+ declare const DEHYDRATED_VIEWS = 10;
2296
+
2297
+ /**
2298
+ * An object that contains hydration-related information serialized
2299
+ * on the server, as well as the necessary references to segments of
2300
+ * the DOM, to facilitate the hydration process for a given view
2301
+ * inside a view container (either an embedded view or a view created
2302
+ * for a component).
2303
+ */
2304
+ declare interface DehydratedContainerView extends DehydratedView {
2305
+ data: Readonly<SerializedContainerView>;
2306
+ }
2307
+
2308
+ /**
2309
+ * An object that contains hydration-related information serialized
2310
+ * on the server, as well as the necessary references to segments of
2311
+ * the DOM, to facilitate the hydration process for a given hydration
2312
+ * boundary on the client.
2313
+ */
2314
+ declare interface DehydratedView {
2315
+ /**
2316
+ * The readonly hydration annotation data.
2317
+ */
2318
+ data: Readonly<SerializedView>;
2319
+ /**
2320
+ * A reference to the first child in a DOM segment associated
2321
+ * with a given hydration boundary.
2322
+ */
2323
+ firstChild: RNode | null;
2324
+ /**
2325
+ * Stores references to first nodes in DOM segments that
2326
+ * represent either an <ng-container> or a view container.
2327
+ */
2328
+ segmentHeads?: {
2329
+ [index: number]: RNode | null;
2330
+ };
2331
+ }
2332
+
2177
2333
  declare type DependencyTypeList = (ɵDirectiveType<any> | ɵComponentType<any> | PipeType<any> | Type<any>)[];
2178
2334
 
2179
2335
  /**
@@ -2562,125 +2718,260 @@ declare interface DirectiveDefFeature {
2562
2718
  ngInherit?: true;
2563
2719
  }
2564
2720
 
2565
- declare type DirectiveDefList = (ɵDirectiveDef<any> | ɵComponentDef<any>)[];
2566
-
2567
- /**
2568
- * Type used for directiveDefs on component definition.
2569
- *
2570
- * The function is necessary to be able to support forward declarations.
2571
- */
2572
- declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
2573
-
2574
- /**
2575
- * @description
2576
- * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule
2577
- * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided.
2578
- *
2579
- * Reference to the current application is provided as a parameter.
2580
- *
2581
- * See ["Bootstrapping"](guide/bootstrapping) and ["Entry components"](guide/entry-components).
2582
- *
2583
- * @usageNotes
2584
- * The example below uses `ApplicationRef.bootstrap()` to render the
2585
- * `AppComponent` on the page.
2586
- *
2587
- * ```typescript
2588
- * class AppModule implements DoBootstrap {
2589
- * ngDoBootstrap(appRef: ApplicationRef) {
2590
- * appRef.bootstrap(AppComponent); // Or some other component
2591
- * }
2592
- * }
2593
- * ```
2594
- *
2595
- * @publicApi
2596
- */
2597
- export declare interface DoBootstrap {
2598
- ngDoBootstrap(appRef: ApplicationRef): void;
2599
- }
2600
-
2601
- /**
2602
- * A lifecycle hook that invokes a custom change-detection function for a directive,
2603
- * in addition to the check performed by the default change-detector.
2604
- *
2605
- * The default change-detection algorithm looks for differences by comparing
2606
- * bound-property values by reference across change detection runs. You can use this
2607
- * hook to check for and respond to changes by some other means.
2608
- *
2609
- * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied,
2610
- * regardless of whether you perform additional change detection.
2611
- * Typically, you should not use both `DoCheck` and `OnChanges` to respond to
2612
- * changes on the same input.
2613
- *
2614
- * @see `OnChanges`
2615
- * @see [Lifecycle hooks guide](guide/lifecycle-hooks)
2616
- *
2617
- * @usageNotes
2618
- * The following snippet shows how a component can implement this interface
2619
- * to invoke it own change-detection cycle.
2620
- *
2621
- * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'}
2622
- *
2623
- * For a more complete example and discussion, see
2624
- * [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection).
2625
- *
2626
- * @publicApi
2627
- */
2628
- export declare interface DoCheck {
2629
- /**
2630
- * A callback method that performs change-detection, invoked
2631
- * after the default change-detector runs.
2632
- * See `KeyValueDiffers` and `IterableDiffers` for implementing
2633
- * custom change checking for collections.
2634
- *
2635
- */
2636
- ngDoCheck(): void;
2637
- }
2638
-
2639
- /**
2640
- * A bidirectional edge in the producer-consumer dependency graph.
2641
- */
2642
- declare interface Edge {
2643
- /**
2644
- * Weakly held reference to the `Consumer` side of this edge.
2645
- */
2646
- readonly consumerRef: WeakRef<Consumer>;
2721
+ declare interface DirectiveDefinition<T> {
2647
2722
  /**
2648
- * Weakly held reference to the `Producer` side of this edge.
2723
+ * Directive type, needed to configure the injector.
2649
2724
  */
2650
- readonly producerRef: WeakRef<Producer>;
2725
+ type: Type<T>;
2726
+ /** The selectors that will be used to match nodes to this directive. */
2727
+ selectors?: ɵCssSelectorList;
2651
2728
  /**
2652
- * `trackingVersion` of the `Consumer` at which this dependency edge was last observed.
2729
+ * A map of input names.
2653
2730
  *
2654
- * If this doesn't match the `Consumer`'s current `trackingVersion`, then this dependency record
2655
- * is stale, and needs to be cleaned up.
2656
- */
2657
- atTrackingVersion: number;
2658
- /**
2659
- * `valueVersion` of the `Producer` at the time this dependency was last accessed.
2731
+ * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.
2660
2732
  *
2661
- * This is used by `consumerPollValueStatus` to determine whether a `Consumer`'s dependencies have
2662
- * semantically changed.
2663
- */
2664
- seenValueVersion: number;
2665
- }
2666
-
2667
- /**
2668
- * A global reactive effect, which can be manually scheduled or destroyed.
2669
- *
2670
- * @developerPreview
2671
- */
2672
- export declare interface Effect {
2673
- /**
2674
- * Schedule the effect for manual execution, if it's not already.
2675
- */
2676
- schedule(): void;
2677
- /**
2678
- * Shut down the effect, removing it from any upcoming scheduled executions.
2679
- */
2680
- destroy(): void;
2681
- /**
2682
- * Direct access to the effect's `Consumer` for advanced use cases.
2683
- */
2733
+ * Given:
2734
+ * ```
2735
+ * class MyComponent {
2736
+ * @Input()
2737
+ * publicInput1: string;
2738
+ *
2739
+ * @Input('publicInput2')
2740
+ * declaredInput2: string;
2741
+ * }
2742
+ * ```
2743
+ *
2744
+ * is described as:
2745
+ * ```
2746
+ * {
2747
+ * publicInput1: 'publicInput1',
2748
+ * declaredInput2: ['declaredInput2', 'publicInput2'],
2749
+ * }
2750
+ * ```
2751
+ *
2752
+ * Which the minifier may translate to:
2753
+ * ```
2754
+ * {
2755
+ * minifiedPublicInput1: 'publicInput1',
2756
+ * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],
2757
+ * }
2758
+ * ```
2759
+ *
2760
+ * This allows the render to re-construct the minified, public, and declared names
2761
+ * of properties.
2762
+ *
2763
+ * NOTE:
2764
+ * - Because declared and public name are usually same we only generate the array
2765
+ * `['declared', 'public']` format when they differ.
2766
+ * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
2767
+ * inconsistent behavior in that it uses declared names rather than minified or public. For
2768
+ * this reason `NgOnChanges` will be deprecated and removed in future version and this
2769
+ * API will be simplified to be consistent with `output`.
2770
+ */
2771
+ inputs?: {
2772
+ [P in keyof T]?: string | [string, string];
2773
+ };
2774
+ /**
2775
+ * A map of output names.
2776
+ *
2777
+ * The format is in: `{[actualPropertyName: string]:string}`.
2778
+ *
2779
+ * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
2780
+ *
2781
+ * This allows the render to re-construct the minified and non-minified names
2782
+ * of properties.
2783
+ */
2784
+ outputs?: {
2785
+ [P in keyof T]?: string;
2786
+ };
2787
+ /**
2788
+ * A list of optional features to apply.
2789
+ *
2790
+ * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
2791
+ */
2792
+ features?: DirectiveDefFeature[];
2793
+ /**
2794
+ * Function executed by the parent template to allow child directive to apply host bindings.
2795
+ */
2796
+ hostBindings?: HostBindingsFunction<T>;
2797
+ /**
2798
+ * The number of bindings in this directive `hostBindings` (including pure fn bindings).
2799
+ *
2800
+ * Used to calculate the length of the component's LView array, so we
2801
+ * can pre-fill the array and set the host binding start index.
2802
+ */
2803
+ hostVars?: number;
2804
+ /**
2805
+ * Assign static attribute values to a host element.
2806
+ *
2807
+ * This property will assign static attribute values as well as class and style
2808
+ * values to a host element. Since attribute values can consist of different types of values,
2809
+ * the `hostAttrs` array must include the values in the following format:
2810
+ *
2811
+ * attrs = [
2812
+ * // static attributes (like `title`, `name`, `id`...)
2813
+ * attr1, value1, attr2, value,
2814
+ *
2815
+ * // a single namespace value (like `x:id`)
2816
+ * NAMESPACE_MARKER, namespaceUri1, name1, value1,
2817
+ *
2818
+ * // another single namespace value (like `x:name`)
2819
+ * NAMESPACE_MARKER, namespaceUri2, name2, value2,
2820
+ *
2821
+ * // a series of CSS classes that will be applied to the element (no spaces)
2822
+ * CLASSES_MARKER, class1, class2, class3,
2823
+ *
2824
+ * // a series of CSS styles (property + value) that will be applied to the element
2825
+ * STYLES_MARKER, prop1, value1, prop2, value2
2826
+ * ]
2827
+ *
2828
+ * All non-class and non-style attributes must be defined at the start of the list
2829
+ * first before all class and style values are set. When there is a change in value
2830
+ * type (like when classes and styles are introduced) a marker must be used to separate
2831
+ * the entries. The marker values themselves are set via entries found in the
2832
+ * [AttributeMarker] enum.
2833
+ */
2834
+ hostAttrs?: TAttributes;
2835
+ /**
2836
+ * Function to create instances of content queries associated with a given directive.
2837
+ */
2838
+ contentQueries?: ContentQueriesFunction<T>;
2839
+ /**
2840
+ * Additional set of instructions specific to view query processing. This could be seen as a
2841
+ * set of instructions to be inserted into the template function.
2842
+ */
2843
+ viewQuery?: ViewQueriesFunction<T> | null;
2844
+ /**
2845
+ * Defines the name that can be used in the template to assign this directive to a variable.
2846
+ *
2847
+ * See: {@link Directive.exportAs}
2848
+ */
2849
+ exportAs?: string[];
2850
+ /**
2851
+ * Whether this directive/component is standalone.
2852
+ */
2853
+ standalone?: boolean;
2854
+ }
2855
+
2856
+ declare type DirectiveDefList = (ɵDirectiveDef<any> | ɵComponentDef<any>)[];
2857
+
2858
+ /**
2859
+ * Type used for directiveDefs on component definition.
2860
+ *
2861
+ * The function is necessary to be able to support forward declarations.
2862
+ */
2863
+ declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
2864
+
2865
+ /**
2866
+ * @description
2867
+ * Hook for manual bootstrapping of the application instead of using `bootstrap` array in @NgModule
2868
+ * annotation. This hook is invoked only when the `bootstrap` array is empty or not provided.
2869
+ *
2870
+ * Reference to the current application is provided as a parameter.
2871
+ *
2872
+ * See ["Bootstrapping"](guide/bootstrapping) and ["Entry components"](guide/entry-components).
2873
+ *
2874
+ * @usageNotes
2875
+ * The example below uses `ApplicationRef.bootstrap()` to render the
2876
+ * `AppComponent` on the page.
2877
+ *
2878
+ * ```typescript
2879
+ * class AppModule implements DoBootstrap {
2880
+ * ngDoBootstrap(appRef: ApplicationRef) {
2881
+ * appRef.bootstrap(AppComponent); // Or some other component
2882
+ * }
2883
+ * }
2884
+ * ```
2885
+ *
2886
+ * @publicApi
2887
+ */
2888
+ export declare interface DoBootstrap {
2889
+ ngDoBootstrap(appRef: ApplicationRef): void;
2890
+ }
2891
+
2892
+ /**
2893
+ * A lifecycle hook that invokes a custom change-detection function for a directive,
2894
+ * in addition to the check performed by the default change-detector.
2895
+ *
2896
+ * The default change-detection algorithm looks for differences by comparing
2897
+ * bound-property values by reference across change detection runs. You can use this
2898
+ * hook to check for and respond to changes by some other means.
2899
+ *
2900
+ * When the default change detector detects changes, it invokes `ngOnChanges()` if supplied,
2901
+ * regardless of whether you perform additional change detection.
2902
+ * Typically, you should not use both `DoCheck` and `OnChanges` to respond to
2903
+ * changes on the same input.
2904
+ *
2905
+ * @see `OnChanges`
2906
+ * @see [Lifecycle hooks guide](guide/lifecycle-hooks)
2907
+ *
2908
+ * @usageNotes
2909
+ * The following snippet shows how a component can implement this interface
2910
+ * to invoke it own change-detection cycle.
2911
+ *
2912
+ * {@example core/ts/metadata/lifecycle_hooks_spec.ts region='DoCheck'}
2913
+ *
2914
+ * For a more complete example and discussion, see
2915
+ * [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection).
2916
+ *
2917
+ * @publicApi
2918
+ */
2919
+ export declare interface DoCheck {
2920
+ /**
2921
+ * A callback method that performs change-detection, invoked
2922
+ * after the default change-detector runs.
2923
+ * See `KeyValueDiffers` and `IterableDiffers` for implementing
2924
+ * custom change checking for collections.
2925
+ *
2926
+ */
2927
+ ngDoCheck(): void;
2928
+ }
2929
+
2930
+ /**
2931
+ * A bidirectional edge in the producer-consumer dependency graph.
2932
+ */
2933
+ declare interface Edge {
2934
+ /**
2935
+ * Weakly held reference to the `Consumer` side of this edge.
2936
+ */
2937
+ readonly consumerRef: WeakRef<Consumer>;
2938
+ /**
2939
+ * Weakly held reference to the `Producer` side of this edge.
2940
+ */
2941
+ readonly producerRef: WeakRef<Producer>;
2942
+ /**
2943
+ * `trackingVersion` of the `Consumer` at which this dependency edge was last observed.
2944
+ *
2945
+ * If this doesn't match the `Consumer`'s current `trackingVersion`, then this dependency record
2946
+ * is stale, and needs to be cleaned up.
2947
+ */
2948
+ atTrackingVersion: number;
2949
+ /**
2950
+ * `valueVersion` of the `Producer` at the time this dependency was last accessed.
2951
+ *
2952
+ * This is used by `consumerPollValueStatus` to determine whether a `Consumer`'s dependencies have
2953
+ * semantically changed.
2954
+ */
2955
+ seenValueVersion: number;
2956
+ }
2957
+
2958
+ /**
2959
+ * A global reactive effect, which can be manually scheduled or destroyed.
2960
+ *
2961
+ * @developerPreview
2962
+ */
2963
+ export declare interface Effect {
2964
+ /**
2965
+ * Schedule the effect for manual execution, if it's not already.
2966
+ */
2967
+ schedule(): void;
2968
+ /**
2969
+ * Shut down the effect, removing it from any upcoming scheduled executions.
2970
+ */
2971
+ destroy(): void;
2972
+ /**
2973
+ * Direct access to the effect's `Consumer` for advanced use cases.
2974
+ */
2684
2975
  readonly consumer: Consumer;
2685
2976
  }
2686
2977
 
@@ -2691,6 +2982,12 @@ export declare interface Effect {
2691
2982
  */
2692
2983
  export declare function effect(effectFn: () => void): Effect;
2693
2984
 
2985
+ /**
2986
+ * Keys within serialized view data structure to represent various
2987
+ * parts. See the `SerializedView` interface below for additional information.
2988
+ */
2989
+ declare const ELEMENT_CONTAINERS = "e";
2990
+
2694
2991
  /**
2695
2992
  * Marks that the next string is an element name.
2696
2993
  *
@@ -2876,6 +3173,7 @@ export declare abstract class EnvironmentInjector implements Injector {
2876
3173
  *
2877
3174
  * @param fn the closure to be run in the context of this injector
2878
3175
  * @returns the return value of the function, if any
3176
+ * @deprecated use the standalone function `runInInjectionContext` instead
2879
3177
  */
2880
3178
  abstract runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
2881
3179
  abstract destroy(): void;
@@ -3548,6 +3846,8 @@ export declare interface HostListenerDecorator {
3548
3846
  new (eventName: string, args?: string[]): any;
3549
3847
  }
3550
3848
 
3849
+ declare const HYDRATION = 23;
3850
+
3551
3851
  declare namespace i0 {
3552
3852
  export {
3553
3853
  ɵɵinject,
@@ -4754,7 +5054,7 @@ declare interface LContainer extends Array<any> {
4754
5054
  */
4755
5055
  [T_HOST]: TNode;
4756
5056
  /** The comment element that serves as an anchor for this LContainer. */
4757
- readonly [NATIVE]: RComment;
5057
+ [NATIVE]: RComment;
4758
5058
  /**
4759
5059
  * Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.
4760
5060
  *
@@ -4764,6 +5064,17 @@ declare interface LContainer extends Array<any> {
4764
5064
  * doing so creates circular dependency.
4765
5065
  */
4766
5066
  [VIEW_REFS]: unknown[] | null;
5067
+ /**
5068
+ * Array of dehydrated views within this container.
5069
+ *
5070
+ * This information is used during the hydration process on the client.
5071
+ * The hydration logic tries to find a matching dehydrated view, "claim" it
5072
+ * and use this information to do further matching. After that, this "claimed"
5073
+ * view is removed from the list. The remaining "unclaimed" views are
5074
+ * "garbage-collected" later on, i.e. removed from the DOM once the hydration
5075
+ * logic finishes.
5076
+ */
5077
+ [DEHYDRATED_VIEWS]: DehydratedContainerView[] | null;
4767
5078
  }
4768
5079
 
4769
5080
  /**
@@ -5087,6 +5398,10 @@ declare interface LView<T = unknown> extends Array<any> {
5087
5398
  [TRANSPLANTED_VIEWS_TO_REFRESH]: number;
5088
5399
  /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */
5089
5400
  [ID]: number;
5401
+ /**
5402
+ * A container related to hydration annotation information that's associated with this LView.
5403
+ */
5404
+ [HYDRATION]: DehydratedView | null;
5090
5405
  /**
5091
5406
  * Optional injector assigned to embedded views that takes
5092
5407
  * precedence over the element and module injectors.
@@ -5153,6 +5468,16 @@ declare const enum LViewFlags {
5153
5468
  */
5154
5469
  export declare function makeEnvironmentProviders(providers: (Provider | EnvironmentProviders)[]): EnvironmentProviders;
5155
5470
 
5471
+ /**
5472
+ * Merge multiple application configurations from left to right.
5473
+ *
5474
+ * @param configs Two or more configurations to be merged.
5475
+ * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
5476
+ *
5477
+ * @publicApi
5478
+ */
5479
+ export declare function mergeApplicationConfig(...configs: ApplicationConfig[]): ApplicationConfig;
5480
+
5156
5481
  /**
5157
5482
  * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
5158
5483
  * that the compiler should use in case of missing translations:
@@ -5213,6 +5538,12 @@ export declare interface ModuleWithProviders<T> {
5213
5538
 
5214
5539
  declare const MOVED_VIEWS = 9;
5215
5540
 
5541
+ declare type Mutable<T extends {
5542
+ [x: string]: any;
5543
+ }, K extends string> = {
5544
+ [P in K]: T[P];
5545
+ };
5546
+
5216
5547
  declare const NATIVE = 7;
5217
5548
 
5218
5549
  declare const NEXT = 4;
@@ -5663,6 +5994,8 @@ export declare class NgZone {
5663
5994
  */
5664
5995
  export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
5665
5996
 
5997
+ declare const NUM_ROOT_NODES = "r";
5998
+
5666
5999
  declare const ON_DESTROY_HOOKS = 22;
5667
6000
 
5668
6001
  /**
@@ -6565,7 +6898,7 @@ declare class R3Injector extends EnvironmentInjector {
6565
6898
  runInContext<ReturnT>(fn: () => ReturnT): ReturnT;
6566
6899
  get<T>(token: ProviderToken<T>, notFoundValue?: any, flags?: InjectFlags | InjectOptions): T;
6567
6900
  toString(): string;
6568
- private assertNotDestroyed;
6901
+ assertNotDestroyed(): void;
6569
6902
  /**
6570
6903
  * Process a `SingleProvider` and add it.
6571
6904
  */
@@ -6919,11 +7252,13 @@ export declare class ReflectiveKey {
6919
7252
  * listeners on Element.
6920
7253
  */
6921
7254
  declare interface RElement extends RNode {
7255
+ firstChild: RNode | null;
6922
7256
  style: RCssStyleDeclaration;
6923
7257
  classList: RDomTokenList;
6924
7258
  className: string;
6925
7259
  tagName: string;
6926
7260
  textContent: string | null;
7261
+ getAttribute(name: string): string | null;
6927
7262
  setAttribute(name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
6928
7263
  removeAttribute(name: string): void;
6929
7264
  setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL): void;
@@ -7348,6 +7683,20 @@ declare interface RText extends RNode {
7348
7683
  textContent: string | null;
7349
7684
  }
7350
7685
 
7686
+ /**
7687
+ * Runs the given function in the context of the given `Injector`.
7688
+ *
7689
+ * Within the function's stack frame, `inject` can be used to inject dependencies from the given
7690
+ * `Injector`. Note that `inject` is only usable synchronously, and cannot be used in any
7691
+ * asynchronous callbacks or after any `await` points.
7692
+ *
7693
+ * @param injector the injector which will satisfy calls to `inject` while `fn` is executing
7694
+ * @param fn the closure to be run in the context of `injector`
7695
+ * @returns the return value of the function, if any
7696
+ * @publicApi
7697
+ */
7698
+ export declare function runInInjectionContext<ReturnT>(injector: Injector, fn: () => ReturnT): ReturnT;
7699
+
7351
7700
 
7352
7701
  /**
7353
7702
  * The list of error codes used in runtime code of the `core` package.
@@ -7386,7 +7735,7 @@ declare const enum RuntimeErrorCode {
7386
7735
  HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
7387
7736
  MULTIPLE_PLATFORMS = 400,
7388
7737
  PLATFORM_NOT_FOUND = 401,
7389
- ERROR_HANDLER_NOT_FOUND = 402,
7738
+ MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
7390
7739
  BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,
7391
7740
  PLATFORM_ALREADY_DESTROYED = 404,
7392
7741
  ASYNC_INITIALIZERS_STILL_RUNNING = 405,
@@ -7517,6 +7866,65 @@ export declare interface SelfDecorator {
7517
7866
  new (): Self;
7518
7867
  }
7519
7868
 
7869
+ /**
7870
+ * Serialized data structure that contains relevant hydration
7871
+ * annotation information about a view that is a part of a
7872
+ * ViewContainer collection.
7873
+ */
7874
+ declare interface SerializedContainerView extends SerializedView {
7875
+ /**
7876
+ * Unique id that represents a TView that was used to create
7877
+ * a given instance of a view:
7878
+ * - TViewType.Embedded: a unique id generated during serialization on the server
7879
+ * - TViewType.Component: an id generated based on component properties
7880
+ * (see `getComponentId` function for details)
7881
+ */
7882
+ [TEMPLATE_ID]: string;
7883
+ /**
7884
+ * Number of root nodes that belong to this view.
7885
+ * This information is needed to effectively traverse the DOM tree
7886
+ * and identify segments that belong to different views.
7887
+ */
7888
+ [NUM_ROOT_NODES]: number;
7889
+ }
7890
+
7891
+ /**
7892
+ * Represents element containers within this view, stored as key-value pairs
7893
+ * where key is an index of a container in an LView (also used in the
7894
+ * `elementContainerStart` instruction), the value is the number of root nodes
7895
+ * in this container. This information is needed to locate an anchor comment
7896
+ * node that goes after all container nodes.
7897
+ */
7898
+ declare interface SerializedElementContainers {
7899
+ [key: number]: number;
7900
+ }
7901
+
7902
+ /**
7903
+ * Serialized data structure that contains relevant hydration
7904
+ * annotation information that describes a given hydration boundary
7905
+ * (e.g. a component).
7906
+ */
7907
+ declare interface SerializedView {
7908
+ /**
7909
+ * Serialized information about <ng-container>s.
7910
+ */
7911
+ [ELEMENT_CONTAINERS]?: SerializedElementContainers;
7912
+ /**
7913
+ * Serialized information about templates.
7914
+ * Key-value pairs where a key is an index of the corresponding
7915
+ * `template` instruction and the value is a unique id that can
7916
+ * be used during hydration to identify that template.
7917
+ */
7918
+ [TEMPLATES]?: Record<number, string>;
7919
+ /**
7920
+ * Serialized information about view containers.
7921
+ * Key-value pairs where a key is an index of the corresponding
7922
+ * LContainer entry within an LView, and the value is a list
7923
+ * of serialized information about views within this container.
7924
+ */
7925
+ [CONTAINERS]?: Record<number, SerializedContainerView[]>;
7926
+ }
7927
+
7520
7928
  /**
7521
7929
  * A `Signal` with a value that can be mutated via a setter interface.
7522
7930
  *
@@ -7761,7 +8169,7 @@ declare interface TContainerNode extends TNode {
7761
8169
  * - They are dynamically created
7762
8170
  */
7763
8171
  parent: TElementNode | TElementContainerNode | null;
7764
- tViews: TView | TView[] | null;
8172
+ tView: TView | null;
7765
8173
  projection: null;
7766
8174
  value: null;
7767
8175
  }
@@ -7801,7 +8209,7 @@ declare interface TElementContainerNode extends TNode {
7801
8209
  index: number;
7802
8210
  child: TElementNode | TTextNode | TContainerNode | TElementContainerNode | TProjectionNode | null;
7803
8211
  parent: TElementNode | TElementContainerNode | null;
7804
- tViews: null;
8212
+ tView: null;
7805
8213
  projection: null;
7806
8214
  }
7807
8215
 
@@ -7816,7 +8224,7 @@ declare interface TElementNode extends TNode {
7816
8224
  * retrieved using viewData[HOST_NODE]).
7817
8225
  */
7818
8226
  parent: TElementNode | TElementContainerNode | null;
7819
- tViews: null;
8227
+ tView: null;
7820
8228
  /**
7821
8229
  * If this is a component TNode with projection, this will be an array of projected
7822
8230
  * TNodes or native nodes (see TNode.projection for more info). If it's a regular element node
@@ -7829,6 +8237,8 @@ declare interface TElementNode extends TNode {
7829
8237
  value: string;
7830
8238
  }
7831
8239
 
8240
+ declare const TEMPLATE_ID = "i";
8241
+
7832
8242
  /**
7833
8243
  * Represents an embedded template that can be used to instantiate embedded views.
7834
8244
  * To instantiate embedded views based on a template, use the `ViewContainerRef`
@@ -7870,6 +8280,8 @@ export declare abstract class TemplateRef<C> {
7870
8280
  abstract createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;
7871
8281
  }
7872
8282
 
8283
+ declare const TEMPLATES = "t";
8284
+
7873
8285
  /**
7874
8286
  * The Testability service provides testing hooks that can be accessed from
7875
8287
  * the browser.
@@ -8254,26 +8666,14 @@ declare interface TNode {
8254
8666
  */
8255
8667
  outputs: PropertyAliases | null;
8256
8668
  /**
8257
- * The TView or TViews attached to this node.
8258
- *
8259
- * If this TNode corresponds to an LContainer with inline views, the container will
8260
- * need to store separate static data for each of its view blocks (TView[]). Otherwise,
8261
- * nodes in inline views with the same index as nodes in their parent views will overwrite
8262
- * each other, as they are in the same template.
8263
- *
8264
- * Each index in this array corresponds to the static data for a certain
8265
- * view. So if you had V(0) and V(1) in a container, you might have:
8266
- *
8267
- * [
8268
- * [{tagName: 'div', attrs: ...}, null], // V(0) TView
8269
- * [{tagName: 'button', attrs ...}, null] // V(1) TView
8669
+ * The TView attached to this node.
8270
8670
  *
8271
8671
  * If this TNode corresponds to an LContainer with a template (e.g. structural
8272
8672
  * directive), the template's TView will be stored here.
8273
8673
  *
8274
- * If this TNode corresponds to an element, tViews will be null .
8674
+ * If this TNode corresponds to an element, tView will be `null`.
8275
8675
  */
8276
- tViews: TView | TView[] | null;
8676
+ tView: TView | null;
8277
8677
  /**
8278
8678
  * The next sibling node. Necessary so we can propagate through the root nodes of a view
8279
8679
  * to insert them or remove them from the DOM.
@@ -8574,7 +8974,7 @@ declare interface TProjectionNode extends TNode {
8574
8974
  * retrieved using LView.node).
8575
8975
  */
8576
8976
  parent: TElementNode | TElementContainerNode | null;
8577
- tViews: null;
8977
+ tView: null;
8578
8978
  /** Index of the projection node. (See TNode.projection for more info.) */
8579
8979
  projection: number;
8580
8980
  value: null;
@@ -8965,7 +9365,7 @@ declare interface TTextNode extends TNode {
8965
9365
  * retrieved using LView.node).
8966
9366
  */
8967
9367
  parent: TElementNode | TElementContainerNode | null;
8968
- tViews: null;
9368
+ tView: null;
8969
9369
  projection: null;
8970
9370
  }
8971
9371
 
@@ -9196,6 +9596,13 @@ declare interface TView {
9196
9596
  * view. This means that the view is likely corrupted and we should try to recover it.
9197
9597
  */
9198
9598
  incompleteFirstPass: boolean;
9599
+ /**
9600
+ * Unique id of this TView for hydration purposes:
9601
+ * - TViewType.Embedded: a unique id generated during serialization on the server
9602
+ * - TViewType.Component: an id generated based on component properties
9603
+ * (see `getComponentId` function for details)
9604
+ */
9605
+ ssrId: string | null;
9199
9606
  }
9200
9607
 
9201
9608
  /**
@@ -9817,14 +10224,13 @@ export declare function ɵallowSanitizationBypassAndThrow(value: any, type: ɵBy
9817
10224
  export declare function ɵallowSanitizationBypassAndThrow(value: any, type: ɵBypassType): boolean;
9818
10225
 
9819
10226
  /**
9820
- * Providers that generate a random `APP_ID_TOKEN`.
9821
- * @publicApi
10227
+ * Annotates all components bootstrapped in a given ApplicationRef
10228
+ * with info needed for hydration.
10229
+ *
10230
+ * @param appRef An instance of an ApplicationRef.
10231
+ * @param doc A reference to the current Document instance.
9822
10232
  */
9823
- export declare const ɵAPP_ID_RANDOM_PROVIDER: {
9824
- provide: InjectionToken<string>;
9825
- useFactory: typeof _appIdRandomProviderFactory;
9826
- deps: any[];
9827
- };
10233
+ export declare function ɵannotateForHydration(appRef: ApplicationRef, doc: Document): void;
9828
10234
 
9829
10235
  /**
9830
10236
  * A set of marker values to be used in the attributes arrays. These markers indicate that some
@@ -10018,43 +10424,6 @@ export declare const enum ɵBypassType {
10018
10424
  Style = "Style"
10019
10425
  }
10020
10426
 
10021
- /**
10022
- * Defines the possible states of the default change detector.
10023
- * @see `ChangeDetectorRef`
10024
- */
10025
- export declare enum ɵChangeDetectorStatus {
10026
- /**
10027
- * A state in which, after calling `detectChanges()`, the change detector
10028
- * state becomes `Checked`, and must be explicitly invoked or reactivated.
10029
- */
10030
- CheckOnce = 0,
10031
- /**
10032
- * A state in which change detection is skipped until the change detector mode
10033
- * becomes `CheckOnce`.
10034
- */
10035
- Checked = 1,
10036
- /**
10037
- * A state in which change detection continues automatically until explicitly
10038
- * deactivated.
10039
- */
10040
- CheckAlways = 2,
10041
- /**
10042
- * A state in which a change detector sub tree is not a part of the main tree and
10043
- * should be skipped.
10044
- */
10045
- Detached = 3,
10046
- /**
10047
- * Indicates that the change detector encountered an error checking a binding
10048
- * or calling a directive lifecycle method and is now in an inconsistent state. Change
10049
- * detectors in this state do not detect changes.
10050
- */
10051
- Errored = 4,
10052
- /**
10053
- * Indicates that the change detector has been destroyed.
10054
- */
10055
- Destroyed = 5
10056
- }
10057
-
10058
10427
  export declare function ɵclearResolutionOfComponentResourcesQueue(): Map<Type<any>, Component>;
10059
10428
 
10060
10429
 
@@ -10411,6 +10780,7 @@ export declare interface ɵDirectiveType<T> extends Type<T> {
10411
10780
  ɵfac: unknown;
10412
10781
  }
10413
10782
 
10783
+
10414
10784
  export declare function ɵescapeTransferStateContent(text: string): string;
10415
10785
 
10416
10786
  /**
@@ -10444,7 +10814,12 @@ export declare function ɵflushModuleScopingQueueAsMuchAsPossible(): void;
10444
10814
  */
10445
10815
  export declare function ɵformatRuntimeError<T extends number = RuntimeErrorCode>(code: T, message: null | false | string): string;
10446
10816
 
10447
- export declare function ɵgetDebugNodeR2(_nativeNode: any): DebugNode | null;
10817
+ /**
10818
+ * The following getter methods retrieve the definition from the type. Currently the retrieval
10819
+ * honors inheritance, but in the future we may change the rule to require that definitions are
10820
+ * explicit. This would require some sort of migration strategy.
10821
+ */
10822
+ export declare function ɵgetComponentDef<T>(type: any): ɵComponentDef<T> | null;
10448
10823
 
10449
10824
  /**
10450
10825
  * Retrieves directive instances associated with a given DOM node. Does not include
@@ -10589,38 +10964,21 @@ export declare interface ɵInternalEnvironmentProviders extends EnvironmentProvi
10589
10964
  ɵfromNgModule?: true;
10590
10965
  }
10591
10966
 
10592
- export declare function ɵisBoundToModule<C>(cf: ComponentFactory<C>): boolean;
10593
-
10594
10967
  /**
10595
- * Reports whether a given strategy is currently the default for change detection.
10596
- * @param changeDetectionStrategy The strategy to check.
10597
- * @returns True if the given strategy is the current default, false otherwise.
10598
- * @see `ChangeDetectorStatus`
10599
- * @see `ChangeDetectorRef`
10968
+ * Internal token that specifies whether hydration is enabled.
10600
10969
  */
10601
- export declare function ɵisDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy): boolean;
10970
+ export declare const ɵIS_HYDRATION_FEATURE_ENABLED: InjectionToken<boolean>;
10971
+
10972
+ export declare function ɵisBoundToModule<C>(cf: ComponentFactory<C>): boolean;
10602
10973
 
10603
10974
  export declare function ɵisEnvironmentProviders(value: Provider | EnvironmentProviders | ɵInternalEnvironmentProviders): value is ɵInternalEnvironmentProviders;
10604
10975
 
10605
10976
  export declare function ɵisInjectable(type: any): boolean;
10606
10977
 
10607
- export declare function ɵisListLikeIterable(obj: any): boolean;
10608
-
10609
10978
  export declare function ɵisNgModule<T>(value: Type<T>): value is Type<T> & {
10610
10979
  ɵmod: ɵNgModuleDef<T>;
10611
10980
  };
10612
10981
 
10613
- /**
10614
- * Determine if the argument is an Observable
10615
- *
10616
- * Strictly this tests that the `obj` is `Subscribable`, since `Observable`
10617
- * types need additional methods, such as `lift()`. But it is adequate for our
10618
- * needs since within the Angular framework code we only ever need to use the
10619
- * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects
10620
- * into `Observable` as needed.
10621
- */
10622
- export declare const ɵisObservable: (obj: any | Observable<any>) => obj is Observable<any>;
10623
-
10624
10982
  /**
10625
10983
  * Determine if the argument is shaped like a Promise
10626
10984
  */
@@ -10629,9 +10987,7 @@ export declare function ɵisPromise<T = any>(obj: any): obj is Promise<T>;
10629
10987
  /**
10630
10988
  * Determine if the argument is a Subscribable
10631
10989
  */
10632
- export declare function ɵisSubscribable(obj: any | Subscribable<any>): obj is Subscribable<any>;
10633
-
10634
- export declare const ɵivyEnabled = true;
10990
+ export declare function ɵisSubscribable<T>(obj: any | Subscribable<T>): obj is Subscribable<T>;
10635
10991
 
10636
10992
  /**
10637
10993
  * The internal view context which is specific to a given DOM element, directive or
@@ -10856,9 +11212,9 @@ export declare const ɵNO_CHANGE: ɵNO_CHANGE;
10856
11212
  * to framework to perform rendering.
10857
11213
  */
10858
11214
  export declare class ɵNoopNgZone implements NgZone {
10859
- readonly hasPendingMicrotasks: boolean;
10860
- readonly hasPendingMacrotasks: boolean;
10861
- readonly isStable: boolean;
11215
+ readonly hasPendingMicrotasks = false;
11216
+ readonly hasPendingMacrotasks = false;
11217
+ readonly isStable = true;
10862
11218
  readonly onUnstable: EventEmitter<any>;
10863
11219
  readonly onMicrotaskEmpty: EventEmitter<any>;
10864
11220
  readonly onStable: EventEmitter<any>;
@@ -10985,6 +11341,52 @@ export declare const enum ɵProfilerEvent {
10985
11341
  OutputEnd = 7
10986
11342
  }
10987
11343
 
11344
+ /**
11345
+ * Returns a set of providers required to setup hydration support
11346
+ * for an application that is server side rendered.
11347
+ *
11348
+ * ## NgModule-based bootstrap
11349
+ *
11350
+ * You can add the function call to the root AppModule of an application:
11351
+ * ```
11352
+ * import {provideHydrationSupport} from '@angular/core';
11353
+ *
11354
+ * @NgModule({
11355
+ * providers: [
11356
+ * // ... other providers ...
11357
+ * provideHydrationSupport()
11358
+ * ],
11359
+ * declarations: [AppComponent],
11360
+ * bootstrap: [AppComponent]
11361
+ * })
11362
+ * class AppModule {}
11363
+ * ```
11364
+ *
11365
+ * ## Standalone-based bootstrap
11366
+ *
11367
+ * Add the function to the `bootstrapApplication` call:
11368
+ * ```
11369
+ * import {provideHydrationSupport} from '@angular/core';
11370
+ *
11371
+ * bootstrapApplication(RootComponent, {
11372
+ * providers: [
11373
+ * // ... other providers ...
11374
+ * provideHydrationSupport()
11375
+ * ]
11376
+ * });
11377
+ * ```
11378
+ *
11379
+ * The function sets up an internal flag that would be recognized during
11380
+ * the server side rendering time as well, so there is no need to
11381
+ * configure or change anything in NgUniversal to enable the feature.
11382
+ *
11383
+ * @publicApi
11384
+ * @developerPreview
11385
+ */
11386
+ export declare function ɵprovideHydrationSupport(): EnvironmentProviders;
11387
+
11388
+ export declare function ɵprovideNgZoneChangeDetection(ngZone: NgZone): StaticProvider[];
11389
+
10988
11390
  /**
10989
11391
  * Publishes a collection of default debug tools onto`window.ng`.
10990
11392
  *
@@ -11082,7 +11484,7 @@ export declare class ɵRender3NgModuleRef<T> extends NgModuleRef<T> implements I
11082
11484
  instance: T;
11083
11485
  destroyCbs: (() => void)[] | null;
11084
11486
  readonly componentFactoryResolver: ComponentFactoryResolver_2;
11085
- constructor(ngModuleType: Type<T>, _parent: Injector | null);
11487
+ constructor(ngModuleType: Type<T>, _parent: Injector | null, additionalProviders: StaticProvider[]);
11086
11488
  get injector(): EnvironmentInjector;
11087
11489
  destroy(): void;
11088
11490
  onDestroy(callback: () => void): void;
@@ -11324,9 +11726,9 @@ export declare const ɵTESTABILITY_GETTER: InjectionToken<GetTestability>;
11324
11726
  * @publicApi
11325
11727
  */
11326
11728
  export declare class ɵTransferState {
11327
- private store;
11729
+ /** @nocollapse */
11730
+ static ɵprov: unknown;
11328
11731
  private onSerializeCallbacks;
11329
- constructor();
11330
11732
  /**
11331
11733
  * Get the value corresponding to a key. Return `defaultValue` if key is not found.
11332
11734
  */
@@ -11355,8 +11757,6 @@ export declare class ɵTransferState {
11355
11757
  * Serialize the current state of the store to JSON.
11356
11758
  */
11357
11759
  toJson(): string;
11358
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵTransferState, never>;
11359
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵTransferState>;
11360
11760
  }
11361
11761
 
11362
11762
  /**
@@ -12290,7 +12690,7 @@ export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any
12290
12690
  *
12291
12691
  * # Example
12292
12692
  * ```
12293
- * class MyDirective {
12693
+ * class MyComponent {
12294
12694
  * // Generated by Angular Template Compiler
12295
12695
  * // [Symbol] syntax will not be supported by TypeScript until v2.7
12296
12696
  * static ɵcmp = defineComponent({
@@ -12300,230 +12700,7 @@ export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any
12300
12700
  * ```
12301
12701
  * @codeGenApi
12302
12702
  */
12303
- export declare function ɵɵdefineComponent<T>(componentDefinition: {
12304
- /**
12305
- * Directive type, needed to configure the injector.
12306
- */
12307
- type: Type<T>;
12308
- /** The selectors that will be used to match nodes to this component. */
12309
- selectors?: ɵCssSelectorList;
12310
- /**
12311
- * The number of nodes, local refs, and pipes in this component template.
12312
- *
12313
- * Used to calculate the length of this component's LView array, so we
12314
- * can pre-fill the array and set the binding start index.
12315
- */
12316
- decls: number;
12317
- /**
12318
- * The number of bindings in this component template (including pure fn bindings).
12319
- *
12320
- * Used to calculate the length of this component's LView array, so we
12321
- * can pre-fill the array and set the host binding start index.
12322
- */
12323
- vars: number;
12324
- /**
12325
- * A map of input names.
12326
- *
12327
- * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.
12328
- *
12329
- * Given:
12330
- * ```
12331
- * class MyComponent {
12332
- * @Input()
12333
- * publicInput1: string;
12334
- *
12335
- * @Input('publicInput2')
12336
- * declaredInput2: string;
12337
- * }
12338
- * ```
12339
- *
12340
- * is described as:
12341
- * ```
12342
- * {
12343
- * publicInput1: 'publicInput1',
12344
- * declaredInput2: ['publicInput2', 'declaredInput2'],
12345
- * }
12346
- * ```
12347
- *
12348
- * Which the minifier may translate to:
12349
- * ```
12350
- * {
12351
- * minifiedPublicInput1: 'publicInput1',
12352
- * minifiedDeclaredInput2: ['publicInput2', 'declaredInput2'],
12353
- * }
12354
- * ```
12355
- *
12356
- * This allows the render to re-construct the minified, public, and declared names
12357
- * of properties.
12358
- *
12359
- * NOTE:
12360
- * - Because declared and public name are usually same we only generate the array
12361
- * `['public', 'declared']` format when they differ.
12362
- * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
12363
- * inconsistent behavior in that it uses declared names rather than minified or public. For
12364
- * this reason `NgOnChanges` will be deprecated and removed in future version and this
12365
- * API will be simplified to be consistent with `output`.
12366
- */
12367
- inputs?: {
12368
- [P in keyof T]?: string | [string, string];
12369
- };
12370
- /**
12371
- * A map of output names.
12372
- *
12373
- * The format is in: `{[actualPropertyName: string]:string}`.
12374
- *
12375
- * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
12376
- *
12377
- * This allows the render to re-construct the minified and non-minified names
12378
- * of properties.
12379
- */
12380
- outputs?: {
12381
- [P in keyof T]?: string;
12382
- };
12383
- /**
12384
- * Function executed by the parent template to allow child directive to apply host bindings.
12385
- */
12386
- hostBindings?: HostBindingsFunction<T>;
12387
- /**
12388
- * The number of bindings in this directive `hostBindings` (including pure fn bindings).
12389
- *
12390
- * Used to calculate the length of the component's LView array, so we
12391
- * can pre-fill the array and set the host binding start index.
12392
- */
12393
- hostVars?: number;
12394
- /**
12395
- * Assign static attribute values to a host element.
12396
- *
12397
- * This property will assign static attribute values as well as class and style
12398
- * values to a host element. Since attribute values can consist of different types of values, the
12399
- * `hostAttrs` array must include the values in the following format:
12400
- *
12401
- * attrs = [
12402
- * // static attributes (like `title`, `name`, `id`...)
12403
- * attr1, value1, attr2, value,
12404
- *
12405
- * // a single namespace value (like `x:id`)
12406
- * NAMESPACE_MARKER, namespaceUri1, name1, value1,
12407
- *
12408
- * // another single namespace value (like `x:name`)
12409
- * NAMESPACE_MARKER, namespaceUri2, name2, value2,
12410
- *
12411
- * // a series of CSS classes that will be applied to the element (no spaces)
12412
- * CLASSES_MARKER, class1, class2, class3,
12413
- *
12414
- * // a series of CSS styles (property + value) that will be applied to the element
12415
- * STYLES_MARKER, prop1, value1, prop2, value2
12416
- * ]
12417
- *
12418
- * All non-class and non-style attributes must be defined at the start of the list
12419
- * first before all class and style values are set. When there is a change in value
12420
- * type (like when classes and styles are introduced) a marker must be used to separate
12421
- * the entries. The marker values themselves are set via entries found in the
12422
- * [AttributeMarker] enum.
12423
- */
12424
- hostAttrs?: TAttributes;
12425
- /**
12426
- * Function to create instances of content queries associated with a given directive.
12427
- */
12428
- contentQueries?: ContentQueriesFunction<T>;
12429
- /**
12430
- * Defines the name that can be used in the template to assign this directive to a variable.
12431
- *
12432
- * See: {@link Directive.exportAs}
12433
- */
12434
- exportAs?: string[];
12435
- /**
12436
- * Template function use for rendering DOM.
12437
- *
12438
- * This function has following structure.
12439
- *
12440
- * ```
12441
- * function Template<T>(ctx:T, creationMode: boolean) {
12442
- * if (creationMode) {
12443
- * // Contains creation mode instructions.
12444
- * }
12445
- * // Contains binding update instructions
12446
- * }
12447
- * ```
12448
- *
12449
- * Common instructions are:
12450
- * Creation mode instructions:
12451
- * - `elementStart`, `elementEnd`
12452
- * - `text`
12453
- * - `container`
12454
- * - `listener`
12455
- *
12456
- * Binding update instructions:
12457
- * - `bind`
12458
- * - `elementAttribute`
12459
- * - `elementProperty`
12460
- * - `elementClass`
12461
- * - `elementStyle`
12462
- *
12463
- */
12464
- template: ComponentTemplate<T>;
12465
- /**
12466
- * Constants for the nodes in the component's view.
12467
- * Includes attribute arrays, local definition arrays etc.
12468
- */
12469
- consts?: TConstantsOrFactory;
12470
- /**
12471
- * An array of `ngContent[selector]` values that were found in the template.
12472
- */
12473
- ngContentSelectors?: string[];
12474
- /**
12475
- * Additional set of instructions specific to view query processing. This could be seen as a
12476
- * set of instruction to be inserted into the template function.
12477
- *
12478
- * Query-related instructions need to be pulled out to a specific function as a timing of
12479
- * execution is different as compared to all other instructions (after change detection hooks but
12480
- * before view hooks).
12481
- */
12482
- viewQuery?: ViewQueriesFunction<T> | null;
12483
- /**
12484
- * A list of optional features to apply.
12485
- *
12486
- * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}
12487
- */
12488
- features?: ComponentDefFeature[];
12489
- /**
12490
- * Defines template and style encapsulation options available for Component's {@link Component}.
12491
- */
12492
- encapsulation?: ViewEncapsulation;
12493
- /**
12494
- * Defines arbitrary developer-defined data to be stored on a renderer instance.
12495
- * This is useful for renderers that delegate to other renderers.
12496
- *
12497
- * see: animation
12498
- */
12499
- data?: {
12500
- [kind: string]: any;
12501
- };
12502
- /**
12503
- * A set of styles that the component needs to be present for component to render correctly.
12504
- */
12505
- styles?: string[];
12506
- /**
12507
- * The strategy that the default change detector uses to detect changes.
12508
- * When set, takes effect the next time change detection is triggered.
12509
- */
12510
- changeDetection?: ChangeDetectionStrategy;
12511
- /**
12512
- * Registry of directives, components, and pipes that may be found in this component's view.
12513
- *
12514
- * This property is either an array of types or a function that returns the array of types. This
12515
- * function may be necessary to support forward declarations.
12516
- */
12517
- dependencies?: TypeOrFactory<DependencyTypeList>;
12518
- /**
12519
- * The set of schemas that declare elements to be allowed in the component's template.
12520
- */
12521
- schemas?: SchemaMetadata[] | null;
12522
- /**
12523
- * Whether this directive/component is standalone.
12524
- */
12525
- standalone?: boolean;
12526
- }): unknown;
12703
+ export declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): Mutable<ɵComponentDef<any>, keyof ɵComponentDef<any>>;
12527
12704
 
12528
12705
  /**
12529
12706
  * Create a directive definition object.
@@ -12541,132 +12718,7 @@ export declare function ɵɵdefineComponent<T>(componentDefinition: {
12541
12718
  *
12542
12719
  * @codeGenApi
12543
12720
  */
12544
- export declare const ɵɵdefineDirective: <T>(directiveDefinition: {
12545
- /**
12546
- * Directive type, needed to configure the injector.
12547
- */
12548
- type: Type<T>;
12549
- /** The selectors that will be used to match nodes to this directive. */
12550
- selectors?: ɵCssSelectorList | undefined;
12551
- /**
12552
- * A map of input names.
12553
- *
12554
- * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.
12555
- *
12556
- * Given:
12557
- * ```
12558
- * class MyComponent {
12559
- * @Input()
12560
- * publicInput1: string;
12561
- *
12562
- * @Input('publicInput2')
12563
- * declaredInput2: string;
12564
- * }
12565
- * ```
12566
- *
12567
- * is described as:
12568
- * ```
12569
- * {
12570
- * publicInput1: 'publicInput1',
12571
- * declaredInput2: ['declaredInput2', 'publicInput2'],
12572
- * }
12573
- * ```
12574
- *
12575
- * Which the minifier may translate to:
12576
- * ```
12577
- * {
12578
- * minifiedPublicInput1: 'publicInput1',
12579
- * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],
12580
- * }
12581
- * ```
12582
- *
12583
- * This allows the render to re-construct the minified, public, and declared names
12584
- * of properties.
12585
- *
12586
- * NOTE:
12587
- * - Because declared and public name are usually same we only generate the array
12588
- * `['declared', 'public']` format when they differ.
12589
- * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
12590
- * inconsistent behavior in that it uses declared names rather than minified or public. For
12591
- * this reason `NgOnChanges` will be deprecated and removed in future version and this
12592
- * API will be simplified to be consistent with `output`.
12593
- */
12594
- inputs?: { [P in keyof T]?: string | [string, string] | undefined; } | undefined;
12595
- /**
12596
- * A map of output names.
12597
- *
12598
- * The format is in: `{[actualPropertyName: string]:string}`.
12599
- *
12600
- * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.
12601
- *
12602
- * This allows the render to re-construct the minified and non-minified names
12603
- * of properties.
12604
- */
12605
- outputs?: { [P_1 in keyof T]?: string | undefined; } | undefined;
12606
- /**
12607
- * A list of optional features to apply.
12608
- *
12609
- * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}
12610
- */
12611
- features?: DirectiveDefFeature[] | undefined;
12612
- /**
12613
- * Function executed by the parent template to allow child directive to apply host bindings.
12614
- */
12615
- hostBindings?: HostBindingsFunction<T> | undefined;
12616
- /**
12617
- * The number of bindings in this directive `hostBindings` (including pure fn bindings).
12618
- *
12619
- * Used to calculate the length of the component's LView array, so we
12620
- * can pre-fill the array and set the host binding start index.
12621
- */
12622
- hostVars?: number | undefined;
12623
- /**
12624
- * Assign static attribute values to a host element.
12625
- *
12626
- * This property will assign static attribute values as well as class and style
12627
- * values to a host element. Since attribute values can consist of different types of values,
12628
- * the `hostAttrs` array must include the values in the following format:
12629
- *
12630
- * attrs = [
12631
- * // static attributes (like `title`, `name`, `id`...)
12632
- * attr1, value1, attr2, value,
12633
- *
12634
- * // a single namespace value (like `x:id`)
12635
- * NAMESPACE_MARKER, namespaceUri1, name1, value1,
12636
- *
12637
- * // another single namespace value (like `x:name`)
12638
- * NAMESPACE_MARKER, namespaceUri2, name2, value2,
12639
- *
12640
- * // a series of CSS classes that will be applied to the element (no spaces)
12641
- * CLASSES_MARKER, class1, class2, class3,
12642
- *
12643
- * // a series of CSS styles (property + value) that will be applied to the element
12644
- * STYLES_MARKER, prop1, value1, prop2, value2
12645
- * ]
12646
- *
12647
- * All non-class and non-style attributes must be defined at the start of the list
12648
- * first before all class and style values are set. When there is a change in value
12649
- * type (like when classes and styles are introduced) a marker must be used to separate
12650
- * the entries. The marker values themselves are set via entries found in the
12651
- * [AttributeMarker] enum.
12652
- */
12653
- hostAttrs?: TAttributes | undefined;
12654
- /**
12655
- * Function to create instances of content queries associated with a given directive.
12656
- */
12657
- contentQueries?: ContentQueriesFunction<T> | undefined;
12658
- /**
12659
- * Additional set of instructions specific to view query processing. This could be seen as a
12660
- * set of instructions to be inserted into the template function.
12661
- */
12662
- viewQuery?: ViewQueriesFunction<T> | null | undefined;
12663
- /**
12664
- * Defines the name that can be used in the template to assign this directive to a variable.
12665
- *
12666
- * See: {@link Directive.exportAs}
12667
- */
12668
- exportAs?: string[] | undefined;
12669
- }) => never;
12721
+ export declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): Mutable<ɵDirectiveDef<any>, keyof ɵDirectiveDef<any>>;
12670
12722
 
12671
12723
  /**
12672
12724
  * Construct an injectable definition which defines how a token will be constructed by the DI