platform-browser.d.ts 38 KB

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