@angular/platform-browser 22.0.0-next.1 → 22.0.0-next.11

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.
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.1
2
+ * @license Angular v22.0.0-next.11
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  export { BootstrapContext, BrowserModule, bootstrapApplication, createApplication, platformBrowser, provideProtractorTestingSupport } from './_browser-chunk.js';
8
8
  import * as i0 from '@angular/core';
9
- import { ComponentRef, Predicate, DebugNode, DebugElement, Type, ListenerOptions, InjectionToken, NgZone, OnDestroy, RendererFactory2, ɵTracingService as _TracingService, ɵTracingSnapshot as _TracingSnapshot, RendererType2, Renderer2, Injector, Sanitizer, SecurityContext, Provider, EnvironmentProviders, GetTestability, TestabilityRegistry, Testability, Version } from '@angular/core';
9
+ import { ComponentRef, Predicate, DebugNode, DebugElement, Type, ListenerOptions, InjectionToken, NgZone, ɵSharedStylesHost as _SharedStylesHost, OnDestroy, RendererFactory2, ɵTracingService as _TracingService, ɵTracingSnapshot as _TracingSnapshot, RendererType2, Renderer2, Provider, EnvironmentProviders, Sanitizer, SecurityContext, GetTestability, TestabilityRegistry, Testability, Version } from '@angular/core';
10
10
  import { HttpTransferCacheOptions } from '@angular/common/http';
11
11
  import { ɵDomAdapter as _DomAdapter } from '@angular/common';
12
12
  export { ɵgetDOM } from '@angular/common';
@@ -278,7 +278,7 @@ interface UsageRecord<T> {
278
278
  elements: T[];
279
279
  usage: number;
280
280
  }
