@angular/platform-browser 20.0.0-next.0 → 20.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,42 +1,15 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.0
3
- * (c) 2010-2024 Google LLC. https://angular.io/
2
+ * @license Angular v20.0.0-next.2
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
-
8
- import { ApplicationConfig as ApplicationConfig_2 } from '@angular/core';
9
- import { ApplicationRef } from '@angular/core';
10
- import { ComponentRef } from '@angular/core';
11
- import { DebugElement } from '@angular/core';
12
- import { DebugNode } from '@angular/core';
13
- import { EnvironmentProviders } from '@angular/core';
14
- import { GetTestability } from '@angular/core';
15
- import { HttpTransferCacheOptions } from '@angular/common/http';
16
7
  import * as i0 from '@angular/core';
8
+ import { ApplicationConfig as ApplicationConfig$1, Type, ApplicationRef, StaticProvider, PlatformRef, Provider, ComponentRef, Predicate, DebugNode, DebugElement, InjectionToken, NgZone, ListenerOptions, OnDestroy, RendererFactory2, ɵTracingService as _TracingService, ɵTracingSnapshot as _TracingSnapshot, RendererType2, Renderer2, Injector, Sanitizer, SecurityContext, EnvironmentProviders, GetTestability, TestabilityRegistry, Testability, Version } from '@angular/core';
17
9
  import * as i1 from '@angular/common';
18
- import { InjectionToken } from '@angular/core';
19
- import { Injector } from '@angular/core';
20
- import { ListenerOptions } from '@angular/core';
21
- import { NgZone } from '@angular/core';
22
- import { OnDestroy } from '@angular/core';
23
- import { PlatformRef } from '@angular/core';
24
- import { Predicate } from '@angular/core';
25
- import { Provider } from '@angular/core';
26
- import { Renderer2 } from '@angular/core';
27
- import { RendererFactory2 } from '@angular/core';
28
- import { RendererType2 } from '@angular/core';
29
- import { Sanitizer } from '@angular/core';
30
- import { SecurityContext } from '@angular/core';
31
- import { StaticProvider } from '@angular/core';
32
- import { Testability } from '@angular/core';
33
- import { TestabilityRegistry } from '@angular/core';
34
- import { Type } from '@angular/core';
35
- import { Version } from '@angular/core';
36
- import { ɵDomAdapter } from '@angular/common';
37
- import { ɵgetDOM } from '@angular/common';
38
- import { ɵTracingService } from '@angular/core';
39
- import { ɵTracingSnapshot } from '@angular/core';
10
+ import { ɵDomAdapter as _DomAdapter } from '@angular/common';
11
+ export { ɵgetDOM } from '@angular/common';
12
+ import { HttpTransferCacheOptions } from '@angular/common/http';
40
13
 
41
14
  /**
42
15
  * Set of config options available during the application bootstrap operation.
@@ -46,7 +19,7 @@ import { ɵTracingSnapshot } from '@angular/core';
46
19
  * @deprecated
47
20
  * `ApplicationConfig` has moved, please import `ApplicationConfig` from `@angular/core` instead.
48
21
  */
49
- export declare type ApplicationConfig = ApplicationConfig_2;
22
+ type ApplicationConfig = ApplicationConfig$1;
50
23
 
51
24
  /**
52
25
  * Bootstraps an instance of an Angular application and renders a standalone component as the
@@ -107,8 +80,41 @@ export declare type ApplicationConfig = ApplicationConfig_2;
107
80
  *
108
81
  * @publicApi
109
82
  */
110
- export declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>;
111
-
83
+ declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>;
84
+ /**
85
+ * Create an instance of an Angular application without bootstrapping any components. This is useful
86
+ * for the situation where one wants to decouple application environment creation (a platform and
87
+ * associated injectors) from rendering components on a screen. Components can be subsequently
88
+ * bootstrapped on the returned `ApplicationRef`.
89
+ *
90
+ * @param options Extra configuration for the application environment, see `ApplicationConfig` for
91
+ * additional info.
92
+ * @returns A promise that returns an `ApplicationRef` instance once resolved.
93
+ *
94
+ * @publicApi
95
+ */
96
+ declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>;
97
+ /**
98
+ * Returns a set of providers required to setup [Testability](api/core/Testability) for an
99
+ * application bootstrapped using the `bootstrapApplication` function. The set of providers is
100
+ * needed to support testing an application with Protractor (which relies on the Testability APIs
101
+ * to be present).
102
+ *
103
+ * @returns An array of providers required to setup Testability for an application and make it
104
+ * available for testing using Protractor.
105
+ *
106
+ * @publicApi
107
+ */
108
+ declare function provideProtractorTestingSupport(): Provider[];
109
+ declare function initDomAdapter(): void;
110
+ declare const INTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
111
+ /**
112
+ * A factory function that returns a `PlatformRef` instance associated with browser service
113
+ * providers.
114
+ *
115
+ * @publicApi
116
+ */
117
+ declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
112
118
  /**
113
119
  * Exports required infrastructure for all Angular apps.
114
120
  * Included by default in all Angular apps created with the CLI
@@ -118,19 +124,178 @@ export declare function bootstrapApplication(rootComponent: Type<unknown>, optio
118
124
  *
119
125
  * @publicApi
120
126
  */
