index.d.ts 37 KB

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