index.d.ts 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  1. /**
  2. * @license Angular v16.2.9
  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 {@link 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 {@link 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 {@link 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. *
  596. * By default, the function enables the recommended set of features for the optimal
  597. * performance for most of the applications. You can enable/disable features by
  598. * passing special functions (from the `HydrationFeatures` set) as arguments to the
  599. * `provideClientHydration` function. It includes the following features:
  600. *
  601. * * Reconciling DOM hydration. Learn more about it [here](guide/hydration).
  602. * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and
  603. * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching
  604. * [here](/guide/universal#caching-data-when-using-httpclient).
  605. *
  606. * These functions functions will allow you to disable some of the default features:
  607. * * {@link withNoDomReuse} to disable DOM nodes reuse during hydration
  608. * * {@link withNoHttpTransferCache} to disable HTTP transfer cache
  609. *
  610. *
  611. * @usageNotes
  612. *
  613. * Basic example of how you can enable hydration in your application when
  614. * `bootstrapApplication` function is used:
  615. * ```
  616. * bootstrapApplication(AppComponent, {
  617. * providers: [provideClientHydration()]
  618. * });
  619. * ```
  620. *
  621. * Alternatively if you are using NgModules, you would add `provideClientHydration`
  622. * to your root app module's provider list.
  623. * ```
  624. * @NgModule({
  625. * declarations: [RootCmp],
  626. * bootstrap: [RootCmp],
  627. * providers: [provideClientHydration()],
  628. * })
  629. * export class AppModule {}
  630. * ```
  631. *
  632. * @see {@link withNoDomReuse}
  633. * @see {@link withNoHttpTransferCache}
  634. *
  635. * @param features Optional features to configure additional router behaviors.
  636. * @returns A set of providers to enable hydration.
  637. *
  638. * @publicApi
  639. * @developerPreview
  640. */
  641. export declare function provideClientHydration(...features: HydrationFeature<HydrationFeatureKind>[]): EnvironmentProviders;
  642. /**
  643. * Returns a set of providers required to setup [Testability](api/core/Testability) for an
  644. * application bootstrapped using the `bootstrapApplication` function. The set of providers is
  645. * needed to support testing an application with Protractor (which relies on the Testability APIs
  646. * to be present).
  647. *
  648. * @returns An array of providers required to setup Testability for an application and make it
  649. * available for testing using Protractor.
  650. *
  651. * @publicApi
  652. */
  653. export declare function provideProtractorTestingSupport(): Provider[];
  654. /**
  655. * A [DI token](guide/glossary#di-token "DI token definition") that indicates whether styles
  656. * of destroyed components should be removed from DOM.
  657. *
  658. * By default, the value is set to `false`. This will be changed in the next major version.
  659. * @publicApi
  660. */
  661. export declare const REMOVE_STYLES_ON_COMPONENT_DESTROY: InjectionToken<boolean>;
  662. /**
  663. * Marker interface for a value that's safe to use as HTML.
  664. *
  665. * @publicApi
  666. */
  667. export declare interface SafeHtml extends SafeValue {
  668. }
  669. /**
  670. * Marker interface for a value that's safe to use as a URL to load executable code from.
  671. *
  672. * @publicApi
  673. */
  674. export declare interface SafeResourceUrl extends SafeValue {
  675. }
  676. /**
  677. * Marker interface for a value that's safe to use as JavaScript.
  678. *
  679. * @publicApi
  680. */
  681. export declare interface SafeScript extends SafeValue {
  682. }
  683. /**
  684. * Marker interface for a value that's safe to use as style (CSS).
  685. *
  686. * @publicApi
  687. */
  688. export declare interface SafeStyle extends SafeValue {
  689. }
  690. /**
  691. * Marker interface for a value that's safe to use as a URL linking to a document.
  692. *
  693. * @publicApi
  694. */
  695. export declare interface SafeUrl extends SafeValue {
  696. }
  697. /**
  698. * Marker interface for a value that's safe to use in a particular context.
  699. *
  700. * @publicApi
  701. */
  702. export declare interface SafeValue {
  703. }
  704. /**
  705. * A type-safe key to use with `TransferState`.
  706. *
  707. * Example:
  708. *
  709. * ```
  710. * const COUNTER_KEY = makeStateKey<number>('counter');
  711. * let value = 10;
  712. *
  713. * transferState.set(COUNTER_KEY, value);
  714. * ```
  715. * @publicApi
  716. *
  717. * @deprecated `StateKey` has moved, please import `StateKey` from `@angular/core` instead.
  718. */
  719. export declare type StateKey<T> = StateKey_2<T>;
  720. /**
  721. * A service that can be used to get and set the title of a current HTML document.
  722. *
  723. * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
  724. * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
  725. * (representing the `<title>` tag). Instead, this service can be used to set and get the current
  726. * title value.
  727. *
  728. * @publicApi
  729. */
  730. export declare class Title {
  731. private _doc;
  732. constructor(_doc: any);
  733. /**
  734. * Get the title of the current HTML document.
  735. */
  736. getTitle(): string;
  737. /**
  738. * Set the title of the current HTML document.
  739. * @param newTitle
  740. */
  741. setTitle(newTitle: string): void;
  742. static ɵfac: i0.ɵɵFactoryDeclaration<Title, never>;
  743. static ɵprov: i0.ɵɵInjectableDeclaration<Title>;
  744. }
  745. /**
  746. *
  747. * A key value store that is transferred from the application on the server side to the application
  748. * on the client side.
  749. *
  750. * The `TransferState` is available as an injectable token.
  751. * On the client, just inject this token using DI and use it, it will be lazily initialized.
  752. * On the server it's already included if `renderApplication` function is used. Otherwise, import
  753. * the `ServerTransferStateModule` module to make the `TransferState` available.
  754. *
  755. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  756. * boolean, number, string, null and non-class objects will be serialized and deserialized in a
  757. * non-lossy manner.
  758. *
  759. * @publicApi
  760. *
  761. * @deprecated `TransferState` has moved, please import `TransferState` from `@angular/core`
  762. * instead.
  763. */
  764. export declare type TransferState = TransferState_2;
  765. export declare const TransferState: {
  766. new (): TransferState_2;
  767. };
  768. /**
  769. * @publicApi
  770. */
  771. export declare const VERSION: Version;
  772. /**
  773. * Disables DOM nodes reuse during hydration. Effectively makes
  774. * Angular re-render an application from scratch on the client.
  775. *
  776. * When this option is enabled, make sure that the initial navigation
  777. * option is configured for the Router as `enabledBlocking` by using the
  778. * `withEnabledBlockingInitialNavigation` in the `provideRouter` call:
  779. *
  780. * ```
  781. * bootstrapApplication(RootComponent, {
  782. * providers: [
  783. * provideRouter(
  784. * // ... other features ...
  785. * withEnabledBlockingInitialNavigation()
  786. * ),
  787. * provideClientHydration(withNoDomReuse())
  788. * ]
  789. * });
  790. * ```
  791. *
  792. * This would ensure that the application is rerendered after all async
  793. * operations in the Router (such as lazy-loading of components,
  794. * waiting for async guards and resolvers) are completed to avoid
  795. * clearing the DOM on the client too soon, thus causing content flicker.
  796. *
  797. * @see {@link provideRouter}
  798. * @see {@link withEnabledBlockingInitialNavigation}
  799. *
  800. * @publicApi
  801. * @developerPreview
  802. */
  803. export declare function withNoDomReuse(): HydrationFeature<HydrationFeatureKind.NoDomReuseFeature>;
  804. /**
  805. * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the
  806. * server and other one on the browser.
  807. *
  808. * @publicApi
  809. * @developerPreview
  810. */
  811. export declare function withNoHttpTransferCache(): HydrationFeature<HydrationFeatureKind.NoHttpTransferCache>;
  812. /**
  813. * A `DomAdapter` powered by full browser DOM APIs.
  814. *
  815. * @security Tread carefully! Interacting with the DOM directly is dangerous and
  816. * can introduce XSS risks.
  817. */
  818. export declare class ɵBrowserDomAdapter extends GenericBrowserDomAdapter {
  819. static makeCurrent(): void;
  820. onAndCancel(el: Node, evt: any, listener: any): Function;
  821. dispatchEvent(el: Node, evt: any): void;
  822. remove(node: Node): void;
  823. createElement(tagName: string, doc?: Document): HTMLElement;
  824. createHtmlDocument(): Document;
  825. getDefaultDocument(): Document;
  826. isElementNode(node: Node): boolean;
  827. isShadowRoot(node: any): boolean;
  828. /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
  829. getGlobalEventTarget(doc: Document, target: string): EventTarget | null;
  830. getBaseHref(doc: Document): string | null;
  831. resetBaseElement(): void;
  832. getUserAgent(): string;
  833. getCookie(name: string): string | null;
  834. }
  835. export declare class ɵBrowserGetTestability implements GetTestability {
  836. addToWindow(registry: TestabilityRegistry): void;
  837. findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
  838. }
  839. export declare class ɵDomEventsPlugin extends EventManagerPlugin {
  840. constructor(doc: any);
  841. supports(eventName: string): boolean;
  842. addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
  843. removeEventListener(target: any, eventName: string, callback: Function): void;
  844. static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomEventsPlugin, never>;
  845. static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomEventsPlugin>;
  846. }
  847. export declare class ɵDomRendererFactory2 implements RendererFactory2, OnDestroy {
  848. private readonly eventManager;
  849. private readonly sharedStylesHost;
  850. private readonly appId;
  851. private removeStylesOnCompDestroy;
  852. private readonly doc;
  853. readonly platformId: Object;
  854. readonly ngZone: NgZone;
  855. private readonly nonce;
  856. private readonly rendererByCompId;
  857. private readonly defaultRenderer;
  858. private readonly platformIsServer;
  859. constructor(eventManager: EventManager, sharedStylesHost: ɵSharedStylesHost, appId: string, removeStylesOnCompDestroy: boolean, doc: Document, platformId: Object, ngZone: NgZone, nonce?: string | null);
  860. createRenderer(element: any, type: RendererType2 | null): Renderer2;
  861. private getOrCreateRenderer;
  862. ngOnDestroy(): void;
  863. static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomRendererFactory2, never>;
  864. static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomRendererFactory2>;
  865. }
  866. export declare class ɵDomSanitizerImpl extends DomSanitizer {
  867. private _doc;
  868. constructor(_doc: any);
  869. sanitize(ctx: SecurityContext, value: SafeValue | string | null): string | null;
  870. bypassSecurityTrustHtml(value: string): SafeHtml;
  871. bypassSecurityTrustStyle(value: string): SafeStyle;
  872. bypassSecurityTrustScript(value: string): SafeScript;
  873. bypassSecurityTrustUrl(value: string): SafeUrl;
  874. bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
  875. static ɵfac: i0.ɵɵFactoryDeclaration<ɵDomSanitizerImpl, never>;
  876. static ɵprov: i0.ɵɵInjectableDeclaration<ɵDomSanitizerImpl>;
  877. }
  878. export { ɵgetDOM }
  879. /**
  880. * Event plugin that adds Hammer support to an application.
  881. *
  882. * @ngModule HammerModule
  883. */
  884. export declare class ɵHammerGesturesPlugin extends EventManagerPlugin {
  885. private _config;
  886. private console;
  887. private loader?;
  888. private _loaderPromise;
  889. constructor(doc: any, _config: HammerGestureConfig, console: ɵConsole, loader?: HammerLoader | null | undefined);
  890. supports(eventName: string): boolean;
  891. addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
  892. isCustomEvent(eventName: string): boolean;
  893. static ɵfac: i0.ɵɵFactoryDeclaration<ɵHammerGesturesPlugin, [null, null, null, { optional: true; }]>;
  894. static ɵprov: i0.ɵɵInjectableDeclaration<ɵHammerGesturesPlugin>;
  895. }
  896. export declare function ɵinitDomAdapter(): void;
  897. export declare const ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[];
  898. /**
  899. * @publicApi
  900. * A browser plug-in that provides support for handling of key events in Angular.
  901. */
  902. export declare class ɵKeyEventsPlugin extends EventManagerPlugin {
  903. /**
  904. * Initializes an instance of the browser plug-in.
  905. * @param doc The document in which key events will be detected.
  906. */
  907. constructor(doc: any);
  908. /**
  909. * Reports whether a named key event is supported.
  910. * @param eventName The event name to query.
  911. * @return True if the named key event is supported.
  912. */
  913. supports(eventName: string): boolean;
  914. /**
  915. * Registers a handler for a specific element and key event.
  916. * @param element The HTML element to receive event notifications.
  917. * @param eventName The name of the key event to listen for.
  918. * @param handler A function to call when the notification occurs. Receives the
  919. * event object as an argument.
  920. * @returns The key event that was registered.
  921. */
  922. addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
  923. /**
  924. * Parses the user provided full keyboard event definition and normalizes it for
  925. * later internal use. It ensures the string is all lowercase, converts special
  926. * characters to a standard spelling, and orders all the values consistently.
  927. *
  928. * @param eventName The name of the key event to listen for.
  929. * @returns an object with the full, normalized string, and the dom event name
  930. * or null in the case when the event doesn't match a keyboard event.
  931. */
  932. static parseEventName(eventName: string): {
  933. fullKey: string;
  934. domEventName: string;
  935. } | null;
  936. /**
  937. * Determines whether the actual keys pressed match the configured key code string.
  938. * The `fullKeyCode` event is normalized in the `parseEventName` method when the
  939. * event is attached to the DOM during the `addEventListener` call. This is unseen
  940. * by the end user and is normalized for internal consistency and parsing.
  941. *
  942. * @param event The keyboard event.
  943. * @param fullKeyCode The normalized user defined expected key event string
  944. * @returns boolean.
  945. */
  946. static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean;
  947. /**
  948. * Configures a handler callback for a key event.
  949. * @param fullKey The event name that combines all simultaneous keystrokes.
  950. * @param handler The function that responds to the key event.
  951. * @param zone The zone in which the event occurred.
  952. * @returns A callback function.
  953. */
  954. static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function;
  955. static ɵfac: i0.ɵɵFactoryDeclaration<ɵKeyEventsPlugin, never>;
  956. static ɵprov: i0.ɵɵInjectableDeclaration<ɵKeyEventsPlugin>;
  957. }
  958. export declare class ɵSharedStylesHost implements OnDestroy {
  959. private readonly doc;
  960. private readonly appId;
  961. private nonce?;
  962. readonly platformId: object;
  963. private readonly styleRef;
  964. private readonly hostNodes;
  965. private readonly styleNodesInDOM;
  966. private readonly platformIsServer;
  967. constructor(doc: Document, appId: string, nonce?: string | null | undefined, platformId?: object);
  968. addStyles(styles: string[]): void;
  969. removeStyles(styles: string[]): void;
  970. ngOnDestroy(): void;
  971. addHost(hostNode: Node): void;
  972. removeHost(hostNode: Node): void;
  973. private getAllStyles;
  974. private onStyleAdded;
  975. private onStyleRemoved;
  976. private collectServerRenderedStyles;
  977. private changeUsageCount;
  978. private getStyleElement;
  979. private addStyleToHost;
  980. private resetHostNodes;
  981. static ɵfac: i0.ɵɵFactoryDeclaration<ɵSharedStylesHost, [null, null, { optional: true; }, null]>;
  982. static ɵprov: i0.ɵɵInjectableDeclaration<ɵSharedStylesHost>;
  983. }
  984. export { }