UNPKG

38.2 kBTypeScriptView Raw
1/**
2 * @license Angular v16.0.4
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 `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 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 `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 * By default, the function enables the recommended set of features for the optimal
623 * performance for most of the applications. You can enable/disable features by
624 * passing special functions (from the `HydrationFeatures` set) as arguments to the
625 * `provideClientHydration` function.
626 *
627 * @usageNotes
628 *
629 * Basic example of how you can enable hydration in your application when
630 * `bootstrapApplication` function is used:
631 * ```
632 * bootstrapApplication(AppComponent, {
633 * providers: [provideClientHydration()]
634 * });
635 * ```
636 *
637 * Alternatively if you are using NgModules, you would add `provideClientHydration`
638 * to your root app module's provider list.
639 * ```
640 * @NgModule({
641 * declarations: [RootCmp],
642 * bootstrap: [RootCmp],
643 * providers: [provideClientHydration()],
644 * })
645 * export class AppModule {}
646 * ```
647 *
648 * @see `withNoDomReuse`
649 * @see `withNoHttpTransferCache`
650 *
651 * @param features Optional features to configure additional router behaviors.
652 * @returns A set of providers to enable hydration.
653 *
654 * @publicApi
655 * @developerPreview
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](guide/glossary#di-token "DI token definition") that indicates whether styles
674 * of destroyed components should be removed from DOM.
675 *
676 * By default, the value is set to `false`. This will be changed in the next major version.
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 type-safe key to use with `TransferState`.
731 *
732 * Example:
733 *
734 * ```
735 * const COUNTER_KEY = makeStateKey<number>('counter');
736 * let value = 10;
737 *
738 * transferState.set(COUNTER_KEY, value);
739 * ```
740 * @publicApi
741 *
742 * @deprecated `StateKey` has moved, please import `StateKey` from `@angular/core` instead.
743 */
744export declare type StateKey<T> = StateKey_2<T>;
745
746/**
747 * A service that can be used to get and set the title of a current HTML document.
748 *
749 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
750 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
751 * (representing the `<title>` tag). Instead, this service can be used to set and get the current
752 * title value.
753 *
754 * @publicApi
755 */
756export declare class Title {
757 private _doc;
758 constructor(_doc: any);
759 /**
760 * Get the title of the current HTML document.
761 */
762 getTitle(): string;
763 /**
764 * Set the title of the current HTML document.
765 * @param newTitle
766 */
767 setTitle(newTitle: string): void;
768 static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>;
769 static ɵprov: i0.ɵɵInjectableDeclaration<Title>;
770}
771
772/**
773 *
774 * A key value store that is transferred from the application on the server side to the application
775 * on the client side.
776 *
777 * The `TransferState` is available as an injectable token.
778 * On the client, just inject this token using DI and use it, it will be lazily initialized.
779 * On the server it's already included if `renderApplication` function is used. Otherwise, import
780 * the `ServerTransferStateModule` module to make the `TransferState` available.
781 *
782 * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
783 * boolean, number, string, null and non-class objects will be serialized and deserialized in a
784 * non-lossy manner.
785 *
786 * @publicApi
787 *
788 * @deprecated `TransferState` has moved, please import `TransferState` from `@angular/core`
789 * instead.
790 */
791export declare type TransferState = TransferState_2;
792
793export declare const TransferState: {
794 new (): TransferState_2;
795};
796
797/**
798 * @publicApi
799 */
800export declare const VERSION: Version;
801
802/**
803 * Disables DOM nodes reuse during hydration. Effectively makes
804 * Angular re-render an application from scratch on the client.
805 *
806 * When this option is enabled, make sure that the initial navigation
807 * option is configured for the Router as `enabledBlocking` by using the
808 * `withEnabledBlockingInitialNavigation` in the `provideRouter` call:
809 *
810 * ```
811 * bootstrapApplication(RootComponent, {
812 * providers: [
813 * provideRouter(
814 * // ... other features ...
815 * withEnabledBlockingInitialNavigation()
816 * ),
817 * provideClientHydration(withNoDomReuse())
818 * ]
819 * });
820 * ```
821 *
822 * This would ensure that the application is rerendered after all async
823 * operations in the Router (such as lazy-loading of components,
824 * waiting for async guards and resolvers) are completed to avoid
825 * clearing the DOM on the client too soon, thus causing content flicker.
826 *
827 * @see `provideRouter`
828 * @see `withEnabledBlockingInitialNavigation`
829 *
830 * @publicApi
831 * @developerPreview
832 */
833export declare function withNoDomReuse(): HydrationFeature<HydrationFeatureKind.NoDomReuseFeature>;
834
835/**
836 * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
837 * server and other one on the browser.
838 *
839 * @publicApi
840 * @developerPreview
841 */
842export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
843
844/**
845 * A `DomAdapter` powered by full browser DOM APIs.
846 *
847 * @security Tread carefully! Interacting with the DOM directly is dangerous and
848 * can introduce XSS risks.
849 */
850export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
851 static makeCurrent(): void;
852 onAndCancel(el: Node, evt: any, listener: any): Function;
853 dispatchEvent(el: Node, evt: any): void;
854 remove(node: Node): void;
855 createElement(tagName: string, doc?: Document): HTMLElement;
856 createHtmlDocument(): Document;
857 getDefaultDocument(): Document;
858 isElementNode(node: Node): boolean;
859 isShadowRoot(node: any): boolean;
860 /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
861 getGlobalEventTarget(doc: Document, target: string): EventTarget | null;
862 getBaseHref(doc: Document): string | null;
863 resetBaseElement(): void;
864 getUserAgent(): string;
865 getCookie(name: string): string | null;
866}
867
868export declare class ɵBrowserGetTestability implements GetTestability {
869 addToWindow(registry: TestabilityRegistry): void;
870 findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
871}
872
873export declare class ɵDomEventsPlugin extends EventManagerPlugin {
874 constructor(doc: any);
875 supports(eventName: string): boolean;
876 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
877 removeEventListener(target: any, eventName: string, callback: Function): void;
878 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomEventsPlugin, never>;
879 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomEventsPlugin>;
880}
881
882export declare class ɵDomRendererFactory2 implements RendererFactory2, OnDestroy {
883 private readonly eventManager;
884 private readonly sharedStylesHost;
885 private readonly appId;
886 private removeStylesOnCompDestory;
887 private readonly doc;
888 readonly platformId: Object;
889 readonly ngZone: NgZone;
890 private readonly nonce;
891 private readonly rendererByCompId;
892 private readonly defaultRenderer;
893 private readonly platformIsServer;
894 constructor(eventManager: EventManager, sharedStylesHost: ɵSharedStylesHost, appId: string, removeStylesOnCompDestory: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null);
895 createRenderer(element: any, type: RendererType2 | null): Renderer2;
896 private getOrCreateRenderer;
897 ngOnDestroy(): void;
898 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, never>;
899 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>;
900}
901
902export declare class ɵDomSanitizerImpl extends DomSanitizer {
903 private _doc;
904 constructor(_doc: any);
905 sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
906 bypassSecurityTrustHtml(value: string): SafeHtml;
907 bypassSecurityTrustStyle(value: string): SafeStyle;
908 bypassSecurityTrustScript(value: string): SafeScript;
909 bypassSecurityTrustUrl(value: string): SafeUrl;
910 bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
911 static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSanitizerImpl, never>;
912 static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSanitizerImpl>;
913}
914
915export { ɵgetDOM }
916
917/**
918 * Event plugin that adds Hammer support to an application.
919 *
920 * @ngModule HammerModule
921 */
922export declare class ɵHammerGesturesPlugin extends EventManagerPlugin {
923 private _config;
924 private console;
925 private loader?;
926 private _loaderPromise;
927 constructor(doc: any, _config: HammerGestureConfig, console: ɵConsole, loader?: HammerLoader | null | undefined);
928 supports(eventName: string): boolean;
929 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
930 isCustomEvent(eventName: string): boolean;
931 static ɵfac: i0.ɵɵFactoryDeclaration<ɵHammerGesturesPlugin, [null, null, null, { optional: true; }]>;
932 static ɵprov: i0.ɵɵInjectableDeclaration<ɵHammerGesturesPlugin>;
933}
934
935export declare function ɵinitDomAdapter(): void;
936
937export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
938
939/**
940 * @publicApi
941 * A browser plug-in that provides support for handling of key events in Angular.
942 */
943export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
944 /**
945 * Initializes an instance of the browser plug-in.
946 * @param doc The document in which key events will be detected.
947 */
948 constructor(doc: any);
949 /**
950 * Reports whether a named key event is supported.
951 * @param eventName The event name to query.
952 * @return True if the named key event is supported.
953 */
954 supports(eventName: string): boolean;
955 /**
956 * Registers a handler for a specific element and key event.
957 * @param element The HTML element to receive event notifications.
958 * @param eventName The name of the key event to listen for.
959 * @param handler A function to call when the notification occurs. Receives the
960 * event object as an argument.
961 * @returns The key event that was registered.
962 */
963 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
964 /**
965 * Parses the user provided full keyboard event definition and normalizes it for
966 * later internal use. It ensures the string is all lowercase, converts special
967 * characters to a standard spelling, and orders all the values consistently.
968 *
969 * @param eventName The name of the key event to listen for.
970 * @returns an object with the full, normalized string, and the dom event name
971 * or null in the case when the event doesn't match a keyboard event.
972 */
973 static parseEventName(eventName: string): {
974 fullKey: string;
975 domEventName: string;
976 } | null;
977 /**
978 * Determines whether the actual keys pressed match the configured key code string.
979 * The `fullKeyCode` event is normalized in the `parseEventName` method when the
980 * event is attached to the DOM during the `addEventListener` call. This is unseen
981 * by the end user and is normalized for internal consistency and parsing.
982 *
983 * @param event The keyboard event.
984 * @param fullKeyCode The normalized user defined expected key event string
985 * @returns boolean.
986 */
987 static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean;
988 /**
989 * Configures a handler callback for a key event.
990 * @param fullKey The event name that combines all simultaneous keystrokes.
991 * @param handler The function that responds to the key event.
992 * @param zone The zone in which the event occurred.
993 * @returns A callback function.
994 */
995 static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function;
996 static ɵfac: i0.ɵɵFactoryDeclaration<ɵKeyEventsPlugin, never>;
997 static ɵprov: i0.ɵɵInjectableDeclaration<ɵKeyEventsPlugin>;
998}
999
1000export declare class ɵSharedStylesHost implements OnDestroy {
1001 private readonly doc;
1002 private readonly appId;
1003 private nonce?;
1004 readonly platformId: object;
1005 private readonly styleRef;
1006 private readonly hostNodes;
1007 private readonly styleNodesInDOM;
1008 private readonly platformIsServer;
1009 constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
1010 addStyles(styles: string[]): void;
1011 removeStyles(styles: string[]): void;
1012 ngOnDestroy(): void;
1013 addHost(hostNode: Node): void;
1014 removeHost(hostNode: Node): void;
1015 private getAllStyles;
1016 private onStyleAdded;
1017 private onStyleRemoved;
1018 private collectServerRenderedStyles;
1019 private changeUsageCount;
1020 private getStyleElement;
1021 private addStyleToHost;
1022 private resetHostNodes;
1023 static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>;
1024 static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>;
1025}
1026
1027export { }
1028
\No newline at end of file