281
- declare class SharedStylesHost implements OnDestroy {
281
+ declare class SharedStylesHost implements _SharedStylesHost, OnDestroy {
282
282
  private readonly doc;
283
283
  private readonly appId;
284
284
  private readonly nonce?;
@@ -297,10 +297,6 @@ declare class SharedStylesHost implements OnDestroy {
297
297
  */
298
298
  private readonly hosts;
299
299
  constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
300
- /**
301
- * Adds embedded styles to the DOM via HTML `style` elements.
302
- * @param styles An array of style content strings.
303
- */
304
300
  addStyles(styles: string[], urls?: string[]): void;
305
301
  /**
306
302
  * Removes embedded styles from the DOM that were added as HTML `style` elements.
@@ -310,12 +306,6 @@ declare class SharedStylesHost implements OnDestroy {
310
306
  protected addUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>, creator: (value: string, doc: Document) => T): void;
311
307
  protected removeUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>): void;
312
308
  ngOnDestroy(): void;
313
- /**
314
- * Adds a host node to the set of style hosts and adds all existing style usage to
315
- * the newly added host node.
316
- *
317
- * This is currently only used for Shadow DOM encapsulation mode.
318
- */
319
309
  addHost(hostNode: Node): void;
320
310
  removeHost(hostNode: Node): void;
321
311
  private addElement;
@@ -356,133 +346,151 @@ declare class DomRendererFactory2 implements RendererFactory2, OnDestroy {
356
346
  }
357
347
 
358
348
  /**
359
- * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
360
- * @see {@link HammerGestureConfig}
349
+ * The list of features as an enum to uniquely type each `HydrationFeature`.
350
+ * @see {@link HydrationFeature}
361
351
  *
362
- * @ngModule HammerModule
363
352
  * @publicApi
364
- *
365
- * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
366
353
  */
367
- declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
354
+ declare enum HydrationFeatureKind {
355
+ NoHttpTransferCache = 0,
356
+ HttpTransferCacheOptions = 1,
357
+ I18nSupport = 2,
358
+ EventReplay = 3,
359
+ IncrementalHydration = 4,
360
+ NoIncrementalHydration = 5
361
+ }
368
362
  /**
369
- * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
363
+ * Helper type to represent a Hydration feature.
370
364
  *
371
365
  * @publicApi
366
+ */
367
+ interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
368
+ ɵkind: FeatureKind;
369
+ ɵproviders: Provider[];
370
+ }
371
+ /**
372
+ * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
373
+ * server and other one on the browser.
372
374
  *
373
- * @deprecated The hammerjs integration is deprecated. Replace it by your own implementation.
375
+ * @see [Disabling Caching](guide/ssr#disabling-caching)
376
+ *
377
+ * @publicApi
374
378
  */
375
- type HammerLoader = () => Promise<void>;
379
+ declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
376
380
  /**
377
- * Injection token used to provide a HammerLoader to Angular.
381
+ * The function accepts an object, which allows to configure cache parameters,
382
+ * such as which headers should be included (no headers are included by default),
383
+ * whether POST requests should be cached or a callback function to determine if a
384
+ * particular request should be cached.
378
385
  *
379
- * @see {@link HammerLoader}
386
+ * @see [Configuring HTTP transfer cache options](guide/ssr#caching-data-when-using-httpclient)
380
387
  *
381
388
  * @publicApi
389
+ */
390
+ declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>;
391
+ /**
392
+ * Enables support for hydrating i18n blocks.
382
393
  *
383
- * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
394
+ * @publicApi 20.0
384
395
  */
385
- declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
386
- interface HammerInstance {
387
- on(eventName: string, callback?: Function): void;
388
- off(eventName: string, callback?: Function): void;
389
- destroy?(): void;
390
- }
396
+ declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>;
391
397
  /**
392
- * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
393
- * for gesture recognition. Configures specific event recognition.
398
+ * Enables support for replaying user events (e.g. `click`s) that happened on a page
399
+ * before hydration logic has completed. Once an application is hydrated, all captured
400
+ * events are replayed and relevant event listeners are executed.
401
+ *
402
+ * @usageNotes
403
+ *
404
+ * Basic example of how you can enable event replay in your application when
405
+ * `bootstrapApplication` function is used:
406
+ * ```ts
407
+ * bootstrapApplication(App, {
408
+ * providers: [provideClientHydration(withEventReplay())]
409
+ * });
410
+ * ```
394
411
  * @publicApi
412
+ * @see {@link provideClientHydration}
413
+ */
414
+ declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>;
415
+ /**
416
+ * Enables support for incremental hydration using the `hydrate` trigger syntax.
417
+ *
418
+ * @usageNotes
395
419
  *
396
- * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
420
+ * Basic example of how you can enable incremental hydration in your application when
421
+ * the `bootstrapApplication` function is used:
422
+ * ```ts
423
+ * bootstrapApplication(App, {
424
+ * providers: [provideClientHydration(withIncrementalHydration())]
425
+ * });
426
+ * ```
427
+ * @publicApi 20.0
428
+ * @see {@link provideClientHydration}
429
+ *
430
+ * @deprecated Since v22.0.0, incremental hydration is enabled by default with `provideClientHydration`.
431
+ * Intent to remove in v24.
397
432
  */
398
- declare class HammerGestureConfig {
399
- /**
400
- * A set of supported event names for gestures to be used in Angular.
401
- * Angular supports all built-in recognizers, as listed in
402
- * [HammerJS documentation](https://hammerjs.github.io/).
403
- */
404
- events: string[];
405
- /**
406
- * Maps gesture event names to a set of configuration options
407
- * that specify overrides to the default values for specific properties.
408
- *
409
- * The key is a supported event name to be configured,
410
- * and the options object contains a set of properties, with override values
411
- * to be applied to the named recognizer event.
412
- * For example, to disable recognition of the rotate event, specify
413
- * `{"rotate": {"enable": false}}`.
414
- *
415
- * Properties that are not present take the HammerJS default values.
416
- * For information about which properties are supported for which events,
417
- * and their allowed and default values, see
418
- * [HammerJS documentation](https://hammerjs.github.io/).
419
- *
420
- */
421
- overrides: {
422
- [key: string]: Object;
423
- };
424
- /**
425
- * Properties whose default values can be overridden for a given event.
426
- * Different sets of properties apply to different events.
427
- * For information about which properties are supported for which events,
428
- * and their allowed and default values, see
429
- * [HammerJS documentation](https://hammerjs.github.io/).
430
- */
431
- options?: {
432
- cssProps?: any;
433
- domEvents?: boolean;
434
- enable?: boolean | ((manager: any) => boolean);
435
- preset?: any[];
436
- touchAction?: string;
437
- recognizers?: any[];
438
- inputClass?: any;
439
- inputTarget?: EventTarget;
440
- };
441
- /**
442
- * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
443
- * and attaches it to a given HTML element.
444
- * @param element The element that will recognize gestures.
445
- * @returns A HammerJS event-manager object.
446
- */
447
- buildHammer(element: HTMLElement): HammerInstance;
448
- static ɵfac: i0.ɵɵFactoryDeclaration<HammerGestureConfig, never>;
449
- static ɵprov: i0.ɵɵInjectableDeclaration<HammerGestureConfig>;
450
- }
433
+ declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>;
451
434
  /**
452
- * Event plugin that adds Hammer support to an application.
435
+ * Disables support for incremental hydration (which is enabled by default).
453
436
  *
454
- * @ngModule HammerModule
437
+ * @publicApi 22.0
438
+ * @see {@link provideClientHydration}
455
439
  */
456
- declare class HammerGesturesPlugin extends EventManagerPlugin {
457
- private _config;
458
- private _injector;
459
- private loader?;
460
- private _loaderPromise;
461
- constructor(doc: any, _config: HammerGestureConfig, _injector: Injector, loader?: (HammerLoader | null) | undefined);
462
- supports(eventName: string): boolean;
463
- addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
464
- isCustomEvent(eventName: string): boolean;
465
- static ɵfac: i0.ɵɵFactoryDeclaration<HammerGesturesPlugin, [null, null, null, { optional: true; }]>;
466
- static ɵprov: i0.ɵɵInjectableDeclaration<HammerGesturesPlugin>;
467
- }
440
+ declare function withNoIncrementalHydration(): HydrationFeature<HydrationFeatureKind.NoIncrementalHydration>;
468
441
  /**
469
- * Adds support for HammerJS.
442
+ * Sets up providers necessary to enable hydration functionality for the application.
470
443
  *
471
- * Import this module at the root of your application so that Angular can work with
472
- * HammerJS to detect gesture events.
444
+ * By default, the function enables the recommended set of features for the optimal
445
+ * performance for most of the applications. It includes the following features:
473
446
  *
474
- * Note that applications still need to include the HammerJS script itself. This module
475
- * simply sets up the coordination layer between HammerJS and Angular's `EventManager`.
447
+ * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
448
+ * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
449
+ * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
450
+ * [here](guide/ssr#caching-data-when-using-httpclient).
451
+ * Incremental hydration. [Learn more](guide/incremental-hydration).
476
452
  *
477
- * @publicApi
453
+ * These functions allow you to disable some of the default features or enable new ones:
454
+ *
455
+ * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
456
+ * * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options
457
+ * * {@link withI18nSupport} to enable hydration support for i18n blocks
458
+ * * {@link withEventReplay} to enable support for replaying user events
459
+ * * {@link withNoIncrementalHydration} to disable incremental hydration
460
+ *
461
+ * @usageNotes
478
462
  *
479
- * @deprecated The hammer integration is deprecated. Replace it by your own implementation.
463
+ * Basic example of how you can enable hydration in your application when
464
+ * `bootstrapApplication` function is used:
465
+ * ```ts
466
+ * bootstrapApplication(App, {
467
+ * providers: [provideClientHydration()]
468
+ * });
469
+ * ```
470
+ *
471
+ * Alternatively if you are using NgModules, you would add `provideClientHydration`
472
+ * to your root app module's provider list.
473
+ * ```ts
474
+ * @NgModule({
475
+ * declarations: [RootCmp],
476
+ * bootstrap: [RootCmp],
477
+ * providers: [provideClientHydration()],
478
+ * })
479
+ * export class AppModule {}
480
+ * ```
481
+ *
482
+ * @see {@link withNoHttpTransferCache}
483
+ * @see {@link withHttpTransferCacheOptions}
484
+ * @see {@link withI18nSupport}
485
+ * @see {@link withEventReplay}
486
+ * @see {@link withNoIncrementalHydration}
487
+ *
488
+ * @param features Optional features to configure additional hydration behaviors.
489
+ * @returns A set of providers to enable hydration.
490
+ *
491
+ * @publicApi 17.0
480
492
  */
481
- declare class HammerModule {
482
- static ɵfac: i0.ɵɵFactoryDeclaration<HammerModule, never>;
483
- static ɵmod: i0.ɵɵNgModuleDeclaration<HammerModule, never, never, never>;
484
- static ɵinj: i0.ɵɵInjectorDeclaration<HammerModule>;
485
- }
493
+ declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
486
494
 
487
495
  /**
488
496
  * Marker interface for a value that's safe to use in a particular context.
@@ -623,139 +631,6 @@ declare class DomSanitizerImpl extends DomSanitizer {
623
631
  static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizerImpl>;
624
632
  }
625
633
 
626
- /**
627
- * The list of features as an enum to uniquely type each `HydrationFeature`.
628
- * @see {@link HydrationFeature}
629
- *
630
- * @publicApi
631
- */
632
- declare enum HydrationFeatureKind {
633
- NoHttpTransferCache = 0,
634
- HttpTransferCacheOptions = 1,
635
- I18nSupport = 2,
636
- EventReplay = 3,
637
- IncrementalHydration = 4
638
- }
639
- /**
640
- * Helper type to represent a Hydration feature.
641
- *
642
- * @publicApi
643
- */
644
- interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
645
- ɵkind: FeatureKind;
646
- ɵproviders: Provider[];
647
- }
648
- /**
649
- * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
650
- * server and other one on the browser.
651
- *
652
- * @see [Disabling Caching](guide/ssr#disabling-caching)
653
- *
654
- * @publicApi
655
- */
656
- declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
657
- /**
658
- * The function accepts an object, which allows to configure cache parameters,
659
- * such as which headers should be included (no headers are included by default),
660
- * whether POST requests should be cached or a callback function to determine if a
661
- * particular request should be cached.
662
- *
663
- * @see [Configuring HTTP transfer cache options](guide/ssr#caching-data-when-using-httpclient)
664
- *
665
- * @publicApi
666
- */
667
- declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>;
668
- /**
669
- * Enables support for hydrating i18n blocks.
670
- *
671
- * @publicApi 20.0
672
- */
673
- declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>;
674
- /**
675
- * Enables support for replaying user events (e.g. `click`s) that happened on a page
676
- * before hydration logic has completed. Once an application is hydrated, all captured
677
- * events are replayed and relevant event listeners are executed.
678
- *
679
- * @usageNotes
680
- *
681
- * Basic example of how you can enable event replay in your application when
682
- * `bootstrapApplication` function is used:
683
- * ```ts
684
- * bootstrapApplication(AppComponent, {
685
- * providers: [provideClientHydration(withEventReplay())]
686
- * });
687
- * ```
688
- * @publicApi
689
- * @see {@link provideClientHydration}
690
- */
691
- declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>;
692
- /**
693
- * Enables support for incremental hydration using the `hydrate` trigger syntax.
694
- *
695
- * @usageNotes
696
- *
697
- * Basic example of how you can enable incremental hydration in your application when
698
- * the `bootstrapApplication` function is used:
699
- * ```ts
700
- * bootstrapApplication(AppComponent, {
701
- * providers: [provideClientHydration(withIncrementalHydration())]
702
- * });
703
- * ```
704
- * @publicApi 20.0
705
- * @see {@link provideClientHydration}
706
- */
707
- declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>;
708
- /**
709
- * Sets up providers necessary to enable hydration functionality for the application.
710
- *
711
- * By default, the function enables the recommended set of features for the optimal
712
- * performance for most of the applications. It includes the following features:
713
- *
714
- * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
715
- * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
716
- * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
717
- * [here](guide/ssr#caching-data-when-using-httpclient).
718
- *
719
- * These functions allow you to disable some of the default features or enable new ones:
720
- *
721
- * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
722
- * * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options
723
- * * {@link withI18nSupport} to enable hydration support for i18n blocks
724
- * * {@link withEventReplay} to enable support for replaying user events
725
- *
726
- * @usageNotes
727
- *
728
- * Basic example of how you can enable hydration in your application when
729
- * `bootstrapApplication` function is used:
730
- * ```ts
731
- * bootstrapApplication(AppComponent, {
732
- * providers: [provideClientHydration()]
733
- * });
734
- * ```
735
- *
736
- * Alternatively if you are using NgModules, you would add `provideClientHydration`
737
- * to your root app module's provider list.
738
- * ```ts
739
- * @NgModule({
740
- * declarations: [RootCmp],
741
- * bootstrap: [RootCmp],
742
- * providers: [provideClientHydration()],
743
- * })
744
- * export class AppModule {}
745
- * ```
746
- *
747
- * @see {@link withNoHttpTransferCache}
748
- * @see {@link withHttpTransferCacheOptions}
749
- * @see {@link withI18nSupport}
750
- * @see {@link withEventReplay}
751
- *
752
- * @param features Optional features to configure additional hydration behaviors.
753
- * @returns A set of providers to enable hydration.
754
- *
755
- * @publicApi 17.0
756
- */
757
- declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
758
-
759
634
  /**
760
635
  * A `DomAdapter` powered by full browser DOM APIs.
761
636
  *
@@ -885,5 +760,5 @@ declare const enum RuntimeErrorCode {
885
760
  */
886
761
  declare const VERSION: Version;
887
762
 
888
- export { By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, HydrationFeatureKind, Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY, Title, VERSION, disableDebugTools, enableDebugTools, provideClientHydration, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin, KeyEventsPlugin as ɵKeyEventsPlugin, RuntimeErrorCode as ɵRuntimeErrorCode, SharedStylesHost as ɵSharedStylesHost };
889
- export type { HammerLoader, HydrationFeature, MetaDefinition, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl, SafeValue };
763
+ export { By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin, HydrationFeatureKind, Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY, Title, VERSION, disableDebugTools, enableDebugTools, provideClientHydration, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, withNoIncrementalHydration, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, KeyEventsPlugin as ɵKeyEventsPlugin, RuntimeErrorCode as ɵRuntimeErrorCode, SharedStylesHost as ɵSharedStylesHost };
764
+ export type { HydrationFeature, MetaDefinition, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl, SafeValue };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.1
2
+ * @license Angular v22.0.0-next.11
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */