UNPKG

38.8 kBTypeScriptView Raw
1/**
2 * @license Angular v16.2.6
3 * (c) 2010-2022 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7
8import { ApplicationConfig as ApplicationConfig_2 } from '@angular/core';
9import { ApplicationRef } from '@angular/core';
10import { ComponentRef } from '@angular/core';
11import { DebugElement } from '@angular/core';
12import { DebugNode } from '@angular/core';
13import { EnvironmentProviders } from '@angular/core';
14import { GetTestability } from '@angular/core';
15import * as i0 from '@angular/core';
16import * as i1 from '@angular/common';
17import { InjectionToken } from '@angular/core';
18import { makeStateKey as makeStateKey_2 } from '@angular/core';
19import { ModuleWithProviders } from '@angular/core';
20import { NgZone } from '@angular/core';
21import { OnDestroy } from '@angular/core';
22import { PlatformRef } from '@angular/core';
23import { Predicate } from '@angular/core';
24import { Provider } from '@angular/core';
25import { Renderer2 } from '@angular/core';
26import { RendererFactory2 } from '@angular/core';
27import { RendererType2 } from '@angular/core';
28import { Sanitizer } from '@angular/core';
29import { SecurityContext } from '@angular/core';
30import { StateKey as StateKey_2 } from '@angular/core';
31import { StaticProvider } from '@angular/core';
32import { Testability } from '@angular/core';
33import { TestabilityRegistry } from '@angular/core';
34import { TransferState as TransferState_2 } from '@angular/core';
35import { Type } from '@angular/core';
36import { Version } from '@angular/core';
37import { ɵConsole } from '@angular/core';
38import { ɵDomAdapter } from '@angular/common';
39import { ɵgetDOM } from '@angular/common';
40
41/**
42 * Set of config options available during the application bootstrap operation.
43 *
44 * @publicApi
45 *
46 * @deprecated
47 * `ApplicationConfig` has moved, please import `ApplicationConfig` from `@angular/core` instead.
48 */
49export declare type ApplicationConfig = ApplicationConfig_2;
50
51/**
52 * Bootstraps an instance of an Angular application and renders a standalone component as the
53 * application's root component. More information about standalone components can be found in [this
54 * guide](guide/standalone-components).
55 *
56 * @usageNotes
57 * The root component passed into this function *must* be a standalone one (should have the
58 * `standalone: true` flag in the `@Component` decorator config).
59 *
60 * ```typescript
61 * @Component({
62 * standalone: true,
63 * template: 'Hello world!'
64 * })
65 * class RootComponent {}
66 *
67 * const appRef: ApplicationRef = await bootstrapApplication(RootComponent);
68 * ```
69 *
70 * You can add the list of providers that should be available in the application injector by
71 * specifying the `providers` field in an object passed as the second argument:
72 *
73 * ```typescript
74 * await bootstrapApplication(RootComponent, {
75 * providers: [
76 * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}
77 * ]
78 * });
79 * ```
80 *
81 * The `importProvidersFrom` helper method can be used to collect all providers from any
82 * existing NgModule (and transitively from all NgModules that it imports):
83 *
84 * ```typescript
85 * await bootstrapApplication(RootComponent, {
86 * providers: [
87 * importProvidersFrom(SomeNgModule)
88 * ]
89 * });
90 * ```
91 *
92 * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by
93 * default. You can add [Testability](api/core/Testability) by getting the list of necessary
94 * providers using `provideProtractorTestingSupport()` function and adding them into the `providers`
95 * array, for example:
96 *
97 * ```typescript
98 * import {provideProtractorTestingSupport} from '@angular/platform-browser';
99 *
100 * await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]});
101 * ```
102 *
103 * @param rootComponent A reference to a standalone component that should be rendered.
104 * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for
105 * additional info.
106 * @returns A promise that returns an `ApplicationRef` instance once resolved.
107 *
108 * @publicApi
109 */
110export declare function bootstrapApplication(rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef>;
111
112/**
113 * Exports required infrastructure for all Angular apps.
114 * Included by default in all Angular apps created with the CLI
115 * `new` command.
116 * Re-exports `CommonModule` and `ApplicationModule`, making their
117 * exports and providers available to all apps.
118 *
119 * @publicApi
120 */
121export declare class BrowserModule {
122 constructor(providersAlreadyPresent: boolean | null);
123 /**
124 * Configures a browser-based app to transition from a server-rendered app, if
125 * one is present on the page.
126 *
127 * @param params An object containing an identifier for the app to transition.
128 * The ID must match between the client and server versions of the app.
129 * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
130 *
131 * @deprecated Use {@link APP_ID} instead to set the application ID.
132 */
133 static withServerTransition(params: {
134 appId: string;
135 }): ModuleWithProviders<BrowserModule>;
136 static ɵfac: i0.ɵɵFactoryDeclaration<BrowserModule, [{ optional: true; skipSelf: true; }]>;
137 static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserModule, never, never, [typeof i1.CommonModule, typeof i0.ApplicationModule]>;
138 static ɵinj: i0.ɵɵInjectorDeclaration<BrowserModule>;
139}
140
141/**
142 * Predicates for use with {@link DebugElement}'s query functions.
143 *
144 * @publicApi
145 */
146export declare class By {
147 /**
148 * Match all nodes.
149 *
150 * @usageNotes
151 * ### Example
152 *
153 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
154 */
155 static all(): Predicate<DebugNode>;
156 /**
157 * Match elements by the given CSS selector.
158 *
159 * @usageNotes
160 * ### Example
161 *
162 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
163 */
164 static css(selector: string): Predicate<DebugElement>;
165 /**
166 * Match nodes that have the given directive present.
167 *
168 * @usageNotes
169 * ### Example
170 *
171 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
172 */
173 static directive(type: Type<any>): Predicate<DebugNode>;
174}
175
176/**
177 * Create an instance of an Angular application without bootstrapping any components. This is useful
178 * for the situation where one wants to decouple application environment creation (a platform and
179 * associated injectors) from rendering components on a screen. Components can be subsequently
180 * bootstrapped on the returned `ApplicationRef`.
181 *
182 * @param options Extra configuration for the application environment, see `ApplicationConfig` for
183 * additional info.
184 * @returns A promise that returns an `ApplicationRef` instance once resolved.
185 *
186 * @publicApi
187 */
188export declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>;
189
190/**
191 * Disables Angular tools.
192 *
193 * @publicApi
194 */
195export declare function disableDebugTools(): void;
196
197/**
198 * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
199 * values to be safe to use in the different DOM contexts.
200 *
201 * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
202 * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
203 * the website.
204 *
205 * In specific situations, it might be necessary to disable sanitization, for example if the
206 * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
207 * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
208 * methods, and then binding to that value from the template.
209 *
210 * These situations should be very rare, and extraordinary care must be taken to avoid creating a
211 * Cross Site Scripting (XSS) security bug!
212 *
213 * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
214 * close as possible to the source of the value, to make it easy to verify no security bug is
215 * created by its use.
216 *
217 * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
218 * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
219 * code. The sanitizer leaves safe values intact.
220 *
221 * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
222 * sanitization for the value passed in. Carefully check and audit all values and code paths going
223 * into this call. Make sure any user data is appropriately escaped for this security context.
224 * For more detail, see the [Security Guide](https://g.co/ng/security).
225 *
226 * @publicApi
227 */
228export declare abstract class DomSanitizer implements Sanitizer {
229 /**
230 * Gets a safe value from either a known safe value or a value with unknown safety.
231 *
232 * If the given value is already a `SafeValue`, this method returns the unwrapped value.
233 * If the security context is HTML and the given value is a plain string, this method
234 * sanitizes the string, removing any potentially unsafe content.
235 * For any other security context, this method throws an error if provided
236 * with a plain string.
237 */
238 abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
239 /**
240 * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML
241 * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will
242 * leave safe HTML intact, so in most situations this method should not be used.
243 *
244 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
245 * security risks!
246 */
247 abstract bypassSecurityTrustHtml(value: string): SafeHtml;
248 /**
249 * Bypass security and trust the given value to be safe style value (CSS).
250 *
251 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
252 * security risks!
253 */
254 abstract bypassSecurityTrustStyle(value: string): SafeStyle;
255 /**
256 * Bypass security and trust the given value to be safe JavaScript.
257 *
258 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
259 * security risks!
260 */
261 abstract bypassSecurityTrustScript(value: string): SafeScript;
262 /**
263 * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used
264 * in hyperlinks or `<img src>`.
265 *
266 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
267 * security risks!
268 */
269 abstract bypassSecurityTrustUrl(value: string): SafeUrl;
270 /**
271 * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may
272 * be used to load executable code from, like `<script src>`, or `<iframe src>`.
273 *
274 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
275 * security risks!
276 */
277 abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
278 static ɵfac: i0.ɵɵFactoryDeclaration<DomSanitizer, never>;
279 static ɵprov: i0.ɵɵInjectableDeclaration<DomSanitizer>;
280}
281
282/**
283 * Enabled Angular debug tools that are accessible via your browser's
284 * developer console.
285 *
286 * Usage:
287 *
288 * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
289 * 1. Type `ng.` (usually the console will show auto-complete suggestion)
290 * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
291 * then hit Enter.
292 *
293 * @publicApi
294 */
295export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
296
297/**
298 * The injection token for the event-manager plug-in service.
299 *
300 * @publicApi
301 */
302export declare const EVENT_MANAGER_PLUGINS: InjectionToken<EventManagerPlugin[]>;
303
304/**
305 * An injectable service that provides event management for Angular
306 * through a browser plug-in.
307 *
308 * @publicApi
309 */
310export declare class EventManager {
311 private _zone;
312 private _plugins;
313 private _eventNameToPlugin;
314 /**
315 * Initializes an instance of the event-manager service.
316 */
317 constructor(plugins: EventManagerPlugin[], _zone: NgZone);
318 /**
319 * Registers a handler for a specific element and event.
320 *
321 * @param element The HTML element to receive event notifications.
322 * @param eventName The name of the event to listen for.
323 * @param handler A function to call when the notification occurs. Receives the
324 * event object as an argument.
325 * @returns A callback function that can be used to remove the handler.
326 */
327 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
328 /**
329 * Retrieves the compilation zone in which event listeners are registered.
330 */
331 getZone(): NgZone;
332 static ɵfac: i0.ɵɵFactoryDeclaration<EventManager, never>;
333 static ɵprov: i0.ɵɵInjectableDeclaration<EventManager>;
334}
335
336declare abstract class EventManagerPlugin {
337 private _doc;
338 constructor(_doc: any);
339 manager: EventManager;
340 abstract supports(eventName: string): boolean;
341 abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
342}
343
344/**
345 * Provides DOM operations in any browser environment.
346 *
347 * @security Tread carefully! Interacting with the DOM directly is dangerous and
348 * can introduce XSS risks.
349 */
350declare abstract class GenericBrowserDomAdapter extends ɵDomAdapter {
351 readonly supportsDOMEvents: boolean;
352}
353
354/**
355 * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
356 * @see {@link HammerGestureConfig}
357 *
358 * @ngModule HammerModule
359 * @publicApi
360 */
361export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
362
363/**
364 * Injection token used to provide a {@link HammerLoader} to Angular.
365 *
366 * @publicApi
367 */
368export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
369
370/**
371 * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
372 * for gesture recognition. Configures specific event recognition.
373 * @publicApi
374 */
375export declare class HammerGestureConfig {
376 /**
377 * A set of supported event names for gestures to be used in Angular.
378 * Angular supports all built-in recognizers, as listed in
379 * [HammerJS documentation](https://hammerjs.github.io/).
380 */
381 events: string[];
382 /**
383 * Maps gesture event names to a set of configuration options
384 * that specify overrides to the default values for specific properties.
385 *
386 * The key is a supported event name to be configured,
387 * and the options object contains a set of properties, with override values
388 * to be applied to the named recognizer event.
389 * For example, to disable recognition of the rotate event, specify
390 * `{"rotate": {"enable": false}}`.
391 *
392 * Properties that are not present take the HammerJS default values.
393 * For information about which properties are supported for which events,
394 * and their allowed and default values, see
395 * [HammerJS documentation](https://hammerjs.github.io/).
396 *
397 */
398 overrides: {
399 [key: string]: Object;
400 };
401 /**
402 * Properties whose default values can be overridden for a given event.
403 * Different sets of properties apply to different events.
404 * For information about which properties are supported for which events,
405 * and their allowed and default values, see
406 * [HammerJS documentation](https://hammerjs.github.io/).
407 */
408 options?: {
409 cssProps?: any;
410 domEvents?: boolean;
411 enable?: boolean | ((manager: any) => boolean);
412 preset?: any[];
413 touchAction?: string;
414 recognizers?: any[];
415 inputClass?: any;
416 inputTarget?: EventTarget;
417 };
418 /**
419 * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
420 * and attaches it to a given HTML element.
421 * @param element The element that will recognize gestures.
422 * @returns A HammerJS event-manager object.
423 */
424 buildHammer(element: HTMLElement): HammerInstance;
425 static ɵfac: i0.ɵɵFactoryDeclaration<HammerGestureConfig, never>;
426 static ɵprov: i0.ɵɵInjectableDeclaration<HammerGestureConfig>;
427}
428
429declare interface HammerInstance {
430 on(eventName: string, callback?: Function): void;
431 off(eventName: string, callback?: Function): void;
432 destroy?(): void;
433}
434
435/**
436 * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
437 *
438 * @publicApi
439 */
440export declare type HammerLoader = () => Promise<void>;
441
442/**
443 * Adds support for HammerJS.
444 *
445 * Import this module at the root of your application so that Angular can work with
446 * HammerJS to detect gesture events.
447 *
448 * Note that applications still need to include the HammerJS script itself. This module
449 * simply sets up the coordination layer between HammerJS and Angular's EventManager.
450 *
451 * @publicApi
452 */
453export declare class HammerModule {
454 static ɵfac: i0.ɵɵFactoryDeclaration<HammerModule, never>;
455 static ɵmod: i0.ɵɵNgModuleDeclaration<HammerModule, never, never, never>;
456 static ɵinj: i0.ɵɵInjectorDeclaration<HammerModule>;
457}
458
459/**
460 * Helper type to represent a Hydration feature.
461 *
462 * @publicApi
463 * @developerPreview
464 */
465export declare interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
466 ɵkind: FeatureKind;
467 ɵproviders: Provider[];
468}
469
470/**
471 * The list of features as an enum to uniquely type each `HydrationFeature`.
472 * @see {@link HydrationFeature}
473 *
474 * @publicApi
475 * @developerPreview
476 */
477export declare const enum HydrationFeatureKind {
478 NoDomReuseFeature = 0,
479 NoHttpTransferCache = 1
480}
481
482/**
483 * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
484 *
485 * Example:
486 *
487 * ```
488 * const COUNTER_KEY = makeStateKey<number>('counter');
489 * let value = 10;
490 *
491 * transferState.set(COUNTER_KEY, value);
492 * ```
493 *
494 * @publicApi
495 * @deprecated `makeStateKey` has moved, please import `makeStateKey` from `@angular/core` instead.
496 */
497export declare const makeStateKey: typeof makeStateKey_2;
498
499/**
500 * A service for managing HTML `<meta>` tags.
501 *
502 * Properties of the `MetaDefinition` object match the attributes of the
503 * HTML `<meta>` tag. These tags define document metadata that is important for
504 * things like configuring a Content Security Policy, defining browser compatibility
505 * and security settings, setting HTTP Headers, defining rich content for social sharing,
506 * and Search Engine Optimization (SEO).
507 *
508 * To identify specific `<meta>` tags in a document, use an attribute selection
509 * string in the format `"tag_attribute='value string'"`.
510 * For example, an `attrSelector` value of `"name='description'"` matches a tag
511 * whose `name` attribute has the value `"description"`.
512 * Selectors are used with the `querySelector()` Document method,
513 * in the format `meta[{attrSelector}]`.
514 *
515 * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
516 * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
517 *
518 *
519 * @publicApi
520 */
521export declare class Meta {
522 private _doc;
523 private _dom;
524 constructor(_doc: any);
525 /**
526 * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
527 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
528 * values in the provided tag definition, and verifies that all other attribute values are equal.
529 * If an existing element is found, it is returned and is not modified in any way.
530 * @param tag The definition of a `<meta>` element to match or create.
531 * @param forceCreation True to create a new element without checking whether one already exists.
532 * @returns The existing element with the same attributes and values if found,
533 * the new element if no match is found, or `null` if the tag parameter is not defined.
534 */
535 addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null;
536 /**
537 * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
538 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
539 * values in the provided tag definition, and verifies that all other attribute values are equal.
540 * @param tags An array of tag definitions to match or create.
541 * @param forceCreation True to create new elements without checking whether they already exist.
542 * @returns The matching elements if found, or the new elements.
543 */
544 addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[];
545 /**
546 * Retrieves a `<meta>` tag element in the current HTML document.
547 * @param attrSelector The tag attribute and value to match against, in the format
548 * `"tag_attribute='value string'"`.
549 * @returns The matching element, if any.
550 */
551 getTag(attrSelector: string): HTMLMetaElement | null;
552 /**
553 * Retrieves a set of `<meta>` tag elements in the current HTML document.
554 * @param attrSelector The tag attribute and value to match against, in the format
555 * `"tag_attribute='value string'"`.
556 * @returns The matching elements, if any.
557 */
558 getTags(attrSelector: string): HTMLMetaElement[];
559 /**
560 * Modifies an existing `<meta>` tag element in the current HTML document.
561 * @param tag The tag description with which to replace the existing tag content.
562 * @param selector A tag attribute and value to match against, to identify
563 * an existing tag. A string in the format `"tag_attribute=`value string`"`.
564 * If not supplied, matches a tag with the same `name` or `property` attribute value as the
565 * replacement tag.
566 * @return The modified element.
567 */
568 updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null;
569 /**
570 * Removes an existing `<meta>` tag element from the current HTML document.
571 * @param attrSelector A tag attribute and value to match against, to identify
572 * an existing tag. A string in the format `"tag_attribute=`value string`"`.
573 */
574 removeTag(attrSelector: string): void;
575 /**
576 * Removes an existing `<meta>` tag element from the current HTML document.
577 * @param meta The tag definition to match against to identify an existing tag.
578 */
579 removeTagElement(meta: HTMLMetaElement): void;
580 private _getOrCreateElement;
581 private _setMetaElementAttributes;
582 private _parseSelector;
583 private _containsAttributes;
584 private _getMetaKeyMap;
585 static ɵfac: i0.ɵɵFactoryDeclaration<Meta, never>;
586 static ɵprov: i0.ɵɵInjectableDeclaration<Meta>;
587}
588
589/**
590 * Represents the attributes of an HTML `<meta>` element. The element itself is
591 * represented by the internal `HTMLMetaElement`.
592 *
593 * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
594 * @see {@link Meta}
595 *
596 * @publicApi
597 */
598export declare type MetaDefinition = {
599 charset?: string;
600 content?: string;
601 httpEquiv?: string;
602 id?: string;
603 itemprop?: string;
604 name?: string;
605 property?: string;
606 scheme?: string;
607 url?: string;
608} & {
609 [prop: string]: string;
610};
611
612/**
613 * A factory function that returns a `PlatformRef` instance associated with browser service
614 * providers.
615 *
616 * @publicApi
617 */
618export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
619
620/**
621 * Sets up providers necessary to enable hydration functionality for the application.
622 *
623 * By default, the function enables the recommended set of features for the optimal
624 * performance for most of the applications. You can enable/disable features by
625 * passing special functions (from the `HydrationFeatures` set) as arguments to the
626 * `provideClientHydration` function. It includes the following features:
627 *
628 * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
629 * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
630 * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
631 * [here](/guide/universal#caching-data-when-using-httpclient).
632 *
633 * These functions functions will allow you to disable some of the default features:
634 * * {@link withNoDomReuse} to disable DOM nodes reuse during hydration
635 * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
636 *
637 *
638 * @usageNotes
639 *
640 * Basic example of how you can enable hydration in your application when
641 * `bootstrapApplication` function is used:
642 * ```
643 * bootstrapApplication(AppComponent, {
644 * providers: [provideClientHydration()]
645 * });
646 * ```
647 *
648 * Alternatively if you are using NgModules, you would add `provideClientHydration`
649 * to your root app module's provider list.
650 * ```
651 * @NgModule({
652 * declarations: [RootCmp],
653 * bootstrap: [RootCmp],
654 * providers: [provideClientHydration()],
655 * })
656 * export class AppModule {}
657 * ```
658 *
659 * @see {@link withNoDomReuse}
660 * @see {@link withNoHttpTransferCache}
661 *
662 * @param features Optional features to configure additional router behaviors.
663 * @returns A set of providers to enable hydration.
664 *
665 * @publicApi
666 * @developerPreview
667 */
668export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
669
670/**
671 * Returns a set of providers required to setup [Testability](api/core/Testability) for an
672 * application bootstrapped using the `bootstrapApplication` function. The set of providers is
673 * needed to support testing an application with Protractor (which relies on the Testability APIs
674 * to be present).
675 *
676 * @returns An array of providers required to setup Testability for an application and make it
677 * available for testing using Protractor.
678 *
679 * @publicApi
680 */
681export declare function provideProtractorTestingSupport(): Provider[];
682
683/**
684 * A [DI token](guide/glossary#di-token "DI token definition") that indicates whether styles
685 * of destroyed components should be removed from DOM.
686 *
687 * By default, the value is set to `false`. This will be changed in the next major version.
688 * @publicApi
689 */
690export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>;
691
692/**
693 * Marker interface for a value that's safe to use as HTML.
694 *
695 * @publicApi
696 */
697export declare interface SafeHtml extends SafeValue {
698}
699
700/**
701 * Marker interface for a value that's safe to use as a URL to load executable code from.
702 *
703 * @publicApi
704 */
705export declare interface SafeResourceUrl extends SafeValue {
706}
707
708/**
709 * Marker interface for a value that's safe to use as JavaScript.
710 *
711 * @publicApi
712 */
713export declare interface SafeScript extends SafeValue {
714}
715
716/**
717 * Marker interface for a value that's safe to use as style (CSS).
718 *
719 * @publicApi
720 */
721export declare interface SafeStyle extends SafeValue {
722}
723
724/**
725 * Marker interface for a value that's safe to use as a URL linking to a document.
726 *
727 * @publicApi
728 */
729export declare interface SafeUrl extends SafeValue {
730}
731
732/**
733 * Marker interface for a value that's safe to use in a particular context.
734 *
735 * @publicApi
736 */
737export declare interface SafeValue {
738}
739
740/**
741 * A type-safe key to use with `TransferState`.
742 *
743 * Example:
744 *
745 * ```
746 * const COUNTER_KEY = makeStateKey<number>('counter');
747 * let value = 10;
748 *
749 * transferState.set(COUNTER_KEY, value);
750 * ```
751 * @publicApi
752 *
753 * @deprecated `StateKey` has moved, please import `StateKey` from `@angular/core` instead.
754 */
755export declare type StateKey<T> = StateKey_2<T>;
756
757/**
758 * A service that can be used to get and set the title of a current HTML document.
759 *
760 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
761 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
762 * (representing the `<title>` tag). Instead, this service can be used to set and get the current
763 * title value.
764 *
765 * @publicApi
766 */
767export declare class Title {
768 private _doc;
769 constructor(_doc: any);
770 /**
771 * Get the title of the current HTML document.
772 */
773 getTitle(): string;
774 /**
775 * Set the title of the current HTML document.
776 * @param newTitle
777 */
778 setTitle(newTitle: string): void;
779 static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>;
780 static ɵprov: i0.ɵɵInjectableDeclaration<Title>;
781}
782
783/**
784 *
785 * A key value store that is transferred from the application on the server side to the application
786 * on the client side.
787 *
788 * The `TransferState` is available as an injectable token.
789 * On the client, just inject this token using DI and use it, it will be lazily initialized.
790 * On the server it's already included if `renderApplication` function is used. Otherwise, import
791 * the `ServerTransferStateModule` module to make the `TransferState` available.
792 *
793 * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
794 * boolean, number, string, null and non-class objects will be serialized and deserialized in a
795 * non-lossy manner.
796 *
797 * @publicApi
798 *
799 * @deprecated `TransferState` has moved, please import `TransferState` from `@angular/core`
800 * instead.
801 */
802export declare type TransferState = TransferState_2;
803
804export declare const TransferState: {
805 new (): TransferState_2;
806};
807
808/**
809 * @publicApi
810 */
811export declare const VERSION: Version;
812
813/**
814 * Disables DOM nodes reuse during hydration. Effectively makes
815 * Angular re-render an application from scratch on the client.
816 *
817 * When this option is enabled, make sure that the initial navigation
818 * option is configured for the Router as `enabledBlocking` by using the
819 * `withEnabledBlockingInitialNavigation` in the `provideRouter` call:
820 *
821 * ```
822 * bootstrapApplication(RootComponent, {
823 * providers: [
824 * provideRouter(
825 * // ... other features ...
826 * withEnabledBlockingInitialNavigation()
827 * ),
828 * provideClientHydration(withNoDomReuse())
829 * ]
830 * });
831 * ```
832 *
833 * This would ensure that the application is rerendered after all async
834 * operations in the Router (such as lazy-loading of components,
835 * waiting for async guards and resolvers) are completed to avoid
836 * clearing the DOM on the client too soon, thus causing content flicker.
837 *
838 * @see {@link provideRouter}
839 * @see {@link withEnabledBlockingInitialNavigation}
840 *
841 * @publicApi
842 * @developerPreview
843 */
844export declare function withNoDomReuse(): HydrationFeature<HydrationFeatureKind.NoDomReuseFeature>;
845
846/**
847 * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
848 * server and other one on the browser.
849 *
850 * @publicApi
851 * @developerPreview
852 */
853export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
854
855/**
856 * A `DomAdapter` powered by full browser DOM APIs.
857 *
858 * @security Tread carefully! Interacting with the DOM directly is dangerous and
859 * can introduce XSS risks.
860 */
861export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
862 static makeCurrent(): void;
863 onAndCancel(el: Node, evt: any, listener: any): Function;
864 dispatchEvent(el: Node, evt: any): void;
865 remove(node: Node): void;
866 createElement(tagName: string, doc?: Document): HTMLElement;
867 createHtmlDocument(): Document;
868 getDefaultDocument(): Document;
869 isElementNode(node: Node): boolean;
870 isShadowRoot(node: any): boolean;
871 /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
872 getGlobalEventTarget(doc: Document, target: string): EventTarget | null;
873 getBaseHref(doc: Document): string | null;
874 resetBaseElement(): void;
875 getUserAgent(): string;
876 getCookie(name: string): string | null;
877}
878
879export declare class ɵBrowserGetTestability implements GetTestability {
880 addToWindow(registry: TestabilityRegistry): void;
881 findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
882}
883
884export declare class ɵDomEventsPlugin extends EventManagerPlugin {
885 constructor(doc: any);
886 supports(eventName: string): boolean;
887 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
888 removeEventListener(target: any, eventName: string, callback: Function): void;
889 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomEventsPlugin, never>;
890 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomEventsPlugin>;
891}
892
893export declare class ɵDomRendererFactory2 implements RendererFactory2, OnDestroy {
894 private readonly eventManager;
895 private readonly sharedStylesHost;
896 private readonly appId;
897 private removeStylesOnCompDestroy;
898 private readonly doc;
899 readonly platformId: Object;
900 readonly ngZone: NgZone;
901 private readonly nonce;
902 private readonly rendererByCompId;
903 private readonly defaultRenderer;
904 private readonly platformIsServer;
905 constructor(eventManager: EventManager, sharedStylesHost: ɵSharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null);
906 createRenderer(element: any, type: RendererType2 | null): Renderer2;
907 private getOrCreateRenderer;
908 ngOnDestroy(): void;
909 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, never>;
910 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>;
911}
912
913export declare class ɵDomSanitizerImpl extends DomSanitizer {
914 private _doc;
915 constructor(_doc: any);
916 sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
917 bypassSecurityTrustHtml(value: string): SafeHtml;
918 bypassSecurityTrustStyle(value: string): SafeStyle;
919 bypassSecurityTrustScript(value: string): SafeScript;
920 bypassSecurityTrustUrl(value: string): SafeUrl;
921 bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
922 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSanitizerImpl, never>;
923 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSanitizerImpl>;
924}
925
926export { ɵgetDOM }
927
928/**
929 * Event plugin that adds Hammer support to an application.
930 *
931 * @ngModule HammerModule
932 */
933export declare class ɵHammerGesturesPlugin extends EventManagerPlugin {
934 private _config;
935 private console;
936 private loader?;
937 private _loaderPromise;
938 constructor(doc: any, _config: HammerGestureConfig, console: ɵConsole, loader?: HammerLoader | null | undefined);
939 supports(eventName: string): boolean;
940 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
941 isCustomEvent(eventName: string): boolean;
942 static ɵfac: i0.ɵɵFactoryDeclaration<ɵHammerGesturesPlugin, [null, null, null, { optional: true; }]>;
943 static ɵprov: i0.ɵɵInjectableDeclaration<ɵHammerGesturesPlugin>;
944}
945
946export declare function ɵinitDomAdapter(): void;
947
948export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
949
950/**
951 * @publicApi
952 * A browser plug-in that provides support for handling of key events in Angular.
953 */
954export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
955 /**
956 * Initializes an instance of the browser plug-in.
957 * @param doc The document in which key events will be detected.
958 */
959 constructor(doc: any);
960 /**
961 * Reports whether a named key event is supported.
962 * @param eventName The event name to query.
963 * @return True if the named key event is supported.
964 */
965 supports(eventName: string): boolean;
966 /**
967 * Registers a handler for a specific element and key event.
968 * @param element The HTML element to receive event notifications.
969 * @param eventName The name of the key event to listen for.
970 * @param handler A function to call when the notification occurs. Receives the
971 * event object as an argument.
972 * @returns The key event that was registered.
973 */
974 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
975 /**
976 * Parses the user provided full keyboard event definition and normalizes it for
977 * later internal use. It ensures the string is all lowercase, converts special
978 * characters to a standard spelling, and orders all the values consistently.
979 *
980 * @param eventName The name of the key event to listen for.
981 * @returns an object with the full, normalized string, and the dom event name
982 * or null in the case when the event doesn't match a keyboard event.
983 */
984 static parseEventName(eventName: string): {
985 fullKey: string;
986 domEventName: string;
987 } | null;
988 /**
989 * Determines whether the actual keys pressed match the configured key code string.
990 * The `fullKeyCode` event is normalized in the `parseEventName` method when the
991 * event is attached to the DOM during the `addEventListener` call. This is unseen
992 * by the end user and is normalized for internal consistency and parsing.
993 *
994 * @param event The keyboard event.
995 * @param fullKeyCode The normalized user defined expected key event string
996 * @returns boolean.
997 */
998 static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean;
999 /**
1000 * Configures a handler callback for a key event.
1001 * @param fullKey The event name that combines all simultaneous keystrokes.
1002 * @param handler The function that responds to the key event.
1003 * @param zone The zone in which the event occurred.
1004 * @returns A callback function.
1005 */
1006 static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function;
1007 static ɵfac: i0.ɵɵFactoryDeclaration<ɵKeyEventsPlugin, never>;
1008 static ɵprov: i0.ɵɵInjectableDeclaration<ɵKeyEventsPlugin>;
1009}
1010
1011export declare class ɵSharedStylesHost implements OnDestroy {
1012 private readonly doc;
1013 private readonly appId;
1014 private nonce?;
1015 readonly platformId: object;
1016 private readonly styleRef;
1017 private readonly hostNodes;
1018 private readonly styleNodesInDOM;
1019 private readonly platformIsServer;
1020 constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
1021 addStyles(styles: string[]): void;
1022 removeStyles(styles: string[]): void;
1023 ngOnDestroy(): void;
1024 addHost(hostNode: Node): void;
1025 removeHost(hostNode: Node): void;
1026 private getAllStyles;
1027 private onStyleAdded;
1028 private onStyleRemoved;
1029 private collectServerRenderedStyles;
1030 private changeUsageCount;
1031 private getStyleElement;
1032 private addStyleToHost;
1033 private resetHostNodes;
1034 static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>;
1035 static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>;
1036}
1037
1038export { }
1039
\No newline at end of file