UNPKG

40.1 kBTypeScriptView Raw
1/**
2 * @license Angular v19.1.4
3 * (c) 2010-2024 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 { HttpTransferCacheOptions } from '@angular/common/http';
16import * as i0 from '@angular/core';
17import * as i1 from '@angular/common';
18import { InjectionToken } from '@angular/core';
19import { Injector } from '@angular/core';
20import { ListenerOptions } from '@angular/core';
21import { NgZone } from '@angular/core';
22import { OnDestroy } from '@angular/core';
23import { PlatformRef } from '@angular/core';
24import { Predicate } from '@angular/core';
25import { Provider } from '@angular/core';
26import { Renderer2 } from '@angular/core';
27import { RendererFactory2 } from '@angular/core';
28import { RendererType2 } from '@angular/core';
29import { Sanitizer } from '@angular/core';
30import { SecurityContext } from '@angular/core';
31import { StaticProvider } from '@angular/core';
32import { Testability } from '@angular/core';
33import { TestabilityRegistry } from '@angular/core';
34import { Type } from '@angular/core';
35import { Version } from '@angular/core';
36import { ɵDomAdapter } from '@angular/common';
37import { ɵgetDOM } from '@angular/common';
38import { ɵTracingService } from '@angular/core';
39import { ɵTracingSnapshot } from '@angular/core';
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/components/importing).
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 * ```angular-ts
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 * ```ts
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 * ```ts
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 * ```ts
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();
123 static ɵfac: i0.ɵɵFactoryDeclaration<BrowserModule, never>;
124 static ɵmod: i0.ɵɵNgModuleDeclaration<BrowserModule, never, never, [typeof i1.CommonModule, typeof i0.ApplicationModule]>;
125 static ɵinj: i0.ɵɵInjectorDeclaration<BrowserModule>;
126}
127
128/**
129 * Predicates for use with {@link DebugElement}'s query functions.
130 *
131 * @publicApi
132 */
133export declare class By {
134 /**
135 * Match all nodes.
136 *
137 * @usageNotes
138 * ### Example
139 *
140 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
141 */
142 static all(): Predicate<DebugNode>;
143 /**
144 * Match elements by the given CSS selector.
145 *
146 * @usageNotes
147 * ### Example
148 *
149 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
150 */
151 static css(selector: string): Predicate<DebugElement>;
152 /**
153 * Match nodes that have the given directive present.
154 *
155 * @usageNotes
156 * ### Example
157 *
158 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
159 */
160 static directive(type: Type<any>): Predicate<DebugNode>;
161}
162
163/**
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.
172 *
173 * @publicApi
174 */
175export declare function createApplication(options?: ApplicationConfig): Promise<ApplicationRef>;
176
177/**
178 * Disables Angular tools.
179 *
180 * @publicApi
181 */
182export declare function disableDebugTools(): void;
183
184/**
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.
207 *
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).
212 *
213 * @publicApi
214 */
215export 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.
224 */
225 abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
226 /**
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!
233 */
234 abstract bypassSecurityTrustHtml(value: string): SafeHtml;
235 /**
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!
240 */
241 abstract bypassSecurityTrustStyle(value: string): SafeStyle;
242 /**
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!
247 */
248 abstract bypassSecurityTrustScript(value: string): SafeScript;
249 /**
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!
255 */
256 abstract bypassSecurityTrustUrl(value: string): SafeUrl;
257 /**
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!
263 */
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 */
282export 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 */
289export 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 */
297export declare class EventManager {
298 private _zone;
299 private _plugins;
300 private _eventNameToPlugin;
301 /**
302 * Initializes an instance of the event-manager service.
303 */
304 constructor(plugins: EventManagerPlugin[], _zone: NgZone);
305 /**
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.
314 */
315 addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
316 /**
317 * Retrieves the compilation zone in which event listeners are registered.
318 */
319 getZone(): NgZone;
320 static ɵfac: i0.ɵɵFactoryDeclaration<EventManager, never>;
321 static ɵprov: i0.ɵɵInjectableDeclaration<EventManager>;
322}
323
324/**
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.
329 *
330 * @publicApi
331 */
332export 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;
340 /**
341 * Implement the behaviour for the supported events
342 */
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 */
352declare abstract class GenericBrowserDomAdapter extends ɵDomAdapter {
353 readonly supportsDOMEvents: boolean;
354}
355
356/**
357 * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
358 * @see {@link HammerGestureConfig}
359 *
360 * @ngModule HammerModule
361 * @publicApi
362 */
363export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
364
365/**
366 * Injection token used to provide a HammerLoader to Angular.
367 *
368 * @see {@link HammerLoader}
369 *
370 * @publicApi
371 */
372export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
373
374/**
375 * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
376 * for gesture recognition. Configures specific event recognition.
377 * @publicApi
378 */
379export declare class HammerGestureConfig {
380 /**
381 * A set of supported event names for gestures to be used in Angular.
382 * Angular supports all built-in recognizers, as listed in
383 * [HammerJS documentation](https://hammerjs.github.io/).
384 */
385 events: string[];
386 /**
387 * Maps gesture event names to a set of configuration options
388 * that specify overrides to the default values for specific properties.
389 *
390 * The key is a supported event name to be configured,
391 * and the options object contains a set of properties, with override values
392 * to be applied to the named recognizer event.
393 * For example, to disable recognition of the rotate event, specify
394 * `{"rotate": {"enable": false}}`.
395 *
396 * Properties that are not present take the HammerJS default values.
397 * For information about which properties are supported for which events,
398 * and their allowed and default values, see
399 * [HammerJS documentation](https://hammerjs.github.io/).
400 *
401 */
402 overrides: {
403 [key: string]: Object;
404 };
405 /**
406 * Properties whose default values can be overridden for a given event.
407 * Different sets of properties apply to different events.
408 * For information about which properties are supported for which events,
409 * and their allowed and default values, see
410 * [HammerJS documentation](https://hammerjs.github.io/).
411 */
412 options?: {
413 cssProps?: any;
414 domEvents?: boolean;
415 enable?: boolean | ((manager: any) => boolean);
416 preset?: any[];
417 touchAction?: string;
418 recognizers?: any[];
419 inputClass?: any;
420 inputTarget?: EventTarget;
421 };
422 /**
423 * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
424 * and attaches it to a given HTML element.
425 * @param element The element that will recognize gestures.
426 * @returns A HammerJS event-manager object.
427 */
428 buildHammer(element: HTMLElement): HammerInstance;
429 static ɵfac: i0.ɵɵFactoryDeclaration<HammerGestureConfig, never>;
430 static ɵprov: i0.ɵɵInjectableDeclaration<HammerGestureConfig>;
431}
432
433declare interface HammerInstance {
434 on(eventName: string, callback?: Function): void;
435 off(eventName: string, callback?: Function): void;
436 destroy?(): void;
437}
438
439/**
440 * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
441 *
442 * @publicApi
443 */
444export declare type HammerLoader = () => Promise<void>;
445
446/**
447 * Adds support for HammerJS.
448 *
449 * Import this module at the root of your application so that Angular can work with
450 * HammerJS to detect gesture events.
451 *
452 * Note that applications still need to include the HammerJS script itself. This module
453 * simply sets up the coordination layer between HammerJS and Angular's `EventManager`.
454 *
455 * @publicApi
456 */
457export declare class HammerModule {
458 static ɵfac: i0.ɵɵFactoryDeclaration<HammerModule, never>;
459 static ɵmod: i0.ɵɵNgModuleDeclaration<HammerModule, never, never, never>;
460 static ɵinj: i0.ɵɵInjectorDeclaration<HammerModule>;
461}
462
463/**
464 * Helper type to represent a Hydration feature.
465 *
466 * @publicApi
467 */
468export declare interface HydrationFeature<FeatureKind extends HydrationFeatureKind> {
469 ɵkind: FeatureKind;
470 ɵproviders: Provider[];
471}
472
473/**
474 * The list of features as an enum to uniquely type each `HydrationFeature`.
475 * @see {@link HydrationFeature}
476 *
477 * @publicApi
478 */
479export declare enum HydrationFeatureKind {
480 NoHttpTransferCache = 0,
481 HttpTransferCacheOptions = 1,
482 I18nSupport = 2,
483 EventReplay = 3,
484 IncrementalHydration = 4
485}
486
487/**
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 *
506 *
507 * @publicApi
508 */
509export 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>;
575}
576
577/**
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}
583 *
584 * @publicApi
585 */
586export 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
600/**
601 * A factory function that returns a `PlatformRef` instance associated with browser service
602 * providers.
603 *
604 * @publicApi
605 */
606export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
607
608/**
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.
654 *
655 * @publicApi
656 */
657export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
658
659/**
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).
664 *
665 * @returns An array of providers required to setup Testability for an application and make it
666 * available for testing using Protractor.
667 *
668 * @publicApi
669 */
670export declare function provideProtractorTestingSupport(): Provider[];
671
672/**
673 * A DI token that indicates whether styles
674 * of destroyed components should be removed from DOM.
675 *
676 * By default, the value is set to `true`.
677 * @publicApi
678 */
679export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>;
680
681/**
682 * Marker interface for a value that's safe to use as HTML.
683 *
684 * @publicApi
685 */
686export declare interface SafeHtml extends SafeValue {
687}
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 */
694export declare interface SafeResourceUrl extends SafeValue {
695}
696
697/**
698 * Marker interface for a value that's safe to use as JavaScript.
699 *
700 * @publicApi
701 */
702export declare interface SafeScript extends SafeValue {
703}
704
705/**
706 * Marker interface for a value that's safe to use as style (CSS).
707 *
708 * @publicApi
709 */
710export declare interface SafeStyle extends SafeValue {
711}
712
713/**
714 * Marker interface for a value that's safe to use as a URL linking to a document.
715 *
716 * @publicApi
717 */
718export declare interface SafeUrl extends SafeValue {
719}
720
721/**
722 * Marker interface for a value that's safe to use in a particular context.
723 *
724 * @publicApi
725 */
726export declare interface SafeValue {
727}
728
729/**
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.
736 *
737 * @publicApi
738 */
739export 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 */
759declare interface UsageRecord<T> {
760 elements: T[];
761 usage: number;
762}
763
764/**
765 * @publicApi
766 */
767export declare const VERSION: Version;
768
769/**
770 * Enables support for replaying user events (e.g. `click`s) that happened on a page
771 * before hydration logic has completed. Once an application is hydrated, all captured
772 * events are replayed and relevant event listeners are executed.
773 *
774 * @usageNotes
775 *
776 * Basic example of how you can enable event replay in your application when
777 * `bootstrapApplication` function is used:
778 * ```ts
779 * bootstrapApplication(AppComponent, {
780 * providers: [provideClientHydration(withEventReplay())]
781 * });
782 * ```
783 * @publicApi
784 * @see {@link provideClientHydration}
785 */
786export 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 */
796export declare function withHttpTransferCacheOptions(options: HttpTransferCacheOptions): HydrationFeature<HydrationFeatureKind.HttpTransferCacheOptions>;
797
798/**
799 * Enables support for hydrating i18n blocks.
800 *
801 * @developerPreview
802 * @publicApi
803 */
804export declare function withI18nSupport(): HydrationFeature<HydrationFeatureKind.I18nSupport>;
805
806/**
807 * Enables support for incremental hydration using the `hydrate` trigger syntax.
808 *
809 * @usageNotes
810 *
811 * Basic example of how you can enable incremental hydration in your application when
812 * the `bootstrapApplication` function is used:
813 * ```ts
814 * bootstrapApplication(AppComponent, {
815 * providers: [provideClientHydration(withIncrementalHydration())]
816 * });
817 * ```
818 * @experimental
819 * @publicApi
820 * @see {@link provideClientHydration}
821 */
822export declare function withIncrementalHydration(): HydrationFeature<HydrationFeatureKind.IncrementalHydration>;
823
824/**
825 * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
826 * server and other one on the browser.
827 *
828 * @publicApi
829 */
830export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
831
832/**
833 * A `DomAdapter` powered by full browser DOM APIs.
834 *
835 * @security Tread carefully! Interacting with the DOM directly is dangerous and
836 * can introduce XSS risks.
837 */
838export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
839 static makeCurrent(): void;
840 onAndCancel(el: Node, evt: any, listener: any, options: any): Function;
841 dispatchEvent(el: Node, evt: any): void;
842 remove(node: Node): void;
843 createElement(tagName: string, doc?: Document): HTMLElement;
844 createHtmlDocument(): Document;
845 getDefaultDocument(): Document;
846 isElementNode(node: Node): boolean;
847 isShadowRoot(node: any): boolean;
848 /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
849 getGlobalEventTarget(doc: Document, target: string): EventTarget | null;
850 getBaseHref(doc: Document): string | null;
851 resetBaseElement(): void;
852 getUserAgent(): string;
853 getCookie(name: string): string | null;
854}
855
856export declare class ɵBrowserGetTestability implements GetTestability {
857 addToWindow(registry: TestabilityRegistry): void;
858 findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
859}
860
861export declare class ɵDomEventsPlugin extends EventManagerPlugin {
862 constructor(doc: any);
863 supports(eventName: string): boolean;
864 addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
865 removeEventListener(target: any, eventName: string, callback: Function, options?: ListenerOptions): void;
866 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomEventsPlugin, never>;
867 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomEventsPlugin>;
868}
869
870export 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
896export 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
909export { ɵgetDOM }
910
911/**
912 * Event plugin that adds Hammer support to an application.
913 *
914 * @ngModule HammerModule
915 */
916export 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>;
927}
928
929export declare function ɵinitDomAdapter(): void;
930
931export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
932
933/**
934 * A browser plug-in that provides support for handling of key events in Angular.
935 */
936export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
937 /**
938 * Initializes an instance of the browser plug-in.
939 * @param doc The document in which key events will be detected.
940 */
941 constructor(doc: any);
942 /**
943 * Reports whether a named key event is supported.
944 * @param eventName The event name to query.
945 * @return True if the named key event is supported.
946 */
947 supports(eventName: string): boolean;
948 /**
949 * Registers a handler for a specific element and key event.
950 * @param element The HTML element to receive event notifications.
951 * @param eventName The name of the key event to listen for.
952 * @param handler A function to call when the notification occurs. Receives the
953 * event object as an argument.
954 * @returns The key event that was registered.
955 */
956 addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions): Function;
957 /**
958 * Parses the user provided full keyboard event definition and normalizes it for
959 * later internal use. It ensures the string is all lowercase, converts special
960 * characters to a standard spelling, and orders all the values consistently.
961 *
962 * @param eventName The name of the key event to listen for.
963 * @returns an object with the full, normalized string, and the dom event name
964 * or null in the case when the event doesn't match a keyboard event.
965 */
966 static parseEventName(eventName: string): {
967 fullKey: string;
968 domEventName: string;
969 } | null;
970 /**
971 * Determines whether the actual keys pressed match the configured key code string.
972 * The `fullKeyCode` event is normalized in the `parseEventName` method when the
973 * event is attached to the DOM during the `addEventListener` call. This is unseen
974 * by the end user and is normalized for internal consistency and parsing.
975 *
976 * @param event The keyboard event.
977 * @param fullKeyCode The normalized user defined expected key event string
978 * @returns boolean.
979 */
980 static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean;
981 /**
982 * Configures a handler callback for a key event.
983 * @param fullKey The event name that combines all simultaneous keystrokes.
984 * @param handler The function that responds to the key event.
985 * @param zone The zone in which the event occurred.
986 * @returns A callback function.
987 */
988 static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function;
989 static ɵfac: i0.ɵɵFactoryDeclaration<ɵKeyEventsPlugin, never>;
990 static ɵprov: i0.ɵɵInjectableDeclaration<ɵKeyEventsPlugin>;
991}
992
993
994/**
995 * The list of error codes used in runtime code of the `platform-browser` package.
996 * Reserved error code range: 5000-5500.
997 */
998export declare const enum ɵRuntimeErrorCode {
999 UNSUPPORTED_ZONEJS_INSTANCE = -5000,
1000 BROWSER_MODULE_ALREADY_LOADED = 5100,
1001 NO_PLUGIN_FOR_EVENT = 5101,
1002 UNSUPPORTED_EVENT_TARGET = 5102,
1003 TESTABILITY_NOT_FOUND = 5103,
1004 ROOT_NODE_NOT_FOUND = -5104,
1005 UNEXPECTED_SYNTHETIC_PROPERTY = 5105,
1006 SANITIZATION_UNSAFE_SCRIPT = 5200,
1007 SANITIZATION_UNSAFE_RESOURCE_URL = 5201,
1008 SANITIZATION_UNEXPECTED_CTX = 5202,
1009 ANIMATION_RENDERER_ASYNC_LOADING_FAILURE = 5300
1010}
1011
1012export 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}
1060
1061export { }
1062
\No newline at end of file