121
- export declare class BrowserModule {
127
+ declare class BrowserModule {
122
128
  constructor();
123
129
  static ɵfac: i0.ɵɵFactoryDeclaration<BrowserModule, never>;
124
130
  static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserModule, never, never, [typeof i1.CommonModule, typeof i0.ApplicationModule]>;
125
131
  static ɵinj: i0.ɵɵInjectorDeclaration<BrowserModule>;
126
132
  }
127
133
 
134
+ /**
135
+ * Represents the attributes of an HTML `<meta>` element. The element itself is
136
+ * represented by the internal `HTMLMetaElement`.
137
+ *
138
+ * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
139
+ * @see {@link Meta}
140
+ *
141
+ * @publicApi
142
+ */
143
+ type MetaDefinition = {
144
+ charset?: string;
145
+ content?: string;
146
+ httpEquiv?: string;
147
+ id?: string;
148
+ itemprop?: string;
149
+ name?: string;
150
+ property?: string;
151
+ scheme?: string;
152
+ url?: string;
153
+ } & {
154
+ [prop: string]: string;
155
+ };
156
+ /**
157
+ * A service for managing HTML `<meta>` tags.
158
+ *
159
+ * Properties of the `MetaDefinition` object match the attributes of the
160
+ * HTML `<meta>` tag. These tags define document metadata that is important for
161
+ * things like configuring a Content Security Policy, defining browser compatibility
162
+ * and security settings, setting HTTP Headers, defining rich content for social sharing,
163
+ * and Search Engine Optimization (SEO).
164
+ *
165
+ * To identify specific `<meta>` tags in a document, use an attribute selection
166
+ * string in the format `"tag_attribute='value string'"`.
167
+ * For example, an `attrSelector` value of `"name='description'"` matches a tag
168
+ * whose `name` attribute has the value `"description"`.
169
+ * Selectors are used with the `querySelector()` Document method,
170
+ * in the format `meta[{attrSelector}]`.
171
+ *
172
+ * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
173
+ * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
174
+ *
175
+ *
176
+ * @publicApi
177
+ */
178
+ declare class Meta {
179
+ private _doc;
180
+ private _dom;
181
+ constructor(_doc: any);
182
+ /**
183
+ * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
184
+ * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
185
+ * values in the provided tag definition, and verifies that all other attribute values are equal.
186
+ * If an existing element is found, it is returned and is not modified in any way.
187
+ * @param tag The definition of a `<meta>` element to match or create.
188
+ * @param forceCreation True to create a new element without checking whether one already exists.
189
+ * @returns The existing element with the same attributes and values if found,
190
+ * the new element if no match is found, or `null` if the tag parameter is not defined.
191
+ */
192
+ addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null;
193
+ /**
194
+ * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
195
+ * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
196
+ * values in the provided tag definition, and verifies that all other attribute values are equal.
197
+ * @param tags An array of tag definitions to match or create.
198
+ * @param forceCreation True to create new elements without checking whether they already exist.
199
+ * @returns The matching elements if found, or the new elements.
200
+ */
201
+ addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[];
202
+ /**
203
+ * Retrieves a `<meta>` tag element in the current HTML document.
204
+ * @param attrSelector The tag attribute and value to match against, in the format
205
+ * `"tag_attribute='value string'"`.
206
+ * @returns The matching element, if any.
207
+ */
208
+ getTag(attrSelector: string): HTMLMetaElement | null;
209
+ /**
210
+ * Retrieves a set of `<meta>` tag elements in the current HTML document.
211
+ * @param attrSelector The tag attribute and value to match against, in the format
212
+ * `"tag_attribute='value string'"`.
213
+ * @returns The matching elements, if any.
214
+ */
215
+ getTags(attrSelector: string): HTMLMetaElement[];
216
+ /**
217
+ * Modifies an existing `<meta>` tag element in the current HTML document.
218
+ * @param tag The tag description with which to replace the existing tag content.
219
+ * @param selector A tag attribute and value to match against, to identify
220
+ * an existing tag. A string in the format `"tag_attribute=`value string`"`.
221
+ * If not supplied, matches a tag with the same `name` or `property` attribute value as the
222
+ * replacement tag.
223
+ * @return The modified element.
224
+ */
225
+ updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null;
226
+ /**
227
+ * Removes an existing `<meta>` tag element from the current HTML document.
228
+ * @param attrSelector A tag attribute and value to match against, to identify
229
+ * an existing tag. A string in the format `"tag_attribute=`value string`"`.
230
+ */
231
+ removeTag(attrSelector: string): void;
232
+ /**
233
+ * Removes an existing `<meta>` tag element from the current HTML document.
234
+ * @param meta The tag definition to match against to identify an existing tag.
235
+ */
236
+ removeTagElement(meta: HTMLMetaElement): void;
237
+ private _getOrCreateElement;
238
+ private _setMetaElementAttributes;
239
+ private _parseSelector;
240
+ private _containsAttributes;
241
+ private _getMetaKeyMap;
242
+ static ɵfac: i0.ɵɵFactoryDeclaration<Meta, never>;
243
+ static ɵprov: i0.ɵɵInjectableDeclaration<Meta>;
244
+ }
245
+
246
+ /**
247
+ * A service that can be used to get and set the title of a current HTML document.
248
+ *
249
+ * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
250
+ * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
251
+ * (representing the `<title>` tag). Instead, this service can be used to set and get the current
252
+ * title value.
253
+ *
254
+ * @publicApi
255
+ */
256
+ declare class Title {
257
+ private _doc;
258
+ constructor(_doc: any);
259
+ /**
260
+ * Get the title of the current HTML document.
261
+ */
262
+ getTitle(): string;
263
+ /**
264
+ * Set the title of the current HTML document.
265
+ * @param newTitle
266
+ */
267
+ setTitle(newTitle: string): void;
268
+ static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>;
269
+ static ɵprov: i0.ɵɵInjectableDeclaration<Title>;
270
+ }
271
+
272
+ /**
273
+ * Enabled Angular debug tools that are accessible via your browser's
274
+ * developer console.
275
+ *
276
+ * Usage:
277
+ *
278
+ * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
279
+ * 1. Type `ng.` (usually the console will show auto-complete suggestion)
280
+ * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
281
+ * then hit Enter.
282
+ *
283
+ * @publicApi
284
+ */
285
+ declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
286
+ /**
287
+ * Disables Angular tools.
288
+ *
289
+ * @publicApi
290
+ */
291
+ declare function disableDebugTools(): void;
292
+
128
293
  /**
129
294
  * Predicates for use with {@link DebugElement}'s query functions.
130
295
  *
131
296
  * @publicApi
132
297
  */
133
- export declare class By {
298
+ declare class By {
134
299
  /**
135
300
  * Match all nodes.
136
301
  *
@@ -161,196 +326,154 @@ export declare class By {
161
326
  }
162
327
 
163
328
  /**
164
- * Create an instance of an Angular application without bootstrapping any components. This is useful
165
- * for the situation where one wants to decouple application environment creation (a platform and
166
- * associated injectors) from rendering components on a screen. Components can be subsequently
167
- * bootstrapped on the returned `ApplicationRef`.
168
- *
169
- * @param options Extra configuration for the application environment, see `ApplicationConfig` for
170
- * additional info.
171
- * @returns A promise that returns an `ApplicationRef` instance once resolved.
329
+ * The injection token for plugins of the `EventManager` service.
172
330
  *
173
331
  * @publicApi
174
332
  */
175
- export declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>;
176
-
333
+ declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>;
177
334
  /**
178
- * Disables Angular tools.
335
+ * An injectable service that provides event management for Angular
336
+ * through a browser plug-in.
179
337
  *
180
338
  * @publicApi
181
339
  */
182
- export declare function disableDebugTools(): void;
183
-
340
+ declare class EventManager {
341
+ private _zone;
342
+ private _plugins;
343
+ private _eventNameToPlugin;
344
+ /**
345
+ * Initializes an instance of the event-manager service.
346
+ */
347
+ constructor(plugins: EventManagerPlugin[], _zone: NgZone);
348
+ /**
349
+ * Registers a handler for a specific element and event.
350
+ *
351
+ * @param element The HTML element to receive event notifications.
352
+ * @param eventName The name of the event to listen for.
353
+ * @param handler A function to call when the notification occurs. Receives the
354
+ * event object as an argument.
355
+ * @param options Options that configure how the event listener is bound.
356
+ * @returns A callback function that can be used to remove the handler.
357
+ */
358
+ addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
359
+ /**
360
+ * Retrieves the compilation zone in which event listeners are registered.
361
+ */
362
+ getZone(): NgZone;
363
+ static ɵfac: i0.ɵɵFactoryDeclaration<EventManager, never>;
364
+ static ɵprov: i0.ɵɵInjectableDeclaration<EventManager>;
365
+ }
184
366
  /**
185
- * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
186
- * values to be safe to use in the different DOM contexts.
187
- *
188
- * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
189
- * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
190
- * the website.
191
- *
192
- * In specific situations, it might be necessary to disable sanitization, for example if the
193
- * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
194
- * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
195
- * methods, and then binding to that value from the template.
196
- *
197
- * These situations should be very rare, and extraordinary care must be taken to avoid creating a
198
- * Cross Site Scripting (XSS) security bug!
199
- *
200
- * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
201
- * close as possible to the source of the value, to make it easy to verify no security bug is
202
- * created by its use.
203
- *
204
- * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
205
- * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
206
- * code. The sanitizer leaves safe values intact.
367
+ * The plugin definition for the `EventManager` class
207
368
  *
208
- * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
209
- * sanitization for the value passed in. Carefully check and audit all values and code paths going
210
- * into this call. Make sure any user data is appropriately escaped for this security context.
211
- * For more detail, see the [Security Guide](https://g.co/ng/security).
369
+ * It can be used as a base class to create custom manager plugins, i.e. you can create your own
370
+ * class that extends the `EventManagerPlugin` one.
212
371
  *
213
372
  * @publicApi
214
373
  */
215
- export declare abstract class DomSanitizer implements Sanitizer {
216
- /**
217
- * Gets a safe value from either a known safe value or a value with unknown safety.
218
- *
219
- * If the given value is already a `SafeValue`, this method returns the unwrapped value.
220
- * If the security context is HTML and the given value is a plain string, this method
221
- * sanitizes the string, removing any potentially unsafe content.
222
- * For any other security context, this method throws an error if provided
223
- * with a plain string.
374
+ declare abstract class EventManagerPlugin {
375
+ private _doc;
376
+ constructor(_doc: any);
377
+ manager: EventManager;
378
+ /**
379
+ * Should return `true` for every event name that should be supported by this plugin
224
380
  */
225
- abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
381
+ abstract supports(eventName: string): boolean;
226
382
  /**
227
- * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML
228
- * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will
229
- * leave safe HTML intact, so in most situations this method should not be used.
230
- *
231
- * **WARNING:** calling this method with untrusted user data exposes your application to XSS
232
- * security risks!
383
+ * Implement the behaviour for the supported events
233
384
  */
234
- abstract bypassSecurityTrustHtml(value: string): SafeHtml;
385
+ abstract addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
386
+ }
387
+
388
+ /**
389
+ * A record of usage for a specific style including all elements added to the DOM
390
+ * that contain a given style.
391
+ */
392
+ interface UsageRecord<T> {
393
+ elements: T[];
394
+ usage: number;
395
+ }
396
+ declare class SharedStylesHost implements OnDestroy {
397
+ private readonly doc;
398
+ private readonly appId;
399
+ private readonly nonce?;
235
400
  /**
236
- * Bypass security and trust the given value to be safe style value (CSS).
237
- *
238
- * **WARNING:** calling this method with untrusted user data exposes your application to XSS
239
- * security risks!
401
+ * Provides usage information for active inline style content and associated HTML <style> elements.
402
+ * Embedded styles typically originate from the `styles` metadata of a rendered component.
240
403
  */
241
- abstract bypassSecurityTrustStyle(value: string): SafeStyle;
404
+ private readonly inline;
242
405
  /**
243
- * Bypass security and trust the given value to be safe JavaScript.
244
- *
245
- * **WARNING:** calling this method with untrusted user data exposes your application to XSS
246
- * security risks!
406
+ * Provides usage information for active external style URLs and the associated HTML <link> elements.
407
+ * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
247
408
  */
248
- abstract bypassSecurityTrustScript(value: string): SafeScript;
409
+ private readonly external;
249
410
  /**
250
- * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used
251
- * in hyperlinks or `<img src>`.
252
- *
253
- * **WARNING:** calling this method with untrusted user data exposes your application to XSS
254
- * security risks!
411
+ * Set of host DOM nodes that will have styles attached.
255
412
  */
256
- abstract bypassSecurityTrustUrl(value: string): SafeUrl;
413
+ private readonly hosts;
257
414
  /**
258
- * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may
259
- * be used to load executable code from, like `<script src>`, or `<iframe src>`.
260
- *
261
- * **WARNING:** calling this method with untrusted user data exposes your application to XSS
262
- * security risks!
415
+ * Whether the application code is currently executing on a server.
263
416
  */
264
- abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
265
- static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizer, never>;
266
- static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizer>;
267
- }
268
-
269
- /**
270
- * Enabled Angular debug tools that are accessible via your browser's
271
- * developer console.
272
- *
273
- * Usage:
274
- *
275
- * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
276
- * 1. Type `ng.` (usually the console will show auto-complete suggestion)
277
- * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
278
- * then hit Enter.
279
- *
280
- * @publicApi
281
- */
282
- export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
283
-
284
- /**
285
- * The injection token for plugins of the `EventManager` service.
286
- *
287
- * @publicApi
288
- */
289
- export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>;
290
-
291
- /**
292
- * An injectable service that provides event management for Angular
293
- * through a browser plug-in.
294
- *
295
- * @publicApi
296
- */
297
- export declare class EventManager {
298
- private _zone;
299
- private _plugins;
300
- private _eventNameToPlugin;
417
+ private readonly isServer;
418
+ constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
301
419
  /**
302
- * Initializes an instance of the event-manager service.
420
+ * Adds embedded styles to the DOM via HTML `style` elements.
421
+ * @param styles An array of style content strings.
303
422
  */
304
- constructor(plugins: EventManagerPlugin[], _zone: NgZone);
423
+ addStyles(styles: string[], urls?: string[]): void;
305
424
  /**
306
- * Registers a handler for a specific element and event.
307
- *
308
- * @param element The HTML element to receive event notifications.
309
- * @param eventName The name of the event to listen for.
310
- * @param handler A function to call when the notification occurs. Receives the
311
- * event object as an argument.
312
- * @param options Options that configure how the event listener is bound.
313
- * @returns A callback function that can be used to remove the handler.
425
+ * Removes embedded styles from the DOM that were added as HTML `style` elements.
426
+ * @param styles An array of style content strings.
314
427
  */
315
- addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
428
+ removeStyles(styles: string[], urls?: string[]): void;
429
+ protected addUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>, creator: (value: string, doc: Document) => T): void;
430
+ protected removeUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>): void;
431
+ ngOnDestroy(): void;
316
432
  /**
317
- * Retrieves the compilation zone in which event listeners are registered.
433
+ * Adds a host node to the set of style hosts and adds all existing style usage to
434
+ * the newly added host node.
435
+ *
436
+ * This is currently only used for Shadow DOM encapsulation mode.
318
437
  */
319
- getZone(): NgZone;
320
- static ɵfac: i0.ɵɵFactoryDeclaration<EventManager, never>;
321
- static ɵprov: i0.ɵɵInjectableDeclaration<EventManager>;
438
+ addHost(hostNode: Node): void;
439
+ removeHost(hostNode: Node): void;
440
+ private addElement;
441
+ static ɵfac: i0.ɵɵFactoryDeclaration<SharedStylesHost, [null, null, { optional: true; }, null]>;
442
+ static ɵprov: i0.ɵɵInjectableDeclaration<SharedStylesHost>;
322
443
  }
323
444
 
324
445
  /**
325
- * The plugin definition for the `EventManager` class
326
- *
327
- * It can be used as a base class to create custom manager plugins, i.e. you can create your own
328
- * class that extends the `EventManagerPlugin` one.
446
+ * A DI token that indicates whether styles
447
+ * of destroyed components should be removed from DOM.
329
448
  *
449
+ * By default, the value is set to `true`.
330
450
  * @publicApi
331
451
  */
332
- export declare abstract class EventManagerPlugin {
333
- private _doc;
334
- constructor(_doc: any);
335
- manager: EventManager;
336
- /**
337
- * Should return `true` for every event name that should be supported by this plugin
338
- */
339
- abstract supports(eventName: string): boolean;
452
+ declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>;
453
+ declare class DomRendererFactory2 implements RendererFactory2, OnDestroy {
454
+ private readonly eventManager;
455
+ private readonly sharedStylesHost;
456
+ private readonly appId;
457
+ private removeStylesOnCompDestroy;
458
+ private readonly doc;
459
+ readonly platformId: Object;
460
+ readonly ngZone: NgZone;
461
+ private readonly nonce;
462
+ private readonly tracingService;
463
+ private readonly rendererByCompId;
464
+ private readonly defaultRenderer;
465
+ private readonly platformIsServer;
466
+ constructor(eventManager: EventManager, sharedStylesHost: SharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null, tracingService?: _TracingService<_TracingSnapshot> | null);
467
+ createRenderer(element: any, type: RendererType2 | null): Renderer2;
468
+ private getOrCreateRenderer;
469
+ ngOnDestroy(): void;
340
470
  /**
341
- * Implement the behaviour for the supported events
471
+ * Used during HMR to clear any cached data about a component.
472
+ * @param componentId ID of the component that is being replaced.
342
473
  */
343
- abstract addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
344
- }
345
-
346
- /**
347
- * Provides DOM operations in any browser environment.
348
- *
349
- * @security Tread carefully! Interacting with the DOM directly is dangerous and
350
- * can introduce XSS risks.
351
- */
352
- declare abstract class GenericBrowserDomAdapter extends ɵDomAdapter {
353
- readonly supportsDOMEvents: boolean;
474
+ protected componentReplaced(componentId: string): void;
475
+ static ɵfac: i0.ɵɵFactoryDeclaration<DomRendererFactory2, [null, null, null, null, null, null, null, null, { optional: true; }]>;
476
+ static ɵprov: i0.ɵɵInjectableDeclaration<DomRendererFactory2>;
354
477
  }
355
478
 
356
479
  /**
@@ -359,24 +482,41 @@ declare abstract class GenericBrowserDomAdapter extends ɵDomAdapter {
359
482
  *
360
483
  * @ngModule HammerModule
361
484
  * @publicApi
485
+ *
486
+ * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
362
487
  */
363
- export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
364
-
488
+ declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
489
+ /**
490
+ * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
491
+ *
492
+ * @publicApi
493
+ *
494
+ * @deprecated The hammerjs integration is deprecated. Replace it by your own implementation.
495
+ */
496
+ type HammerLoader = () => Promise<void>;
365
497
  /**
366
498
  * Injection token used to provide a HammerLoader to Angular.
367
499
  *
368
500
  * @see {@link HammerLoader}
369
501
  *
370
502
  * @publicApi
503
+ *
504
+ * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
371
505
  */
372
- export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
373
-
506
+ declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
507
+ interface HammerInstance {
508
+ on(eventName: string, callback?: Function): void;
509
+ off(eventName: string, callback?: Function): void;
510
+ destroy?(): void;
511
+ }
374
512
  /**
375
513
  * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
376
514
  * for gesture recognition. Configures specific event recognition.
377
515
  * @publicApi
516
+ *
517
+ * @deprecated The HammerJS integration is deprecated. Replace it by your own implementation.
378
518
  */
379
- export declare class HammerGestureConfig {
519
+ declare class HammerGestureConfig {
380
520
  /**
381
521
  * A set of supported event names for gestures to be used in Angular.
382
522
  * Angular supports all built-in recognizers, as listed in
@@ -429,20 +569,23 @@ export declare class HammerGestureConfig {
429
569
  static ɵfac: i0.ɵɵFactoryDeclaration<HammerGestureConfig, never>;
430
570
  static ɵprov: i0.ɵɵInjectableDeclaration<HammerGestureConfig>;
431
571
  }
432
-
433
- declare interface HammerInstance {
434
- on(eventName: string, callback?: Function): void;
435
- off(eventName: string, callback?: Function): void;
436
- destroy?(): void;
437
- }
438
-
439
572
  /**
440
- * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
573
+ * Event plugin that adds Hammer support to an application.
441
574
  *
442
- * @publicApi
575
+ * @ngModule HammerModule
443
576
  */
444
- export declare type HammerLoader = () => Promise<void>;
445
-
577
+ declare class HammerGesturesPlugin extends EventManagerPlugin {
578
+ private _config;
579
+ private _injector;
580
+ private loader?;
581
+ private _loaderPromise;
582
+ constructor(doc: any, _config: HammerGestureConfig, _injector: Injector, loader?: (HammerLoader | null) | undefined);
583
+ supports(eventName: string): boolean;
584
+ addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
585
+ isCustomEvent(eventName: string): boolean;
586
+ static ɵfac: i0.ɵɵFactoryDeclaration<HammerGesturesPlugin, [null, null, null, { optional: true; }]>;
587
+ static ɵprov: i0.ɵɵInjectableDeclaration<HammerGesturesPlugin>;
588
+ }
446
589
  /**
447
590
  * Adds support for HammerJS.
448
591
  *
@@ -453,319 +596,199 @@ export declare type HammerLoader = () => Promise<void>;
453
596
  * simply sets up the coordination layer between HammerJS and Angular's `EventManager`.
454
597
  *
455
598
  * @publicApi
599
+ *
600
+ * @deprecated The hammer integration is deprecated. Replace it by your own implementation.
456
601
  */
457
- export declare class HammerModule {
602
+ declare class HammerModule {
458
603
  static ɵfac: i0.ɵɵFactoryDeclaration<HammerModule, never>;
459
604
  static ɵmod: i0.ɵɵNgModuleDeclaration<HammerModule, never, never, never>;
460
605
  static ɵinj: i0.ɵɵInjectorDeclaration<HammerModule>;
461
606
  }
462
607
 
463
608
  /**
464
- * Helper type to represent a Hydration feature.
609
+ * Marker interface for a value that's safe to use in a particular context.
465
610
  *
466
611
  * @publicApi
467
612
  */
468
- export declare interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
469
- ɵkind: FeatureKind;
470
- ɵproviders: Provider[];
613
+ interface SafeValue {
471
614
  }
472
-
473
615
  /**
474
- * The list of features as an enum to uniquely type each `HydrationFeature`.
475
- * @see {@link HydrationFeature}
616
+ * Marker interface for a value that's safe to use as HTML.
476
617
  *
477
618
  * @publicApi
478
619
  */
479
- export declare enum HydrationFeatureKind {
480
- NoHttpTransferCache = 0,
481
- HttpTransferCacheOptions = 1,
482
- I18nSupport = 2,
483
- EventReplay = 3,
484
- IncrementalHydration = 4
620
+ interface SafeHtml extends SafeValue {
485
621
  }
486
-
487
622
  /**
488
- * A service for managing HTML `<meta>` tags.
489
- *
490
- * Properties of the `MetaDefinition` object match the attributes of the
491
- * HTML `<meta>` tag. These tags define document metadata that is important for
492
- * things like configuring a Content Security Policy, defining browser compatibility
493
- * and security settings, setting HTTP Headers, defining rich content for social sharing,
494
- * and Search Engine Optimization (SEO).
495
- *
496
- * To identify specific `<meta>` tags in a document, use an attribute selection
497
- * string in the format `"tag_attribute='value string'"`.
498
- * For example, an `attrSelector` value of `"name='description'"` matches a tag
499
- * whose `name` attribute has the value `"description"`.
500
- * Selectors are used with the `querySelector()` Document method,
501
- * in the format `meta[{attrSelector}]`.
502
- *
503
- * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
504
- * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
505
- *
623
+ * Marker interface for a value that's safe to use as style (CSS).
506
624
  *
507
625
  * @publicApi
508
626
  */
509
- export declare class Meta {
510
- private _doc;
511
- private _dom;
512
- constructor(_doc: any);
513
- /**
514
- * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
515
- * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
516
- * values in the provided tag definition, and verifies that all other attribute values are equal.
517
- * If an existing element is found, it is returned and is not modified in any way.
518
- * @param tag The definition of a `<meta>` element to match or create.
519
- * @param forceCreation True to create a new element without checking whether one already exists.
520
- * @returns The existing element with the same attributes and values if found,
521
- * the new element if no match is found, or `null` if the tag parameter is not defined.
522
- */
523
- addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null;
524
- /**
525
- * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
526
- * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
527
- * values in the provided tag definition, and verifies that all other attribute values are equal.
528
- * @param tags An array of tag definitions to match or create.
529
- * @param forceCreation True to create new elements without checking whether they already exist.
530
- * @returns The matching elements if found, or the new elements.
531
- */
532
- addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[];
533
- /**
534
- * Retrieves a `<meta>` tag element in the current HTML document.
535
- * @param attrSelector The tag attribute and value to match against, in the format
536
- * `"tag_attribute='value string'"`.
537
- * @returns The matching element, if any.
538
- */
539
- getTag(attrSelector: string): HTMLMetaElement | null;
540
- /**
541
- * Retrieves a set of `<meta>` tag elements in the current HTML document.
542
- * @param attrSelector The tag attribute and value to match against, in the format
543
- * `"tag_attribute='value string'"`.
544
- * @returns The matching elements, if any.
545
- */
546
- getTags(attrSelector: string): HTMLMetaElement[];
547
- /**
548
- * Modifies an existing `<meta>` tag element in the current HTML document.
549
- * @param tag The tag description with which to replace the existing tag content.
550
- * @param selector A tag attribute and value to match against, to identify
551
- * an existing tag. A string in the format `"tag_attribute=`value string`"`.
552
- * If not supplied, matches a tag with the same `name` or `property` attribute value as the
553
- * replacement tag.
554
- * @return The modified element.
555
- */
556
- updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null;
557
- /**
558
- * Removes an existing `<meta>` tag element from the current HTML document.
559
- * @param attrSelector A tag attribute and value to match against, to identify
560
- * an existing tag. A string in the format `"tag_attribute=`value string`"`.
561
- */
562
- removeTag(attrSelector: string): void;
563
- /**
564
- * Removes an existing `<meta>` tag element from the current HTML document.
565
- * @param meta The tag definition to match against to identify an existing tag.
566
- */
567
- removeTagElement(meta: HTMLMetaElement): void;
568
- private _getOrCreateElement;
569
- private _setMetaElementAttributes;
570
- private _parseSelector;
571
- private _containsAttributes;
572
- private _getMetaKeyMap;
573
- static ɵfac: i0.ɵɵFactoryDeclaration<Meta, never>;
574
- static ɵprov: i0.ɵɵInjectableDeclaration<Meta>;
627
+ interface SafeStyle extends SafeValue {
575
628
  }
576
-
577
629
  /**
578
- * Represents the attributes of an HTML `<meta>` element. The element itself is
579
- * represented by the internal `HTMLMetaElement`.
580
- *
581
- * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
582
- * @see {@link Meta}
630
+ * Marker interface for a value that's safe to use as JavaScript.
583
631
  *
584
632
  * @publicApi
585
633
  */
586
- export declare type MetaDefinition = {
587
- charset?: string;
588
- content?: string;
589
- httpEquiv?: string;
590
- id?: string;
591
- itemprop?: string;
592
- name?: string;
593
- property?: string;
594
- scheme?: string;
595
- url?: string;
596
- } & {
597
- [prop: string]: string;
598
- };
599
-
634
+ interface SafeScript extends SafeValue {
635
+ }
600
636
  /**
601
- * A factory function that returns a `PlatformRef` instance associated with browser service
602
- * providers.
637
+ * Marker interface for a value that's safe to use as a URL linking to a document.
603
638
  *
604
639
  * @publicApi
605
640
  */
606
- export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
607
-
641
+ interface SafeUrl extends SafeValue {
642
+ }
608
643
  /**
609
- * Sets up providers necessary to enable hydration functionality for the application.
610
- *
611
- * By default, the function enables the recommended set of features for the optimal
612
- * performance for most of the applications. It includes the following features:
613
- *
614
- * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
615
- * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
616
- * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
617
- * [here](guide/ssr#caching-data-when-using-httpclient).
618
- *
619
- * These functions allow you to disable some of the default features or enable new ones:
620
- *
621
- * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
622
- * * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options
623
- * * {@link withI18nSupport} to enable hydration support for i18n blocks
624
- * * {@link withEventReplay} to enable support for replaying user events
625
- *
626
- * @usageNotes
627
- *
628
- * Basic example of how you can enable hydration in your application when
629
- * `bootstrapApplication` function is used:
630
- * ```ts
631
- * bootstrapApplication(AppComponent, {
632
- * providers: [provideClientHydration()]
633
- * });
634
- * ```
635
- *
636
- * Alternatively if you are using NgModules, you would add `provideClientHydration`
637
- * to your root app module's provider list.
638
- * ```ts
639
- * @NgModule({
640
- * declarations: [RootCmp],
641
- * bootstrap: [RootCmp],
642
- * providers: [provideClientHydration()],
643
- * })
644
- * export class AppModule {}
645
- * ```
646
- *
647
- * @see {@link withNoHttpTransferCache}
648
- * @see {@link withHttpTransferCacheOptions}
649
- * @see {@link withI18nSupport}
650
- * @see {@link withEventReplay}
651
- *
652
- * @param features Optional features to configure additional router behaviors.
653
- * @returns A set of providers to enable hydration.
644
+ * Marker interface for a value that's safe to use as a URL to load executable code from.
654
645
  *
655
646
  * @publicApi
656
647
  */
657
- export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
658
-
648
+ interface SafeResourceUrl extends SafeValue {
649
+ }
659
650
  /**
660
- * Returns a set of providers required to setup [Testability](api/core/Testability) for an
661
- * application bootstrapped using the `bootstrapApplication` function. The set of providers is
662
- * needed to support testing an application with Protractor (which relies on the Testability APIs
663
- * to be present).
651
+ * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
652
+ * values to be safe to use in the different DOM contexts.
664
653
  *
665
- * @returns An array of providers required to setup Testability for an application and make it
666
- * available for testing using Protractor.
654
+ * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
655
+ * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
656
+ * the website.
667
657
  *
668
- * @publicApi
669
- */
670
- export declare function provideProtractorTestingSupport(): Provider[];
671
-
672
- /**
673
- * A DI token that indicates whether styles
674
- * of destroyed components should be removed from DOM.
658
+ * In specific situations, it might be necessary to disable sanitization, for example if the
659
+ * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
660
+ * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
661
+ * methods, and then binding to that value from the template.
675
662
  *
676
- * By default, the value is set to `true`.
677
- * @publicApi
678
- */
679
- export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>;
680
-
681
- /**
682
- * Marker interface for a value that's safe to use as HTML.
663
+ * These situations should be very rare, and extraordinary care must be taken to avoid creating a
664
+ * Cross Site Scripting (XSS) security bug!
665
+ *
666
+ * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
667
+ * close as possible to the source of the value, to make it easy to verify no security bug is
668
+ * created by its use.
669
+ *
670
+ * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
671
+ * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
672
+ * code. The sanitizer leaves safe values intact.
673
+ *
674
+ * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
675
+ * sanitization for the value passed in. Carefully check and audit all values and code paths going
676
+ * into this call. Make sure any user data is appropriately escaped for this security context.
677
+ * For more detail, see the [Security Guide](https://g.co/ng/security).
683
678
  *
684
679
  * @publicApi
685
680
  */
686
- export declare interface SafeHtml extends SafeValue {
681
+ declare abstract class DomSanitizer implements Sanitizer {
682
+ /**
683
+ * Gets a safe value from either a known safe value or a value with unknown safety.
684
+ *
685
+ * If the given value is already a `SafeValue`, this method returns the unwrapped value.
686
+ * If the security context is HTML and the given value is a plain string, this method
687
+ * sanitizes the string, removing any potentially unsafe content.
688
+ * For any other security context, this method throws an error if provided
689
+ * with a plain string.
690
+ */
691
+ abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
692
+ /**
693
+ * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML
694
+ * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will
695
+ * leave safe HTML intact, so in most situations this method should not be used.
696
+ *
697
+ * **WARNING:** calling this method with untrusted user data exposes your application to XSS
698
+ * security risks!
699
+ */
700
+ abstract bypassSecurityTrustHtml(value: string): SafeHtml;
701
+ /**
702
+ * Bypass security and trust the given value to be safe style value (CSS).
703
+ *
704
+ * **WARNING:** calling this method with untrusted user data exposes your application to XSS
705
+ * security risks!
706
+ */
707
+ abstract bypassSecurityTrustStyle(value: string): SafeStyle;
708
+ /**
709
+ * Bypass security and trust the given value to be safe JavaScript.
710
+ *
711
+ * **WARNING:** calling this method with untrusted user data exposes your application to XSS
712
+ * security risks!
713
+ */
714
+ abstract bypassSecurityTrustScript(value: string): SafeScript;
715
+ /**
716
+ * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used
717
+ * in hyperlinks or `<img src>`.
718
+ *
719
+ * **WARNING:** calling this method with untrusted user data exposes your application to XSS
720
+ * security risks!
721
+ */
722
+ abstract bypassSecurityTrustUrl(value: string): SafeUrl;
723
+ /**
724
+ * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may
725
+ * be used to load executable code from, like `<script src>`, or `<iframe src>`.
726
+ *
727
+ * **WARNING:** calling this method with untrusted user data exposes your application to XSS
728
+ * security risks!
729
+ */
730
+ abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
731
+ static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizer, never>;
732
+ static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizer>;
687
733
  }
688
-
689
- /**
690
- * Marker interface for a value that's safe to use as a URL to load executable code from.
691
- *
692
- * @publicApi
693
- */
694
- export declare interface SafeResourceUrl extends SafeValue {
734
+ declare class DomSanitizerImpl extends DomSanitizer {
735
+ private _doc;
736
+ constructor(_doc: any);
737
+ sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
738
+ bypassSecurityTrustHtml(value: string): SafeHtml;
739
+ bypassSecurityTrustStyle(value: string): SafeStyle;
740
+ bypassSecurityTrustScript(value: string): SafeScript;
741
+ bypassSecurityTrustUrl(value: string): SafeUrl;
742
+ bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
743
+ static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizerImpl, never>;
744
+ static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizerImpl>;
695
745
  }
696
746
 
697
747
  /**
698
- * Marker interface for a value that's safe to use as JavaScript.
748
+ * The list of features as an enum to uniquely type each `HydrationFeature`.
749
+ * @see {@link HydrationFeature}
699
750
  *
700
751
  * @publicApi
701
752
  */
702
- export declare interface SafeScript extends SafeValue {
753
+ declare enum HydrationFeatureKind {
754
+ NoHttpTransferCache = 0,
755
+ HttpTransferCacheOptions = 1,
756
+ I18nSupport = 2,
757
+ EventReplay = 3,
758
+ IncrementalHydration = 4
703
759
  }
704
-
705
760
  /**
706
- * Marker interface for a value that's safe to use as style (CSS).
761
+ * Helper type to represent a Hydration feature.
707
762
  *
708
763
  * @publicApi
709
764
  */
710
- export declare interface SafeStyle extends SafeValue {
765
+ interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
766
+ ɵkind: FeatureKind;
767
+ ɵproviders: Provider[];
711
768
  }
712
-
713
769
  /**
714
- * Marker interface for a value that's safe to use as a URL linking to a document.
770
+ * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
771
+ * server and other one on the browser.
715
772
  *
716
773
  * @publicApi
717
774
  */
718
- export declare interface SafeUrl extends SafeValue {
719
- }
720
-
775
+ declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
721
776
  /**
722
- * Marker interface for a value that's safe to use in a particular context.
777
+ * The function accepts an object, which allows to configure cache parameters,
778
+ * such as which headers should be included (no headers are included by default),
779
+ * whether POST requests should be cached or a callback function to determine if a
780
+ * particular request should be cached.
723
781
  *
724
782
  * @publicApi
725
783
  */
726
- export declare interface SafeValue {
727
- }
728
-
784
+ declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>;
729
785
  /**
730
- * A service that can be used to get and set the title of a current HTML document.
731
- *
732
- * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
733
- * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
734
- * (representing the `<title>` tag). Instead, this service can be used to set and get the current
735
- * title value.
786
+ * Enables support for hydrating i18n blocks.
736
787
  *
788
+ * @developerPreview
737
789
  * @publicApi
738
790
  */
739
- export declare class Title {
740
- private _doc;
741
- constructor(_doc: any);
742
- /**
743
- * Get the title of the current HTML document.
744
- */
745
- getTitle(): string;
746
- /**
747
- * Set the title of the current HTML document.
748
- * @param newTitle
749
- */
750
- setTitle(newTitle: string): void;
751
- static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>;
752
- static ɵprov: i0.ɵɵInjectableDeclaration<Title>;
753
- }
754
-
755
- /**
756
- * A record of usage for a specific style including all elements added to the DOM
757
- * that contain a given style.
758
- */
759
- declare interface UsageRecord<T> {
760
- elements: T[];
761
- usage: number;
762
- }
763
-
764
- /**
765
- * @publicApi
766
- */
767
- export declare const VERSION: Version;
768
-
791
+ declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>;
769
792
  /**
770
793
  * Enables support for replaying user events (e.g. `click`s) that happened on a page
771
794
  * before hydration logic has completed. Once an application is hydrated, all captured
@@ -783,26 +806,7 @@ export declare const VERSION: Version;
783
806
  * @publicApi
784
807
  * @see {@link provideClientHydration}
785
808
  */
786
- export declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>;
787
-
788
- /**
789
- * The function accepts an object, which allows to configure cache parameters,
790
- * such as which headers should be included (no headers are included by default),
791
- * whether POST requests should be cached or a callback function to determine if a
792
- * particular request should be cached.
793
- *
794
- * @publicApi
795
- */
796
- export declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>;
797
-
798
- /**
799
- * Enables support for hydrating i18n blocks.
800
- *
801
- * @developerPreview
802
- * @publicApi
803
- */
804
- export declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>;
805
-
809
+ declare function withEventReplay(): HydrationFeature<HydrationFeatureKind.EventReplay>;
806
810
  /**
807
811
  * Enables support for incremental hydration using the `hydrate` trigger syntax.
808
812
  *
@@ -819,15 +823,67 @@ export declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind
819
823
  * @publicApi
820
824
  * @see {@link provideClientHydration}
821
825
  */
822
- export declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>;
823
-
826
+ declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>;
824
827
  /**
825
- * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
826
- * server and other one on the browser.
828
+ * Sets up providers necessary to enable hydration functionality for the application.
829
+ *
830
+ * By default, the function enables the recommended set of features for the optimal
831
+ * performance for most of the applications. It includes the following features:
832
+ *
833
+ * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
834
+ * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
835
+ * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
836
+ * [here](guide/ssr#caching-data-when-using-httpclient).
837
+ *
838
+ * These functions allow you to disable some of the default features or enable new ones:
839
+ *
840
+ * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
841
+ * * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options
842
+ * * {@link withI18nSupport} to enable hydration support for i18n blocks
843
+ * * {@link withEventReplay} to enable support for replaying user events
844
+ *
845
+ * @usageNotes
846
+ *
847
+ * Basic example of how you can enable hydration in your application when
848
+ * `bootstrapApplication` function is used:
849
+ * ```ts
850
+ * bootstrapApplication(AppComponent, {
851
+ * providers: [provideClientHydration()]
852
+ * });
853
+ * ```
854
+ *
855
+ * Alternatively if you are using NgModules, you would add `provideClientHydration`
856
+ * to your root app module's provider list.
857
+ * ```ts
858
+ * @NgModule({
859
+ * declarations: [RootCmp],
860
+ * bootstrap: [RootCmp],
861
+ * providers: [provideClientHydration()],
862
+ * })
863
+ * export class AppModule {}
864
+ * ```
865
+ *
866
+ * @see {@link withNoHttpTransferCache}
867
+ * @see {@link withHttpTransferCacheOptions}
868
+ * @see {@link withI18nSupport}
869
+ * @see {@link withEventReplay}
870
+ *
871
+ * @param features Optional features to configure additional router behaviors.
872
+ * @returns A set of providers to enable hydration.
827
873
  *
828
874
  * @publicApi
829
875
  */
830
- export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
876
+ declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
877
+
878
+ /**
879
+ * Provides DOM operations in any browser environment.
880
+ *
881
+ * @security Tread carefully! Interacting with the DOM directly is dangerous and
882
+ * can introduce XSS risks.
883
+ */
884
+ declare abstract class GenericBrowserDomAdapter extends _DomAdapter {
885
+ readonly supportsDOMEvents: boolean;
886
+ }
831
887
 
832
888
  /**
833
889
  * A `DomAdapter` powered by full browser DOM APIs.
@@ -835,7 +891,7 @@ export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFea
835
891
  * @security Tread carefully! Interacting with the DOM directly is dangerous and
836
892
  * can introduce XSS risks.
837
893
  */
838
- export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
894
+ declare class BrowserDomAdapter extends GenericBrowserDomAdapter {
839
895
  static makeCurrent(): void;
840
896
  onAndCancel(el: Node, evt: any, listener: any, options: any): Function;
841
897
  dispatchEvent(el: Node, evt: any): void;
@@ -853,87 +909,24 @@ export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
853
909
  getCookie(name: string): string | null;
854
910
  }
855
911
 
856
- export declare class ɵBrowserGetTestability implements GetTestability {
912
+ declare class BrowserGetTestability implements GetTestability {
857
913
  addToWindow(registry: TestabilityRegistry): void;
858
914
  findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
859
915
  }
860
916
 
861
- export declare class ɵDomEventsPlugin extends EventManagerPlugin {
917
+ declare class DomEventsPlugin extends EventManagerPlugin {
862
918
  constructor(doc: any);
863
919
  supports(eventName: string): boolean;
864
920
  addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
865
921
  removeEventListener(target: any, eventName: string, callback: Function, options?: ListenerOptions): void;
866
- static ɵfac: i0.ɵɵFactoryDeclarationDomEventsPlugin, never>;
867
- static ɵprov: i0.ɵɵInjectableDeclarationDomEventsPlugin>;
868
- }
869
-
870
- export declare class ɵDomRendererFactory2 implements RendererFactory2, OnDestroy {
871
- private readonly eventManager;
872
- private readonly sharedStylesHost;
873
- private readonly appId;
874
- private removeStylesOnCompDestroy;
875
- private readonly doc;
876
- readonly platformId: Object;
877
- readonly ngZone: NgZone;
878
- private readonly nonce;
879
- private readonly tracingService;
880
- private readonly rendererByCompId;
881
- private readonly defaultRenderer;
882
- private readonly platformIsServer;
883
- constructor(eventManager: EventManager, sharedStylesHost: ɵSharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null, tracingService?: ɵTracingService<ɵTracingSnapshot> | null);
884
- createRenderer(element: any, type: RendererType2 | null): Renderer2;
885
- private getOrCreateRenderer;
886
- ngOnDestroy(): void;
887
- /**
888
- * Used during HMR to clear any cached data about a component.
889
- * @param componentId ID of the component that is being replaced.
890
- */
891
- protected componentReplaced(componentId: string): void;
892
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, [null, null, null, null, null, null, null, null, { optional: true; }]>;
893
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>;
894
- }
895
-
896
- export declare class ɵDomSanitizerImpl extends DomSanitizer {
897
- private _doc;
898
- constructor(_doc: any);
899
- sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
900
- bypassSecurityTrustHtml(value: string): SafeHtml;
901
- bypassSecurityTrustStyle(value: string): SafeStyle;
902
- bypassSecurityTrustScript(value: string): SafeScript;
903
- bypassSecurityTrustUrl(value: string): SafeUrl;
904
- bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
905
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSanitizerImpl, never>;
906
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSanitizerImpl>;
907
- }
908
-
909
- export { ɵgetDOM }
910
-
911
- /**
912
- * Event plugin that adds Hammer support to an application.
913
- *
914
- * @ngModule HammerModule
915
- */
916
- export declare class ɵHammerGesturesPlugin extends EventManagerPlugin {
917
- private _config;
918
- private _injector;
919
- private loader?;
920
- private _loaderPromise;
921
- constructor(doc: any, _config: HammerGestureConfig, _injector: Injector, loader?: (HammerLoader | null) | undefined);
922
- supports(eventName: string): boolean;
923
- addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
924
- isCustomEvent(eventName: string): boolean;
925
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵHammerGesturesPlugin, [null, null, null, { optional: true; }]>;
926
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵHammerGesturesPlugin>;
922
+ static ɵfac: i0.ɵɵFactoryDeclaration<DomEventsPlugin, never>;
923
+ static ɵprov: i0.ɵɵInjectableDeclaration<DomEventsPlugin>;
927
924
  }
928
925
 
929
- export declare function ɵinitDomAdapter(): void;
930
-
931
- export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
932
-
933
926
  /**
934
927
  * A browser plug-in that provides support for handling of key events in Angular.
935
928
  */
936
- export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
929
+ declare class KeyEventsPlugin extends EventManagerPlugin {
937
930
  /**
938
931
  * Initializes an instance of the browser plug-in.
939
932
  * @param doc The document in which key events will be detected.
@@ -986,16 +979,15 @@ export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
986
979
  * @returns A callback function.
987
980
  */
988
981
  static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function;
989
- static ɵfac: i0.ɵɵFactoryDeclarationKeyEventsPlugin, never>;
990
- static ɵprov: i0.ɵɵInjectableDeclarationKeyEventsPlugin>;
982
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeyEventsPlugin, never>;
983
+ static ɵprov: i0.ɵɵInjectableDeclaration<KeyEventsPlugin>;
991
984
  }
992
985
 
993
-
994
986
  /**
995
987
  * The list of error codes used in runtime code of the `platform-browser` package.
996
988
  * Reserved error code range: 5000-5500.
997
989
  */
998
- export declare const enum ɵRuntimeErrorCode {
990
+ declare const enum RuntimeErrorCode {
999
991
  UNSUPPORTED_ZONEJS_INSTANCE = -5000,
1000
992
  BROWSER_MODULE_ALREADY_LOADED = 5100,
1001
993
  NO_PLUGIN_FOR_EVENT = 5101,
@@ -1009,53 +1001,15 @@ export declare const enum ɵRuntimeErrorCode {
1009
1001
  ANIMATION_RENDERER_ASYNC_LOADING_FAILURE = 5300
1010
1002
  }
1011
1003
 
1012
- export declare class ɵSharedStylesHost implements OnDestroy {
1013
- private readonly doc;
1014
- private readonly appId;
1015
- private readonly nonce?;
1016
- /**
1017
- * Provides usage information for active inline style content and associated HTML <style> elements.
1018
- * Embedded styles typically originate from the `styles` metadata of a rendered component.
1019
- */
1020
- private readonly inline;
1021
- /**
1022
- * Provides usage information for active external style URLs and the associated HTML <link> elements.
1023
- * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
1024
- */
1025
- private readonly external;
1026
- /**
1027
- * Set of host DOM nodes that will have styles attached.
1028
- */
1029
- private readonly hosts;
1030
- /**
1031
- * Whether the application code is currently executing on a server.
1032
- */
1033
- private readonly isServer;
1034
- constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
1035
- /**
1036
- * Adds embedded styles to the DOM via HTML `style` elements.
1037
- * @param styles An array of style content strings.
1038
- */
1039
- addStyles(styles: string[], urls?: string[]): void;
1040
- /**
1041
- * Removes embedded styles from the DOM that were added as HTML `style` elements.
1042
- * @param styles An array of style content strings.
1043
- */
1044
- removeStyles(styles: string[], urls?: string[]): void;
1045
- protected addUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>, creator: (value: string, doc: Document) => T): void;
1046
- protected removeUsage<T extends HTMLElement>(value: string, usages: Map<string, UsageRecord<T>>): void;
1047
- ngOnDestroy(): void;
1048
- /**
1049
- * Adds a host node to the set of style hosts and adds all existing style usage to
1050
- * the newly added host node.
1051
- *
1052
- * This is currently only used for Shadow DOM encapsulation mode.
1053
- */
1054
- addHost(hostNode: Node): void;
1055
- removeHost(hostNode: Node): void;
1056
- private addElement;
1057
- static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>;
1058
- static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>;
1059
- }
1004
+ /**
1005
+ * @module
1006
+ * @description
1007
+ * Entry point for all public APIs of the platform-browser package.
1008
+ */
1009
+
1010
+ /**
1011
+ * @publicApi
1012
+ */
1013
+ declare const VERSION: Version;
1060
1014
 
1061
- export { }
1015
+ export { type ApplicationConfig, BrowserModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, type HammerLoader, HammerModule, type HydrationFeature, HydrationFeatureKind, Meta, type MetaDefinition, REMOVE_STYLES_ON_COMPONENT_DESTROY, type SafeHtml, type SafeResourceUrl, type SafeScript, type SafeStyle, type SafeUrl, type SafeValue, Title, VERSION, bootstrapApplication, createApplication, disableDebugTools, enableDebugTools, platformBrowser, provideClientHydration, provideProtractorTestingSupport, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, DomRendererFactory2 as ɵDomRendererFactory2, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, KeyEventsPlugin as ɵKeyEventsPlugin, RuntimeErrorCode as ɵRuntimeErrorCode, SharedStylesHost as ɵSharedStylesHost, initDomAdapter as ɵinitDomAdapter };