UNPKG

40 kBTypeScriptView Raw
1/**
2 * @license Angular v8.2.4
3 * (c) 2010-2019 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7import { ComponentRef } from '@angular/core';
8import { DebugElement } from '@angular/core';
9import { DebugNode } from '@angular/core';
10import { ErrorHandler } from '@angular/core';
11import { GetTestability } from '@angular/core';
12import { InjectionToken } from '@angular/core';
13import { Injector } from '@angular/core';
14import { LocationChangeListener } from '@angular/common';
15import { ModuleWithProviders } from '@angular/core';
16import { NgProbeToken } from '@angular/core';
17import { NgZone } from '@angular/core';
18import { OnDestroy } from '@angular/core';
19import { PlatformLocation } from '@angular/common';
20import { PlatformRef } from '@angular/core';
21import { Predicate } from '@angular/core';
22import { Provider } from '@angular/core';
23import { Renderer2 } from '@angular/core';
24import { RendererFactory2 } from '@angular/core';
25import { RendererType2 } from '@angular/core';
26import { Sanitizer } from '@angular/core';
27import { SecurityContext } from '@angular/core';
28import { StaticProvider } from '@angular/core';
29import { Testability } from '@angular/core';
30import { TestabilityRegistry } from '@angular/core';
31import { Type } from '@angular/core';
32import { Version } from '@angular/core';
33import { ɵConsole } from '@angular/core';
34
35/**
36 * Exports required infrastructure for all Angular apps.
37 * Included by default in all Angular apps created with the CLI
38 * `new` command.
39 * Re-exports `CommonModule` and `ApplicationModule`, making their
40 * exports and providers available to all apps.
41 *
42 * @publicApi
43 */
44export declare class BrowserModule {
45 constructor(parentModule: BrowserModule | null);
46 /**
47 * Configures a browser-based app to transition from a server-rendered app, if
48 * one is present on the page.
49 *
50 * @param params An object containing an identifier for the app to transition.
51 * The ID must match between the client and server versions of the app.
52 * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
53 */
54 static withServerTransition(params: {
55 appId: string;
56 }): ModuleWithProviders<BrowserModule>;
57}
58
59/**
60 * NgModule to install on the client side while using the `TransferState` to transfer state from
61 * server to client.
62 *
63 * @publicApi
64 */
65export declare class BrowserTransferStateModule {
66}
67
68/**
69 * Predicates for use with {@link DebugElement}'s query functions.
70 *
71 * @publicApi
72 */
73export declare class By {
74 /**
75 * Match all nodes.
76 *
77 * @usageNotes
78 * ### Example
79 *
80 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
81 */
82 static all(): Predicate<DebugNode>;
83 /**
84 * Match elements by the given CSS selector.
85 *
86 * @usageNotes
87 * ### Example
88 *
89 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
90 */
91 static css(selector: string): Predicate<DebugElement>;
92 /**
93 * Match nodes that have the given directive present.
94 *
95 * @usageNotes
96 * ### Example
97 *
98 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
99 */
100 static directive(type: Type<any>): Predicate<DebugNode>;
101}
102
103/**
104 * Disables Angular tools.
105 *
106 * @publicApi
107 */
108export declare function disableDebugTools(): void;
109
110/**
111 * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
112 * values to be safe to use in the different DOM contexts.
113 *
114 * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
115 * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
116 * the website.
117 *
118 * In specific situations, it might be necessary to disable sanitization, for example if the
119 * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
120 * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
121 * methods, and then binding to that value from the template.
122 *
123 * These situations should be very rare, and extraordinary care must be taken to avoid creating a
124 * Cross Site Scripting (XSS) security bug!
125 *
126 * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
127 * close as possible to the source of the value, to make it easy to verify no security bug is
128 * created by its use.
129 *
130 * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
131 * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
132 * code. The sanitizer leaves safe values intact.
133 *
134 * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
135 * sanitization for the value passed in. Carefully check and audit all values and code paths going
136 * into this call. Make sure any user data is appropriately escaped for this security context.
137 * For more detail, see the [Security Guide](http://g.co/ng/security).
138 *
139 * @publicApi
140 */
141export declare abstract class DomSanitizer implements Sanitizer {
142 /**
143 * Sanitizes a value for use in the given SecurityContext.
144 *
145 * If value is trusted for the context, this method will unwrap the contained safe value and use
146 * it directly. Otherwise, value will be sanitized to be safe in the given context, for example
147 * by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation
148 * is responsible to make sure that the value can definitely be safely used in the given context.
149 */
150 abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null;
151 /**
152 * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML
153 * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will
154 * leave safe HTML intact, so in most situations this method should not be used.
155 *
156 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
157 * security risks!
158 */
159 abstract bypassSecurityTrustHtml(value: string): SafeHtml;
160 /**
161 * Bypass security and trust the given value to be safe style value (CSS).
162 *
163 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
164 * security risks!
165 */
166 abstract bypassSecurityTrustStyle(value: string): SafeStyle;
167 /**
168 * Bypass security and trust the given value to be safe JavaScript.
169 *
170 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
171 * security risks!
172 */
173 abstract bypassSecurityTrustScript(value: string): SafeScript;
174 /**
175 * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used
176 * in hyperlinks or `<img src>`.
177 *
178 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
179 * security risks!
180 */
181 abstract bypassSecurityTrustUrl(value: string): SafeUrl;
182 /**
183 * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may
184 * be used to load executable code from, like `<script src>`, or `<iframe src>`.
185 *
186 * **WARNING:** calling this method with untrusted user data exposes your application to XSS
187 * security risks!
188 */
189 abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
190}
191
192/**
193 * Enabled Angular debug tools that are accessible via your browser's
194 * developer console.
195 *
196 * Usage:
197 *
198 * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
199 * 1. Type `ng.` (usually the console will show auto-complete suggestion)
200 * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
201 * then hit Enter.
202 *
203 * @publicApi
204 */
205export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
206
207/**
208 * The injection token for the event-manager plug-in service.
209 *
210 * @publicApi
211 */
212export declare const EVENT_MANAGER_PLUGINS: InjectionToken<ɵangular_packages_platform_browser_platform_browser_g[]>;
213
214/**
215 * An injectable service that provides event management for Angular
216 * through a browser plug-in.
217 *
218 * @publicApi
219 */
220export declare class EventManager {
221 private _zone;
222 private _plugins;
223 private _eventNameToPlugin;
224 /**
225 * Initializes an instance of the event-manager service.
226 */
227 constructor(plugins: ɵangular_packages_platform_browser_platform_browser_g[], _zone: NgZone);
228 /**
229 * Registers a handler for a specific element and event.
230 *
231 * @param element The HTML element to receive event notifications.
232 * @param eventName The name of the event to listen for.
233 * @param handler A function to call when the notification occurs. Receives the
234 * event object as an argument.
235 * @returns A callback function that can be used to remove the handler.
236 */
237 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
238 /**
239 * Registers a global handler for an event in a target view.
240 *
241 * @param target A target for global event notifications. One of "window", "document", or "body".
242 * @param eventName The name of the event to listen for.
243 * @param handler A function to call when the notification occurs. Receives the
244 * event object as an argument.
245 * @returns A callback function that can be used to remove the handler.
246 */
247 addGlobalEventListener(target: string, eventName: string, handler: Function): Function;
248 /**
249 * Retrieves the compilation zone in which event listeners are registered.
250 */
251 getZone(): NgZone;
252}
253
254/**
255 * DI token for providing [HammerJS](http://hammerjs.github.io/) support to Angular.
256 * @see `HammerGestureConfig`
257 *
258 * @publicApi
259 */
260export declare const HAMMER_GESTURE_CONFIG: InjectionToken<HammerGestureConfig>;
261
262/**
263 * Injection token used to provide a {@link HammerLoader} to Angular.
264 *
265 * @publicApi
266 */
267export declare const HAMMER_LOADER: InjectionToken<HammerLoader>;
268
269/**
270 * An injectable [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
271 * for gesture recognition. Configures specific event recognition.
272 * @publicApi
273 */
274export declare class HammerGestureConfig {
275 /**
276 * A set of supported event names for gestures to be used in Angular.
277 * Angular supports all built-in recognizers, as listed in
278 * [HammerJS documentation](http://hammerjs.github.io/).
279 */
280 events: string[];
281 /**
282 * Maps gesture event names to a set of configuration options
283 * that specify overrides to the default values for specific properties.
284 *
285 * The key is a supported event name to be configured,
286 * and the options object contains a set of properties, with override values
287 * to be applied to the named recognizer event.
288 * For example, to disable recognition of the rotate event, specify
289 * `{"rotate": {"enable": false}}`.
290 *
291 * Properties that are not present take the HammerJS default values.
292 * For information about which properties are supported for which events,
293 * and their allowed and default values, see
294 * [HammerJS documentation](http://hammerjs.github.io/).
295 *
296 */
297 overrides: {
298 [key: string]: Object;
299 };
300 /**
301 * Properties whose default values can be overridden for a given event.
302 * Different sets of properties apply to different events.
303 * For information about which properties are supported for which events,
304 * and their allowed and default values, see
305 * [HammerJS documentation](http://hammerjs.github.io/).
306 */
307 options?: {
308 cssProps?: any;
309 domEvents?: boolean;
310 enable?: boolean | ((manager: any) => boolean);
311 preset?: any[];
312 touchAction?: string;
313 recognizers?: any[];
314 inputClass?: any;
315 inputTarget?: EventTarget;
316 };
317 /**
318 * Creates a [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
319 * and attaches it to a given HTML element.
320 * @param element The element that will recognize gestures.
321 * @returns A HammerJS event-manager object.
322 */
323 buildHammer(element: HTMLElement): HammerInstance;
324}
325
326declare interface HammerInstance {
327 on(eventName: string, callback?: Function): void;
328 off(eventName: string, callback?: Function): void;
329 destroy?(): void;
330}
331
332/**
333 * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.
334 *
335 * @publicApi
336 */
337export declare type HammerLoader = () => Promise<void>;
338
339/**
340 * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
341 *
342 * Example:
343 *
344 * ```
345 * const COUNTER_KEY = makeStateKey<number>('counter');
346 * let value = 10;
347 *
348 * transferState.set(COUNTER_KEY, value);
349 * ```
350 *
351 * @publicApi
352 */
353export declare function makeStateKey<T = void>(key: string): StateKey<T>;
354
355/**
356 * A service that can be used to get and add meta tags.
357 *
358 * @publicApi
359 */
360export declare class Meta {
361 private _doc;
362 private _dom;
363 constructor(_doc: any);
364 addTag(tag: MetaDefinition, forceCreation?: boolean): HTMLMetaElement | null;
365 addTags(tags: MetaDefinition[], forceCreation?: boolean): HTMLMetaElement[];
366 getTag(attrSelector: string): HTMLMetaElement | null;
367 getTags(attrSelector: string): HTMLMetaElement[];
368 updateTag(tag: MetaDefinition, selector?: string): HTMLMetaElement | null;
369 removeTag(attrSelector: string): void;
370 removeTagElement(meta: HTMLMetaElement): void;
371 private _getOrCreateElement;
372 private _setMetaElementAttributes;
373 private _parseSelector;
374 private _containsAttributes;
375}
376
377
378/**
379 * Represents a meta element.
380 *
381 * @publicApi
382 */
383export declare type MetaDefinition = {
384 charset?: string;
385 content?: string;
386 httpEquiv?: string;
387 id?: string;
388 itemprop?: string;
389 name?: string;
390 property?: string;
391 scheme?: string;
392 url?: string;
393} & {
394 [prop: string]: string;
395};
396
397/**
398 * @publicApi
399 */
400export declare const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef;
401
402/**
403 * Marker interface for a value that's safe to use as HTML.
404 *
405 * @publicApi
406 */
407export declare interface SafeHtml extends SafeValue {
408}
409
410/**
411 * Marker interface for a value that's safe to use as a URL to load executable code from.
412 *
413 * @publicApi
414 */
415export declare interface SafeResourceUrl extends SafeValue {
416}
417
418/**
419 * Marker interface for a value that's safe to use as JavaScript.
420 *
421 * @publicApi
422 */
423export declare interface SafeScript extends SafeValue {
424}
425
426/**
427 * Marker interface for a value that's safe to use as style (CSS).
428 *
429 * @publicApi
430 */
431export declare interface SafeStyle extends SafeValue {
432}
433
434/**
435 * Marker interface for a value that's safe to use as a URL linking to a document.
436 *
437 * @publicApi
438 */
439export declare interface SafeUrl extends SafeValue {
440}
441
442/**
443 * Marker interface for a value that's safe to use in a particular context.
444 *
445 * @publicApi
446 */
447export declare interface SafeValue {
448}
449
450/**
451 * A type-safe key to use with `TransferState`.
452 *
453 * Example:
454 *
455 * ```
456 * const COUNTER_KEY = makeStateKey<number>('counter');
457 * let value = 10;
458 *
459 * transferState.set(COUNTER_KEY, value);
460 * ```
461 *
462 * @publicApi
463 */
464export declare type StateKey<T> = string & {
465 __not_a_string: never;
466};
467
468/**
469 * A service that can be used to get and set the title of a current HTML document.
470 *
471 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
472 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
473 * (representing the `<title>` tag). Instead, this service can be used to set and get the current
474 * title value.
475 *
476 * @publicApi
477 */
478export declare class Title {
479 private _doc;
480 constructor(_doc: any);
481 /**
482 * Get the title of the current HTML document.
483 */
484 getTitle(): string;
485 /**
486 * Set the title of the current HTML document.
487 * @param newTitle
488 */
489 setTitle(newTitle: string): void;
490}
491
492/**
493 * A key value store that is transferred from the application on the server side to the application
494 * on the client side.
495 *
496 * `TransferState` will be available as an injectable token. To use it import
497 * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
498 *
499 * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
500 * boolean, number, string, null and non-class objects will be serialized and deserialzied in a
501 * non-lossy manner.
502 *
503 * @publicApi
504 */
505export declare class TransferState {
506 private store;
507 private onSerializeCallbacks;
508 /**
509 * Get the value corresponding to a key. Return `defaultValue` if key is not found.
510 */
511 get<T>(key: StateKey<T>, defaultValue: T): T;
512 /**
513 * Set the value corresponding to a key.
514 */
515 set<T>(key: StateKey<T>, value: T): void;
516 /**
517 * Remove a key from the store.
518 */
519 remove<T>(key: StateKey<T>): void;
520 /**
521 * Test whether a key exists in the store.
522 */
523 hasKey<T>(key: StateKey<T>): boolean;
524 /**
525 * Register a callback to provide the value for a key when `toJson` is called.
526 */
527 onSerialize<T>(key: StateKey<T>, callback: () => T): void;
528 /**
529 * Serialize the current state of the store to JSON.
530 */
531 toJson(): string;
532}
533
534/**
535 * @publicApi
536 */
537export declare const VERSION: Version;
538
539export declare function ɵangular_packages_platform_browser_platform_browser_a(): ErrorHandler;
540
541export declare function ɵangular_packages_platform_browser_platform_browser_b(): any;
542
543export declare const ɵangular_packages_platform_browser_platform_browser_c: StaticProvider[];
544
545/**
546 * Factory to create Meta service.
547 */
548export declare function ɵangular_packages_platform_browser_platform_browser_d(): Meta;
549
550
551/**
552 * Factory to create Title service.
553 */
554export declare function ɵangular_packages_platform_browser_platform_browser_e(): Title;
555
556export declare function ɵangular_packages_platform_browser_platform_browser_f(doc: Document, appId: string): TransferState;
557
558export declare abstract class ɵangular_packages_platform_browser_platform_browser_g {
559 private _doc;
560 constructor(_doc: any);
561 manager: EventManager;
562 abstract supports(eventName: string): boolean;
563 abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
564 addGlobalEventListener(element: string, eventName: string, handler: Function): Function;
565}
566
567export declare function ɵangular_packages_platform_browser_platform_browser_h(transitionId: string, document: any, injector: Injector): () => void;
568
569export declare const ɵangular_packages_platform_browser_platform_browser_i: StaticProvider[];
570
571export declare function ɵangular_packages_platform_browser_platform_browser_j(coreTokens: NgProbeToken[]): any;
572
573/**
574 * Providers which support debugging Angular applications (e.g. via `ng.probe`).
575 */
576export declare const ɵangular_packages_platform_browser_platform_browser_k: Provider[];
577
578/**
579 * Provides DOM operations in any browser environment.
580 *
581 * @security Tread carefully! Interacting with the DOM directly is dangerous and
582 * can introduce XSS risks.
583 */
584export declare abstract class ɵangular_packages_platform_browser_platform_browser_l extends ɵDomAdapter {
585 private _animationPrefix;
586 private _transitionEnd;
587 constructor();
588 getDistributedNodes(el: HTMLElement): Node[];
589 resolveAndSetHref(el: HTMLAnchorElement, baseUrl: string, href: string): void;
590 supportsDOMEvents(): boolean;
591 supportsNativeShadowDOM(): boolean;
592 getAnimationPrefix(): string;
593 getTransitionEnd(): string;
594 supportsAnimation(): boolean;
595}
596
597/**
598 * @security Replacing built-in sanitization providers exposes the application to XSS risks.
599 * Attacker-controlled data introduced by an unsanitized provider could expose your
600 * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
601 * @publicApi
602 */
603export declare const ɵBROWSER_SANITIZATION_PROVIDERS: StaticProvider[];
604
605/**
606 * A `DomAdapter` powered by full browser DOM APIs.
607 *
608 * @security Tread carefully! Interacting with the DOM directly is dangerous and
609 * can introduce XSS risks.
610 */
611export declare class ɵBrowserDomAdapter extends ɵangular_packages_platform_browser_platform_browser_l {
612 parse(templateHtml: string): void;
613 static makeCurrent(): void;
614 hasProperty(element: Node, name: string): boolean;
615 setProperty(el: Node, name: string, value: any): void;
616 getProperty(el: Node, name: string): any;
617 invoke(el: Node, methodName: string, args: any[]): any;
618 logError(error: string): void;
619 log(error: string): void;
620 logGroup(error: string): void;
621 logGroupEnd(): void;
622 readonly attrToPropMap: any;
623 contains(nodeA: any, nodeB: any): boolean;
624 querySelector(el: HTMLElement, selector: string): any;
625 querySelectorAll(el: any, selector: string): any[];
626 on(el: Node, evt: any, listener: any): void;
627 onAndCancel(el: Node, evt: any, listener: any): Function;
628 dispatchEvent(el: Node, evt: any): void;
629 createMouseEvent(eventType: string): MouseEvent;
630 createEvent(eventType: any): Event;
631 preventDefault(evt: Event): void;
632 isPrevented(evt: Event): boolean;
633 getInnerHTML(el: HTMLElement): string;
634 getTemplateContent(el: Node): Node | null;
635 getOuterHTML(el: HTMLElement): string;
636 nodeName(node: Node): string;
637 nodeValue(node: Node): string | null;
638 type(node: HTMLInputElement): string;
639 content(node: Node): Node;
640 firstChild(el: Node): Node | null;
641 nextSibling(el: Node): Node | null;
642 parentElement(el: Node): Node | null;
643 childNodes(el: any): Node[];
644 childNodesAsList(el: Node): any[];
645 clearNodes(el: Node): void;
646 appendChild(el: Node, node: Node): void;
647 removeChild(el: Node, node: Node): void;
648 replaceChild(el: Node, newChild: Node, oldChild: Node): void;
649 remove(node: Node): Node;
650 insertBefore(parent: Node, ref: Node, node: Node): void;
651 insertAllBefore(parent: Node, ref: Node, nodes: Node[]): void;
652 insertAfter(parent: Node, ref: Node, node: any): void;
653 setInnerHTML(el: Element, value: string): void;
654 getText(el: Node): string | null;
655 setText(el: Node, value: string): void;
656 getValue(el: any): string;
657 setValue(el: any, value: string): void;
658 getChecked(el: any): boolean;
659 setChecked(el: any, value: boolean): void;
660 createComment(text: string): Comment;
661 createTemplate(html: any): HTMLElement;
662 createElement(tagName: string, doc?: Document): HTMLElement;
663 createElementNS(ns: string, tagName: string, doc?: Document): Element;
664 createTextNode(text: string, doc?: Document): Text;
665 createScriptTag(attrName: string, attrValue: string, doc?: Document): HTMLScriptElement;
666 createStyleElement(css: string, doc?: Document): HTMLStyleElement;
667 createShadowRoot(el: HTMLElement): DocumentFragment;
668 getShadowRoot(el: HTMLElement): DocumentFragment;
669 getHost(el: HTMLElement): HTMLElement;
670 clone(node: Node): Node;
671 getElementsByClassName(element: any, name: string): HTMLElement[];
672 getElementsByTagName(element: any, name: string): HTMLElement[];
673 classList(element: any): any[];
674 addClass(element: any, className: string): void;
675 removeClass(element: any, className: string): void;
676 hasClass(element: any, className: string): boolean;
677 setStyle(element: any, styleName: string, styleValue: string): void;
678 removeStyle(element: any, stylename: string): void;
679 getStyle(element: any, stylename: string): string;
680 hasStyle(element: any, styleName: string, styleValue?: string | null): boolean;
681 tagName(element: any): string;
682 attributeMap(element: any): Map<string, string>;
683 hasAttribute(element: Element, attribute: string): boolean;
684 hasAttributeNS(element: Element, ns: string, attribute: string): boolean;
685 getAttribute(element: Element, attribute: string): string | null;
686 getAttributeNS(element: Element, ns: string, name: string): string | null;
687 setAttribute(element: Element, name: string, value: string): void;
688 setAttributeNS(element: Element, ns: string, name: string, value: string): void;
689 removeAttribute(element: Element, attribute: string): void;
690 removeAttributeNS(element: Element, ns: string, name: string): void;
691 templateAwareRoot(el: Node): any;
692 createHtmlDocument(): HTMLDocument;
693 getDefaultDocument(): Document;
694 getBoundingClientRect(el: Element): any;
695 getTitle(doc: Document): string;
696 setTitle(doc: Document, newTitle: string): void;
697 elementMatches(n: any, selector: string): boolean;
698 isTemplateElement(el: Node): boolean;
699 isTextNode(node: Node): boolean;
700 isCommentNode(node: Node): boolean;
701 isElementNode(node: Node): boolean;
702 hasShadowRoot(node: any): boolean;
703 isShadowRoot(node: any): boolean;
704 importIntoDoc(node: Node): any;
705 adoptNode(node: Node): any;
706 getHref(el: Element): string;
707 getEventKey(event: any): string;
708 getGlobalEventTarget(doc: Document, target: string): EventTarget | null;
709 getHistory(): History;
710 getLocation(): Location;
711 getBaseHref(doc: Document): string | null;
712 resetBaseElement(): void;
713 getUserAgent(): string;
714 setData(element: Element, name: string, value: string): void;
715 getData(element: Element, name: string): string | null;
716 getComputedStyle(element: any): any;
717 supportsWebAnimation(): boolean;
718 performanceNow(): number;
719 supportsCookies(): boolean;
720 getCookie(name: string): string | null;
721 setCookie(name: string, value: string): void;
722}
723
724export declare class ɵBrowserGetTestability implements GetTestability {
725 static init(): void;
726 addToWindow(registry: TestabilityRegistry): void;
727 findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
728}
729
730/**
731 * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
732 * This class should not be used directly by an application developer. Instead, use
733 * {@link Location}.
734 */
735export declare class ɵBrowserPlatformLocation extends PlatformLocation {
736 private _doc;
737 readonly location: Location;
738 private _history;
739 constructor(_doc: any);
740 getBaseHrefFromDOM(): string;
741 onPopState(fn: LocationChangeListener): void;
742 onHashChange(fn: LocationChangeListener): void;
743 readonly href: string;
744 readonly protocol: string;
745 readonly hostname: string;
746 readonly port: string;
747 pathname: string;
748 readonly search: string;
749 readonly hash: string;
750 pushState(state: any, title: string, url: string): void;
751 replaceState(state: any, title: string, url: string): void;
752 forward(): void;
753 back(): void;
754 getState(): unknown;
755}
756
757/**
758 * Provides DOM operations in an environment-agnostic way.
759 *
760 * @security Tread carefully! Interacting with the DOM directly is dangerous and
761 * can introduce XSS risks.
762 */
763export declare abstract class ɵDomAdapter {
764 resourceLoaderType: Type<any>;
765 abstract hasProperty(element: any, name: string): boolean;
766 abstract setProperty(el: Element, name: string, value: any): any;
767 abstract getProperty(el: Element, name: string): any;
768 abstract invoke(el: Element, methodName: string, args: any[]): any;
769 abstract logError(error: any): any;
770 abstract log(error: any): any;
771 abstract logGroup(error: any): any;
772 abstract logGroupEnd(): any;
773 /**
774 * Maps attribute names to their corresponding property names for cases
775 * where attribute name doesn't match property name.
776 */
777 attrToPropMap: {
778 [key: string]: string;
779 };
780 abstract contains(nodeA: any, nodeB: any): boolean;
781 abstract parse(templateHtml: string): any;
782 abstract querySelector(el: any, selector: string): any;
783 abstract querySelectorAll(el: any, selector: string): any[];
784 abstract on(el: any, evt: any, listener: any): any;
785 abstract onAndCancel(el: any, evt: any, listener: any): Function;
786 abstract dispatchEvent(el: any, evt: any): any;
787 abstract createMouseEvent(eventType: any): any;
788 abstract createEvent(eventType: string): any;
789 abstract preventDefault(evt: any): any;
790 abstract isPrevented(evt: any): boolean;
791 abstract getInnerHTML(el: any): string;
792 /** Returns content if el is a <template> element, null otherwise. */
793 abstract getTemplateContent(el: any): any;
794 abstract getOuterHTML(el: any): string;
795 abstract nodeName(node: any): string;
796 abstract nodeValue(node: any): string | null;
797 abstract type(node: any): string;
798 abstract content(node: any): any;
799 abstract firstChild(el: any): Node | null;
800 abstract nextSibling(el: any): Node | null;
801 abstract parentElement(el: any): Node | null;
802 abstract childNodes(el: any): Node[];
803 abstract childNodesAsList(el: any): Node[];
804 abstract clearNodes(el: any): any;
805 abstract appendChild(el: any, node: any): any;
806 abstract removeChild(el: any, node: any): any;
807 abstract replaceChild(el: any, newNode: any, oldNode: any): any;
808 abstract remove(el: any): Node;
809 abstract insertBefore(parent: any, ref: any, node: any): any;
810 abstract insertAllBefore(parent: any, ref: any, nodes: any): any;
811 abstract insertAfter(parent: any, el: any, node: any): any;
812 abstract setInnerHTML(el: any, value: any): any;
813 abstract getText(el: any): string | null;
814 abstract setText(el: any, value: string): any;
815 abstract getValue(el: any): string;
816 abstract setValue(el: any, value: string): any;
817 abstract getChecked(el: any): boolean;
818 abstract setChecked(el: any, value: boolean): any;
819 abstract createComment(text: string): any;
820 abstract createTemplate(html: any): HTMLElement;
821 abstract createElement(tagName: any, doc?: any): HTMLElement;
822 abstract createElementNS(ns: string, tagName: string, doc?: any): Element;
823 abstract createTextNode(text: string, doc?: any): Text;
824 abstract createScriptTag(attrName: string, attrValue: string, doc?: any): HTMLElement;
825 abstract createStyleElement(css: string, doc?: any): HTMLStyleElement;
826 abstract createShadowRoot(el: any): any;
827 abstract getShadowRoot(el: any): any;
828 abstract getHost(el: any): any;
829 abstract getDistributedNodes(el: any): Node[];
830 abstract clone(node: Node): Node;
831 abstract getElementsByClassName(element: any, name: string): HTMLElement[];
832 abstract getElementsByTagName(element: any, name: string): HTMLElement[];
833 abstract classList(element: any): any[];
834 abstract addClass(element: any, className: string): any;
835 abstract removeClass(element: any, className: string): any;
836 abstract hasClass(element: any, className: string): boolean;
837 abstract setStyle(element: any, styleName: string, styleValue: string): any;
838 abstract removeStyle(element: any, styleName: string): any;
839 abstract getStyle(element: any, styleName: string): string;
840 abstract hasStyle(element: any, styleName: string, styleValue?: string): boolean;
841 abstract tagName(element: any): string;
842 abstract attributeMap(element: any): Map<string, string>;
843 abstract hasAttribute(element: any, attribute: string): boolean;
844 abstract hasAttributeNS(element: any, ns: string, attribute: string): boolean;
845 abstract getAttribute(element: any, attribute: string): string | null;
846 abstract getAttributeNS(element: any, ns: string, attribute: string): string | null;
847 abstract setAttribute(element: any, name: string, value: string): any;
848 abstract setAttributeNS(element: any, ns: string, name: string, value: string): any;
849 abstract removeAttribute(element: any, attribute: string): any;
850 abstract removeAttributeNS(element: any, ns: string, attribute: string): any;
851 abstract templateAwareRoot(el: any): any;
852 abstract createHtmlDocument(): HTMLDocument;
853 abstract getDefaultDocument(): Document;
854 abstract getBoundingClientRect(el: any): any;
855 abstract getTitle(doc: Document): string;
856 abstract setTitle(doc: Document, newTitle: string): any;
857 abstract elementMatches(n: any, selector: string): boolean;
858 abstract isTemplateElement(el: any): boolean;
859 abstract isTextNode(node: any): boolean;
860 abstract isCommentNode(node: any): boolean;
861 abstract isElementNode(node: any): boolean;
862 abstract hasShadowRoot(node: any): boolean;
863 abstract isShadowRoot(node: any): boolean;
864 abstract importIntoDoc(node: Node): Node;
865 abstract adoptNode(node: Node): Node;
866 abstract getHref(element: any): string;
867 abstract getEventKey(event: any): string;
868 abstract resolveAndSetHref(element: any, baseUrl: string, href: string): any;
869 abstract supportsDOMEvents(): boolean;
870 abstract supportsNativeShadowDOM(): boolean;
871 abstract getGlobalEventTarget(doc: Document, target: string): any;
872 abstract getHistory(): History;
873 abstract getLocation(): Location;
874 abstract getBaseHref(doc: Document): string | null;
875 abstract resetBaseElement(): void;
876 abstract getUserAgent(): string;
877 abstract setData(element: any, name: string, value: string): any;
878 abstract getComputedStyle(element: any): any;
879 abstract getData(element: any, name: string): string | null;
880 abstract supportsWebAnimation(): boolean;
881 abstract performanceNow(): number;
882 abstract getAnimationPrefix(): string;
883 abstract getTransitionEnd(): string;
884 abstract supportsAnimation(): boolean;
885 abstract supportsCookies(): boolean;
886 abstract getCookie(name: string): string | null;
887 abstract setCookie(name: string, value: string): any;
888}
889
890export declare class ɵDomEventsPlugin extends ɵangular_packages_platform_browser_platform_browser_g {
891 private ngZone;
892 constructor(doc: any, ngZone: NgZone, platformId: {} | null);
893 private patchEvent;
894 supports(eventName: string): boolean;
895 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
896 removeEventListener(target: any, eventName: string, callback: Function): void;
897}
898
899export declare class ɵDomRendererFactory2 implements RendererFactory2 {
900 private eventManager;
901 private sharedStylesHost;
902 private appId;
903 private rendererByCompId;
904 private defaultRenderer;
905 constructor(eventManager: EventManager, sharedStylesHost: ɵDomSharedStylesHost, appId: string);
906 createRenderer(element: any, type: RendererType2 | null): Renderer2;
907 begin(): void;
908 end(): void;
909}
910
911export declare class ɵDomSanitizerImpl extends DomSanitizer {
912 private _doc;
913 constructor(_doc: any);
914 sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
915 private checkNotSafeValue;
916 bypassSecurityTrustHtml(value: string): SafeHtml;
917 bypassSecurityTrustStyle(value: string): SafeStyle;
918 bypassSecurityTrustScript(value: string): SafeScript;
919 bypassSecurityTrustUrl(value: string): SafeUrl;
920 bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
921}
922
923export declare class ɵDomSharedStylesHost extends ɵSharedStylesHost implements OnDestroy {
924 private _doc;
925 private _hostNodes;
926 private _styleNodes;
927 constructor(_doc: any);
928 private _addStylesToHost;
929 addHost(hostNode: Node): void;
930 removeHost(hostNode: Node): void;
931 onStylesAdded(additions: Set<string>): void;
932 ngOnDestroy(): void;
933}
934
935export declare const ɵELEMENT_PROBE_PROVIDERS: Provider[];
936
937/**
938 * In Ivy, we don't support NgProbe because we have our own set of testing utilities
939 * with more robust functionality.
940 *
941 * We shouldn't bring in NgProbe because it prevents DebugNode and friends from
942 * tree-shaking properly.
943 */
944export declare const ɵELEMENT_PROBE_PROVIDERS__POST_R3__: never[];
945
946
947export declare function ɵescapeHtml(text: string): string;
948
949export declare function ɵflattenStyles(compId: string, styles: Array<any | any[]>, target: string[]): string[];
950
951export declare function ɵgetDOM(): ɵDomAdapter;
952
953export declare class ɵHammerGesturesPlugin extends ɵangular_packages_platform_browser_platform_browser_g {
954 private _config;
955 private console;
956 private loader?;
957 constructor(doc: any, _config: HammerGestureConfig, console: ɵConsole, loader?: HammerLoader | null | undefined);
958 supports(eventName: string): boolean;
959 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
960 isCustomEvent(eventName: string): boolean;
961}
962
963export declare function ɵinitDomAdapter(): void;
964
965export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
966
967/**
968 * @publicApi
969 * A browser plug-in that provides support for handling of key events in Angular.
970 */
971export declare class ɵKeyEventsPlugin extends ɵangular_packages_platform_browser_platform_browser_g {
972 /**
973 * Initializes an instance of the browser plug-in.
974 * @param doc The document in which key events will be detected.
975 */
976 constructor(doc: any);
977 /**
978 * Reports whether a named key event is supported.
979 * @param eventName The event name to query.
980 * @return True if the named key event is supported.
981 */
982 supports(eventName: string): boolean;
983 /**
984 * Registers a handler for a specific element and key event.
985 * @param element The HTML element to receive event notifications.
986 * @param eventName The name of the key event to listen for.
987 * @param handler A function to call when the notification occurs. Receives the
988 * event object as an argument.
989 * @returns The key event that was registered.
990 */
991 addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
992 static parseEventName(eventName: string): {
993 [key: string]: string;
994 } | null;
995 static getEventFullKey(event: KeyboardEvent): string;
996 /**
997 * Configures a handler callback for a key event.
998 * @param fullKey The event name that combines all simultaneous keystrokes.
999 * @param handler The function that responds to the key event.
1000 * @param zone The zone in which the event occurred.
1001 * @returns A callback function.
1002 */
1003 static eventCallback(fullKey: any, handler: Function, zone: NgZone): Function;
1004}
1005
1006export declare const ɵNAMESPACE_URIS: {
1007 [ns: string]: string;
1008};
1009
1010export declare function ɵsetRootDomAdapter(adapter: ɵDomAdapter): void;
1011
1012export declare class ɵSharedStylesHost {
1013 addStyles(styles: string[]): void;
1014 onStylesAdded(additions: Set<string>): void;
1015 getAllStyles(): string[];
1016}
1017
1018export declare function ɵshimContentAttribute(componentShortId: string): string;
1019
1020export declare function ɵshimHostAttribute(componentShortId: string): string;
1021
1022/**
1023 * An id that identifies a particular application being bootstrapped, that should
1024 * match across the client/server boundary.
1025 */
1026export declare const ɵTRANSITION_ID: InjectionToken<unknown>;
1027
1028export { }
1029
\No newline at end of file