index.d.ts 123 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244
  1. /**
  2. * @license Angular v16.0.4
  3. * (c) 2010-2022 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { ChangeDetectorRef } from '@angular/core';
  7. import { DoCheck } from '@angular/core';
  8. import { ElementRef } from '@angular/core';
  9. import * as i0 from '@angular/core';
  10. import { InjectionToken } from '@angular/core';
  11. import { Injector } from '@angular/core';
  12. import { IterableDiffers } from '@angular/core';
  13. import { KeyValueDiffers } from '@angular/core';
  14. import { NgIterable } from '@angular/core';
  15. import { NgModuleFactory } from '@angular/core';
  16. import { Observable } from 'rxjs';
  17. import { OnChanges } from '@angular/core';
  18. import { OnDestroy } from '@angular/core';
  19. import { OnInit } from '@angular/core';
  20. import { PipeTransform } from '@angular/core';
  21. import { Provider } from '@angular/core';
  22. import { Renderer2 } from '@angular/core';
  23. import { SimpleChanges } from '@angular/core';
  24. import { Subscribable } from 'rxjs';
  25. import { SubscriptionLike } from 'rxjs';
  26. import { TemplateRef } from '@angular/core';
  27. import { TrackByFunction } from '@angular/core';
  28. import { Type } from '@angular/core';
  29. import { Version } from '@angular/core';
  30. import { ViewContainerRef } from '@angular/core';
  31. /**
  32. * A predefined [DI token](guide/glossary#di-token) for the base href
  33. * to be used with the `PathLocationStrategy`.
  34. * The base href is the URL prefix that should be preserved when generating
  35. * and recognizing URLs.
  36. *
  37. * @usageNotes
  38. *
  39. * The following example shows how to use this token to configure the root app injector
  40. * with a base href value, so that the DI framework can supply the dependency anywhere in the app.
  41. *
  42. * ```typescript
  43. * import {Component, NgModule} from '@angular/core';
  44. * import {APP_BASE_HREF} from '@angular/common';
  45. *
  46. * @NgModule({
  47. * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
  48. * })
  49. * class AppModule {}
  50. * ```
  51. *
  52. * @publicApi
  53. */
  54. export declare const APP_BASE_HREF: InjectionToken<string>;
  55. /**
  56. * @ngModule CommonModule
  57. * @description
  58. *
  59. * Unwraps a value from an asynchronous primitive.
  60. *
  61. * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
  62. * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
  63. * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
  64. * potential memory leaks. When the reference of the expression changes, the `async` pipe
  65. * automatically unsubscribes from the old `Observable` or `Promise` and subscribes to the new one.
  66. *
  67. * @usageNotes
  68. *
  69. * ### Examples
  70. *
  71. * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
  72. * promise.
  73. *
  74. * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
  75. *
  76. * It's also possible to use `async` with Observables. The example below binds the `time` Observable
  77. * to the view. The Observable continuously updates the view with the current time.
  78. *
  79. * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
  80. *
  81. * @publicApi
  82. */
  83. export declare class AsyncPipe implements OnDestroy, PipeTransform {
  84. private _ref;
  85. private _latestValue;
  86. private _subscription;
  87. private _obj;
  88. private _strategy;
  89. constructor(ref: ChangeDetectorRef);
  90. ngOnDestroy(): void;
  91. transform<T>(obj: Observable<T> | Subscribable<T> | Promise<T>): T | null;
  92. transform<T>(obj: null | undefined): null;
  93. transform<T>(obj: Observable<T> | Subscribable<T> | Promise<T> | null | undefined): T | null;
  94. private _subscribe;
  95. private _selectStrategy;
  96. private _dispose;
  97. private _updateLatestValue;
  98. static ɵfac: i0.ɵɵFactoryDeclaration<AsyncPipe, never>;
  99. static ɵpipe: i0.ɵɵPipeDeclaration<AsyncPipe, "async", true>;
  100. }
  101. /**
  102. * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
  103. * This class should not be used directly by an application developer. Instead, use
  104. * {@link Location}.
  105. *
  106. * @publicApi
  107. */
  108. export declare class BrowserPlatformLocation extends PlatformLocation {
  109. private _location;
  110. private _history;
  111. private _doc;
  112. constructor();
  113. getBaseHrefFromDOM(): string;
  114. onPopState(fn: LocationChangeListener): VoidFunction;
  115. onHashChange(fn: LocationChangeListener): VoidFunction;
  116. get href(): string;
  117. get protocol(): string;
  118. get hostname(): string;
  119. get port(): string;
  120. get pathname(): string;
  121. get search(): string;
  122. get hash(): string;
  123. set pathname(newPath: string);
  124. pushState(state: any, title: string, url: string): void;
  125. replaceState(state: any, title: string, url: string): void;
  126. forward(): void;
  127. back(): void;
  128. historyGo(relativePosition?: number): void;
  129. getState(): unknown;
  130. static ɵfac: i0.ɵɵFactoryDeclaration<BrowserPlatformLocation, never>;
  131. static ɵprov: i0.ɵɵInjectableDeclaration<BrowserPlatformLocation>;
  132. }
  133. /**
  134. * Exports all the basic Angular directives and pipes,
  135. * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.
  136. * Re-exported by `BrowserModule`, which is included automatically in the root
  137. * `AppModule` when you create a new app with the CLI `new` command.
  138. *
  139. * @publicApi
  140. */
  141. export declare class CommonModule {
  142. static ɵfac: i0.ɵɵFactoryDeclaration<CommonModule, never>;
  143. static ɵmod: i0.ɵɵNgModuleDeclaration<CommonModule, never, [typeof i1.NgClass, typeof i2.NgComponentOutlet, typeof i3.NgForOf, typeof i4.NgIf, typeof i5.NgTemplateOutlet, typeof i6.NgStyle, typeof i7.NgSwitch, typeof i7.NgSwitchCase, typeof i7.NgSwitchDefault, typeof i8.NgPlural, typeof i8.NgPluralCase, typeof i9.AsyncPipe, typeof i10.UpperCasePipe, typeof i10.LowerCasePipe, typeof i11.JsonPipe, typeof i12.SlicePipe, typeof i13.DecimalPipe, typeof i13.PercentPipe, typeof i10.TitleCasePipe, typeof i13.CurrencyPipe, typeof i14.DatePipe, typeof i15.I18nPluralPipe, typeof i16.I18nSelectPipe, typeof i17.KeyValuePipe], [typeof i1.NgClass, typeof i2.NgComponentOutlet, typeof i3.NgForOf, typeof i4.NgIf, typeof i5.NgTemplateOutlet, typeof i6.NgStyle, typeof i7.NgSwitch, typeof i7.NgSwitchCase, typeof i7.NgSwitchDefault, typeof i8.NgPlural, typeof i8.NgPluralCase, typeof i9.AsyncPipe, typeof i10.UpperCasePipe, typeof i10.LowerCasePipe, typeof i11.JsonPipe, typeof i12.SlicePipe, typeof i13.DecimalPipe, typeof i13.PercentPipe, typeof i10.TitleCasePipe, typeof i13.CurrencyPipe, typeof i14.DatePipe, typeof i15.I18nPluralPipe, typeof i16.I18nSelectPipe, typeof i17.KeyValuePipe]>;
  144. static ɵinj: i0.ɵɵInjectorDeclaration<CommonModule>;
  145. }
  146. /**
  147. * @ngModule CommonModule
  148. * @description
  149. *
  150. * Transforms a number to a currency string, formatted according to locale rules
  151. * that determine group sizing and separator, decimal-point character,
  152. * and other locale-specific configurations.
  153. *
  154. *
  155. * @see `getCurrencySymbol()`
  156. * @see `formatCurrency()`
  157. *
  158. * @usageNotes
  159. * The following code shows how the pipe transforms numbers
  160. * into text strings, according to various format specifications,
  161. * where the caller's default locale is `en-US`.
  162. *
  163. * <code-example path="common/pipes/ts/currency_pipe.ts" region='CurrencyPipe'></code-example>
  164. *
  165. * @publicApi
  166. */
  167. export declare class CurrencyPipe implements PipeTransform {
  168. private _locale;
  169. private _defaultCurrencyCode;
  170. constructor(_locale: string, _defaultCurrencyCode?: string);
  171. transform(value: number | string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
  172. transform(value: null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): null;
  173. transform(value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
  174. static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyPipe, never>;
  175. static ɵpipe: i0.ɵɵPipeDeclaration<CurrencyPipe, "currency", true>;
  176. }
  177. /**
  178. * DI token that allows to provide default configuration for the `DatePipe` instances in an
  179. * application. The value is an object which can include the following fields:
  180. * - `dateFormat`: configures the default date format. If not provided, the `DatePipe`
  181. * will use the 'mediumDate' as a value.
  182. * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will
  183. * use the end-user's local system timezone.
  184. *
  185. * @see `DatePipeConfig`
  186. *
  187. * @usageNotes
  188. *
  189. * Various date pipe default values can be overwritten by providing this token with
  190. * the value that has this interface.
  191. *
  192. * For example:
  193. *
  194. * Override the default date format by providing a value using the token:
  195. * ```typescript
  196. * providers: [
  197. * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}
  198. * ]
  199. * ```
  200. *
  201. * Override the default timezone by providing a value using the token:
  202. * ```typescript
  203. * providers: [
  204. * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}
  205. * ]
  206. * ```
  207. */
  208. export declare const DATE_PIPE_DEFAULT_OPTIONS: InjectionToken<DatePipeConfig>;
  209. /**
  210. * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).
  211. * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.
  212. *
  213. * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe
  214. */
  215. export declare const DATE_PIPE_DEFAULT_TIMEZONE: InjectionToken<string>;
  216. /**
  217. * @ngModule CommonModule
  218. * @description
  219. *
  220. * Formats a date value according to locale rules.
  221. *
  222. * `DatePipe` is executed only when it detects a pure change to the input value.
  223. * A pure change is either a change to a primitive input value
  224. * (such as `String`, `Number`, `Boolean`, or `Symbol`),
  225. * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).
  226. *
  227. * Note that mutating a `Date` object does not cause the pipe to be rendered again.
  228. * To ensure that the pipe is executed, you must create a new `Date` object.
  229. *
  230. * Only the `en-US` locale data comes with Angular. To localize dates
  231. * in another language, you must import the corresponding locale data.
  232. * See the [I18n guide](guide/i18n-common-format-data-locale) for more information.
  233. *
  234. * The time zone of the formatted value can be specified either by passing it in as the second
  235. * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS`
  236. * injection token. The value that is passed in as the second parameter takes precedence over
  237. * the one defined using the injection token.
  238. *
  239. * @see `formatDate()`
  240. *
  241. *
  242. * @usageNotes
  243. *
  244. * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to
  245. * reformat the date on every change-detection cycle, treat the date as an immutable object
  246. * and change the reference when the pipe needs to run again.
  247. *
  248. * ### Pre-defined format options
  249. *
  250. * | Option | Equivalent to | Examples (given in `en-US` locale) |
  251. * |---------------|-------------------------------------|-------------------------------------------------|
  252. * | `'short'` | `'M/d/yy, h:mm a'` | `6/15/15, 9:03 AM` |
  253. * | `'medium'` | `'MMM d, y, h:mm:ss a'` | `Jun 15, 2015, 9:03:01 AM` |
  254. * | `'long'` | `'MMMM d, y, h:mm:ss a z'` | `June 15, 2015 at 9:03:01 AM GMT+1` |
  255. * | `'full'` | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |
  256. * | `'shortDate'` | `'M/d/yy'` | `6/15/15` |
  257. * | `'mediumDate'`| `'MMM d, y'` | `Jun 15, 2015` |
  258. * | `'longDate'` | `'MMMM d, y'` | `June 15, 2015` |
  259. * | `'fullDate'` | `'EEEE, MMMM d, y'` | `Monday, June 15, 2015` |
  260. * | `'shortTime'` | `'h:mm a'` | `9:03 AM` |
  261. * | `'mediumTime'`| `'h:mm:ss a'` | `9:03:01 AM` |
  262. * | `'longTime'` | `'h:mm:ss a z'` | `9:03:01 AM GMT+1` |
  263. * | `'fullTime'` | `'h:mm:ss a zzzz'` | `9:03:01 AM GMT+01:00` |
  264. *
  265. * ### Custom format options
  266. *
  267. * You can construct a format string using symbols to specify the components
  268. * of a date-time value, as described in the following table.
  269. * Format details depend on the locale.
  270. * Fields marked with (*) are only available in the extra data set for the given locale.
  271. *
  272. * | Field type | Format | Description | Example Value |
  273. * |-------------------- |-------------|---------------------------------------------------------------|------------------------------------------------------------|
  274. * | Era | G, GG & GGG | Abbreviated | AD |
  275. * | | GGGG | Wide | Anno Domini |
  276. * | | GGGGG | Narrow | A |
  277. * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
  278. * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
  279. * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
  280. * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
  281. * | Week-numbering year | Y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
  282. * | | YY | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
  283. * | | YYY | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
  284. * | | YYYY | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
  285. * | Month | M | Numeric: 1 digit | 9, 12 |
  286. * | | MM | Numeric: 2 digits + zero padded | 09, 12 |
  287. * | | MMM | Abbreviated | Sep |
  288. * | | MMMM | Wide | September |
  289. * | | MMMMM | Narrow | S |
  290. * | Month standalone | L | Numeric: 1 digit | 9, 12 |
  291. * | | LL | Numeric: 2 digits + zero padded | 09, 12 |
  292. * | | LLL | Abbreviated | Sep |
  293. * | | LLLL | Wide | September |
  294. * | | LLLLL | Narrow | S |
  295. * | Week of year | w | Numeric: minimum digits | 1... 53 |
  296. * | | ww | Numeric: 2 digits + zero padded | 01... 53 |
  297. * | Week of month | W | Numeric: 1 digit | 1... 5 |
  298. * | Day of month | d | Numeric: minimum digits | 1 |
  299. * | | dd | Numeric: 2 digits + zero padded | 01 |
  300. * | Week day | E, EE & EEE | Abbreviated | Tue |
  301. * | | EEEE | Wide | Tuesday |
  302. * | | EEEEE | Narrow | T |
  303. * | | EEEEEE | Short | Tu |
  304. * | Week day standalone | c, cc | Numeric: 1 digit | 2 |
  305. * | | ccc | Abbreviated | Tue |
  306. * | | cccc | Wide | Tuesday |
  307. * | | ccccc | Narrow | T |
  308. * | | cccccc | Short | Tu |
  309. * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |
  310. * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |
  311. * | | aaaaa | Narrow | a/p |
  312. * | Period* | B, BB & BBB | Abbreviated | mid. |
  313. * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
  314. * | | BBBBB | Narrow | md |
  315. * | Period standalone* | b, bb & bbb | Abbreviated | mid. |
  316. * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
  317. * | | bbbbb | Narrow | md |
  318. * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |
  319. * | | hh | Numeric: 2 digits + zero padded | 01, 12 |
  320. * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |
  321. * | | HH | Numeric: 2 digits + zero padded | 00, 23 |
  322. * | Minute | m | Numeric: minimum digits | 8, 59 |
  323. * | | mm | Numeric: 2 digits + zero padded | 08, 59 |
  324. * | Second | s | Numeric: minimum digits | 0... 59 |
  325. * | | ss | Numeric: 2 digits + zero padded | 00... 59 |
  326. * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |
  327. * | | SS | Numeric: 2 digits + zero padded | 00... 99 |
  328. * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |
  329. * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |
  330. * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |
  331. * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |
  332. * | | ZZZZ | Long localized GMT format | GMT-8:00 |
  333. * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |
  334. * | | O, OO & OOO | Short localized GMT format | GMT-8 |
  335. * | | OOOO | Long localized GMT format | GMT-08:00 |
  336. *
  337. *
  338. * ### Format examples
  339. *
  340. * These examples transform a date into various formats,
  341. * assuming that `dateObj` is a JavaScript `Date` object for
  342. * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,
  343. * given in the local time for the `en-US` locale.
  344. *
  345. * ```
  346. * {{ dateObj | date }} // output is 'Jun 15, 2015'
  347. * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
  348. * {{ dateObj | date:'shortTime' }} // output is '9:43 PM'
  349. * {{ dateObj | date:'mm:ss' }} // output is '43:11'
  350. * ```
  351. *
  352. * ### Usage example
  353. *
  354. * The following component uses a date pipe to display the current date in different formats.
  355. *
  356. * ```
  357. * @Component({
  358. * selector: 'date-pipe',
  359. * template: `<div>
  360. * <p>Today is {{today | date}}</p>
  361. * <p>Or if you prefer, {{today | date:'fullDate'}}</p>
  362. * <p>The time is {{today | date:'h:mm a z'}}</p>
  363. * </div>`
  364. * })
  365. * // Get the current date and time as a date-time value.
  366. * export class DatePipeComponent {
  367. * today: number = Date.now();
  368. * }
  369. * ```
  370. *
  371. * @publicApi
  372. */
  373. export declare class DatePipe implements PipeTransform {
  374. private locale;
  375. private defaultTimezone?;
  376. private defaultOptions?;
  377. constructor(locale: string, defaultTimezone?: string | null | undefined, defaultOptions?: DatePipeConfig | null | undefined);
  378. /**
  379. * @param value The date expression: a `Date` object, a number
  380. * (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).
  381. * @param format The date/time components to include, using predefined options or a
  382. * custom format string. When not provided, the `DatePipe` looks for the value using the
  383. * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `dateFormat` property).
  384. * If the token is not configured, the `mediumDate` is used as a value.
  385. * @param timezone A timezone offset (such as `'+0430'`), or a standard UTC/GMT, or continental US
  386. * timezone abbreviation. When not provided, the `DatePipe` looks for the value using the
  387. * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `timezone` property). If the token
  388. * is not configured, the end-user's local system timezone is used as a value.
  389. * @param locale A locale code for the locale format rules to use.
  390. * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
  391. * See [Setting your app locale](guide/i18n-common-locale-id).
  392. *
  393. * @see `DATE_PIPE_DEFAULT_OPTIONS`
  394. *
  395. * @returns A date string in the desired format.
  396. */
  397. transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null;
  398. transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
  399. transform(value: Date | string | number | null | undefined, format?: string, timezone?: string, locale?: string): string | null;
  400. static ɵfac: i0.ɵɵFactoryDeclaration<DatePipe, [null, { optional: true; }, { optional: true; }]>;
  401. static ɵpipe: i0.ɵɵPipeDeclaration<DatePipe, "date", true>;
  402. }
  403. /**
  404. * An interface that describes the date pipe configuration, which can be provided using the
  405. * `DATE_PIPE_DEFAULT_OPTIONS` token.
  406. *
  407. * @see `DATE_PIPE_DEFAULT_OPTIONS`
  408. *
  409. * @publicApi
  410. */
  411. export declare interface DatePipeConfig {
  412. dateFormat: string;
  413. timezone: string;
  414. }
  415. /**
  416. * @ngModule CommonModule
  417. * @description
  418. *
  419. * Formats a value according to digit options and locale rules.
  420. * Locale determines group sizing and separator,
  421. * decimal point character, and other locale-specific configurations.
  422. *
  423. * @see `formatNumber()`
  424. *
  425. * @usageNotes
  426. *
  427. * ### digitsInfo
  428. *
  429. * The value's decimal representation is specified by the `digitsInfo`
  430. * parameter, written in the following format:<br>
  431. *
  432. * ```
  433. * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
  434. * ```
  435. *
  436. * - `minIntegerDigits`:
  437. * The minimum number of integer digits before the decimal point.
  438. * Default is 1.
  439. *
  440. * - `minFractionDigits`:
  441. * The minimum number of digits after the decimal point.
  442. * Default is 0.
  443. *
  444. * - `maxFractionDigits`:
  445. * The maximum number of digits after the decimal point.
  446. * Default is 3.
  447. *
  448. * If the formatted value is truncated it will be rounded using the "to-nearest" method:
  449. *
  450. * ```
  451. * {{3.6 | number: '1.0-0'}}
  452. * <!--will output '4'-->
  453. *
  454. * {{-3.6 | number:'1.0-0'}}
  455. * <!--will output '-4'-->
  456. * ```
  457. *
  458. * ### locale
  459. *
  460. * `locale` will format a value according to locale rules.
  461. * Locale determines group sizing and separator,
  462. * decimal point character, and other locale-specific configurations.
  463. *
  464. * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
  465. *
  466. * See [Setting your app locale](guide/i18n-common-locale-id).
  467. *
  468. * ### Example
  469. *
  470. * The following code shows how the pipe transforms values
  471. * according to various format specifications,
  472. * where the caller's default locale is `en-US`.
  473. *
  474. * <code-example path="common/pipes/ts/number_pipe.ts" region='NumberPipe'></code-example>
  475. *
  476. * @publicApi
  477. */
  478. export declare class DecimalPipe implements PipeTransform {
  479. private _locale;
  480. constructor(_locale: string);
  481. transform(value: number | string, digitsInfo?: string, locale?: string): string | null;
  482. transform(value: null | undefined, digitsInfo?: string, locale?: string): null;
  483. transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null;
  484. static ɵfac: i0.ɵɵFactoryDeclaration<DecimalPipe, never>;
  485. static ɵpipe: i0.ɵɵPipeDeclaration<DecimalPipe, "number", true>;
  486. }
  487. declare function defaultComparator<K, V>(keyValueA: KeyValue<K, V>, keyValueB: KeyValue<K, V>): number;
  488. /**
  489. * A DI Token representing the main rendering context.
  490. * In a browser and SSR this is the DOM Document.
  491. * When using SSR, that document is created by [Domino](https://github.com/angular/domino).
  492. *
  493. * @publicApi
  494. */
  495. export declare const DOCUMENT: InjectionToken<Document>;
  496. /**
  497. * @ngModule CommonModule
  498. * @description
  499. *
  500. * Formats a number as currency using locale rules.
  501. *
  502. * @param value The number to format.
  503. * @param locale A locale code for the locale format rules to use.
  504. * @param currency A string containing the currency symbol or its name,
  505. * such as "$" or "Canadian Dollar". Used in output string, but does not affect the operation
  506. * of the function.
  507. * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
  508. * currency code, such as `USD` for the US dollar and `EUR` for the euro.
  509. * Used to determine the number of digits in the decimal part.
  510. * @param digitsInfo Decimal representation options, specified by a string in the following format:
  511. * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
  512. *
  513. * @returns The formatted currency value.
  514. *
  515. * @see `formatNumber()`
  516. * @see `DecimalPipe`
  517. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  518. *
  519. * @publicApi
  520. */
  521. export declare function formatCurrency(value: number, locale: string, currency: string, currencyCode?: string, digitsInfo?: string): string;
  522. /**
  523. * @ngModule CommonModule
  524. * @description
  525. *
  526. * Formats a date according to locale rules.
  527. *
  528. * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)
  529. * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).
  530. * @param format The date-time components to include. See `DatePipe` for details.
  531. * @param locale A locale code for the locale format rules to use.
  532. * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`),
  533. * or a standard UTC/GMT or continental US time zone abbreviation.
  534. * If not specified, uses host system settings.
  535. *
  536. * @returns The formatted date string.
  537. *
  538. * @see `DatePipe`
  539. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  540. *
  541. * @publicApi
  542. */
  543. export declare function formatDate(value: string | number | Date, format: string, locale: string, timezone?: string): string;
  544. /**
  545. * @ngModule CommonModule
  546. * @description
  547. *
  548. * Formats a number as text, with group sizing, separator, and other
  549. * parameters based on the locale.
  550. *
  551. * @param value The number to format.
  552. * @param locale A locale code for the locale format rules to use.
  553. * @param digitsInfo Decimal representation options, specified by a string in the following format:
  554. * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
  555. *
  556. * @returns The formatted text string.
  557. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  558. *
  559. * @publicApi
  560. */
  561. export declare function formatNumber(value: number, locale: string, digitsInfo?: string): string;
  562. /**
  563. * @ngModule CommonModule
  564. * @description
  565. *
  566. * Formats a number as a percentage according to locale rules.
  567. *
  568. * @param value The number to format.
  569. * @param locale A locale code for the locale format rules to use.
  570. * @param digitsInfo Decimal representation options, specified by a string in the following format:
  571. * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
  572. *
  573. * @returns The formatted percentage value.
  574. *
  575. * @see `formatNumber()`
  576. * @see `DecimalPipe`
  577. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  578. * @publicApi
  579. *
  580. */
  581. export declare function formatPercent(value: number, locale: string, digitsInfo?: string): string;
  582. /**
  583. * String widths available for date-time formats.
  584. * The specific character widths are locale-specific.
  585. * Examples are given for `en-US`.
  586. *
  587. * @see `getLocaleDateFormat()`
  588. * @see `getLocaleTimeFormat()`
  589. * @see `getLocaleDateTimeFormat()`
  590. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  591. * @publicApi
  592. */
  593. export declare enum FormatWidth {
  594. /**
  595. * For `en-US`, 'M/d/yy, h:mm a'`
  596. * (Example: `6/15/15, 9:03 AM`)
  597. */
  598. Short = 0,
  599. /**
  600. * For `en-US`, `'MMM d, y, h:mm:ss a'`
  601. * (Example: `Jun 15, 2015, 9:03:01 AM`)
  602. */
  603. Medium = 1,
  604. /**
  605. * For `en-US`, `'MMMM d, y, h:mm:ss a z'`
  606. * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)
  607. */
  608. Long = 2,
  609. /**
  610. * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`
  611. * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)
  612. */
  613. Full = 3
  614. }
  615. /**
  616. * Context-dependant translation forms for strings.
  617. * Typically the standalone version is for the nominative form of the word,
  618. * and the format version is used for the genitive case.
  619. * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles)
  620. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  621. *
  622. * @publicApi
  623. */
  624. export declare enum FormStyle {
  625. Format = 0,
  626. Standalone = 1
  627. }
  628. /**
  629. * Retrieves the currency symbol for a given currency code.
  630. *
  631. * For example, for the default `en-US` locale, the code `USD` can
  632. * be represented by the narrow symbol `$` or the wide symbol `US$`.
  633. *
  634. * @param code The currency code.
  635. * @param format The format, `wide` or `narrow`.
  636. * @param locale A locale code for the locale format rules to use.
  637. *
  638. * @returns The symbol, or the currency code if no symbol is available.
  639. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  640. *
  641. * @publicApi
  642. */
  643. export declare function getCurrencySymbol(code: string, format: 'wide' | 'narrow', locale?: string): string;
  644. /**
  645. * Retrieves the default currency code for the given locale.
  646. *
  647. * The default is defined as the first currency which is still in use.
  648. *
  649. * @param locale The code of the locale whose currency code we want.
  650. * @returns The code of the default currency for the given locale.
  651. *
  652. * @publicApi
  653. */
  654. export declare function getLocaleCurrencyCode(locale: string): string | null;
  655. /**
  656. * Retrieves the name of the currency for the main country corresponding
  657. * to a given locale. For example, 'US Dollar' for `en-US`.
  658. * @param locale A locale code for the locale format rules to use.
  659. * @returns The currency name,
  660. * or `null` if the main country cannot be determined.
  661. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  662. *
  663. * @publicApi
  664. */
  665. export declare function getLocaleCurrencyName(locale: string): string | null;
  666. /**
  667. * Retrieves the symbol used to represent the currency for the main country
  668. * corresponding to a given locale. For example, '$' for `en-US`.
  669. *
  670. * @param locale A locale code for the locale format rules to use.
  671. * @returns The localized symbol character,
  672. * or `null` if the main country cannot be determined.
  673. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  674. *
  675. * @publicApi
  676. */
  677. export declare function getLocaleCurrencySymbol(locale: string): string | null;
  678. /**
  679. * Retrieves a localized date-value formatting string.
  680. *
  681. * @param locale A locale code for the locale format rules to use.
  682. * @param width The format type.
  683. * @returns The localized formatting string.
  684. * @see `FormatWidth`
  685. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  686. *
  687. * @publicApi
  688. */
  689. export declare function getLocaleDateFormat(locale: string, width: FormatWidth): string;
  690. /**
  691. * Retrieves a localized date-time formatting string.
  692. *
  693. * @param locale A locale code for the locale format rules to use.
  694. * @param width The format type.
  695. * @returns The localized formatting string.
  696. * @see `FormatWidth`
  697. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  698. *
  699. * @publicApi
  700. */
  701. export declare function getLocaleDateTimeFormat(locale: string, width: FormatWidth): string;
  702. /**
  703. * Retrieves days of the week for the given locale, using the Gregorian calendar.
  704. *
  705. * @param locale A locale code for the locale format rules to use.
  706. * @param formStyle The required grammatical form.
  707. * @param width The required character width.
  708. * @returns An array of localized name strings.
  709. * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.
  710. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  711. *
  712. * @publicApi
  713. */
  714. export declare function getLocaleDayNames(locale: string, formStyle: FormStyle, width: TranslationWidth): ReadonlyArray<string>;
  715. /**
  716. * Retrieves day period strings for the given locale.
  717. *
  718. * @param locale A locale code for the locale format rules to use.
  719. * @param formStyle The required grammatical form.
  720. * @param width The required character width.
  721. * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.
  722. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  723. *
  724. * @publicApi
  725. */
  726. export declare function getLocaleDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth): Readonly<[string, string]>;
  727. /**
  728. * Retrieves the writing direction of a specified locale
  729. * @param locale A locale code for the locale format rules to use.
  730. * @publicApi
  731. * @returns 'rtl' or 'ltr'
  732. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  733. */
  734. export declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
  735. /**
  736. * Retrieves Gregorian-calendar eras for the given locale.
  737. * @param locale A locale code for the locale format rules to use.
  738. * @param width The required character width.
  739. * @returns An array of localized era strings.
  740. * For example, `[AD, BC]` for `en-US`.
  741. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  742. *
  743. * @publicApi
  744. */
  745. export declare function getLocaleEraNames(locale: string, width: TranslationWidth): Readonly<[string, string]>;
  746. /**
  747. * Retrieves locale-specific rules used to determine which day period to use
  748. * when more than one period is defined for a locale.
  749. *
  750. * There is a rule for each defined day period. The
  751. * first rule is applied to the first day period and so on.
  752. * Fall back to AM/PM when no rules are available.
  753. *
  754. * A rule can specify a period as time range, or as a single time value.
  755. *
  756. * This functionality is only available when you have loaded the full locale data.
  757. * See the ["I18n guide"](guide/i18n-common-format-data-locale).
  758. *
  759. * @param locale A locale code for the locale format rules to use.
  760. * @returns The rules for the locale, a single time value or array of *from-time, to-time*,
  761. * or null if no periods are available.
  762. *
  763. * @see `getLocaleExtraDayPeriods()`
  764. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  765. *
  766. * @publicApi
  767. */
  768. export declare function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])[];
  769. /**
  770. * Retrieves locale-specific day periods, which indicate roughly how a day is broken up
  771. * in different languages.
  772. * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.
  773. *
  774. * This functionality is only available when you have loaded the full locale data.
  775. * See the ["I18n guide"](guide/i18n-common-format-data-locale).
  776. *
  777. * @param locale A locale code for the locale format rules to use.
  778. * @param formStyle The required grammatical form.
  779. * @param width The required character width.
  780. * @returns The translated day-period strings.
  781. * @see `getLocaleExtraDayPeriodRules()`
  782. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  783. *
  784. * @publicApi
  785. */
  786. export declare function getLocaleExtraDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth): string[];
  787. /**
  788. * Retrieves the first day of the week for the given locale.
  789. *
  790. * @param locale A locale code for the locale format rules to use.
  791. * @returns A day index number, using the 0-based week-day index for `en-US`
  792. * (Sunday = 0, Monday = 1, ...).
  793. * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.
  794. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  795. *
  796. * @publicApi
  797. */
  798. export declare function getLocaleFirstDayOfWeek(locale: string): WeekDay;
  799. /**
  800. * Retrieves the locale ID from the currently loaded locale.
  801. * The loaded locale could be, for example, a global one rather than a regional one.
  802. * @param locale A locale code, such as `fr-FR`.
  803. * @returns The locale code. For example, `fr`.
  804. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  805. *
  806. * @publicApi
  807. */
  808. export declare function getLocaleId(locale: string): string;
  809. /**
  810. * Retrieves months of the year for the given locale, using the Gregorian calendar.
  811. *
  812. * @param locale A locale code for the locale format rules to use.
  813. * @param formStyle The required grammatical form.
  814. * @param width The required character width.
  815. * @returns An array of localized name strings.
  816. * For example, `[January, February, ...]` for `en-US`.
  817. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  818. *
  819. * @publicApi
  820. */
  821. export declare function getLocaleMonthNames(locale: string, formStyle: FormStyle, width: TranslationWidth): ReadonlyArray<string>;
  822. /**
  823. * Retrieves a number format for a given locale.
  824. *
  825. * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`
  826. * when used to format the number 12345.678 could result in "12'345,678". That would happen if the
  827. * grouping separator for your language is an apostrophe, and the decimal separator is a comma.
  828. *
  829. * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders
  830. * that stand for the decimal separator, and so on, and are NOT real characters.
  831. * You must NOT "translate" the placeholders. For example, don't change `.` to `,` even though in
  832. * your language the decimal point is written with a comma. The symbols should be replaced by the
  833. * local equivalents, using the appropriate `NumberSymbol` for your language.
  834. *
  835. * Here are the special characters used in number patterns:
  836. *
  837. * | Symbol | Meaning |
  838. * |--------|---------|
  839. * | . | Replaced automatically by the character used for the decimal point. |
  840. * | , | Replaced by the "grouping" (thousands) separator. |
  841. * | 0 | Replaced by a digit (or zero if there aren't enough digits). |
  842. * | # | Replaced by a digit (or nothing if there aren't enough). |
  843. * | ¤ | Replaced by a currency symbol, such as $ or USD. |
  844. * | % | Marks a percent format. The % symbol may change position, but must be retained. |
  845. * | E | Marks a scientific format. The E symbol may change position, but must be retained. |
  846. * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |
  847. *
  848. * @param locale A locale code for the locale format rules to use.
  849. * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)
  850. * @returns The localized format string.
  851. * @see `NumberFormatStyle`
  852. * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)
  853. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  854. *
  855. * @publicApi
  856. */
  857. export declare function getLocaleNumberFormat(locale: string, type: NumberFormatStyle): string;
  858. /**
  859. * Retrieves a localized number symbol that can be used to replace placeholders in number formats.
  860. * @param locale The locale code.
  861. * @param symbol The symbol to localize.
  862. * @returns The character for the localized symbol.
  863. * @see `NumberSymbol`
  864. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  865. *
  866. * @publicApi
  867. */
  868. export declare function getLocaleNumberSymbol(locale: string, symbol: NumberSymbol): string;
  869. /**
  870. * @alias core/ɵgetLocalePluralCase
  871. * @publicApi
  872. */
  873. export declare const getLocalePluralCase: (locale: string) => ((value: number) => Plural);
  874. /**
  875. * Retrieves a localized time-value formatting string.
  876. *
  877. * @param locale A locale code for the locale format rules to use.
  878. * @param width The format type.
  879. * @returns The localized formatting string.
  880. * @see `FormatWidth`
  881. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  882. * @publicApi
  883. */
  884. export declare function getLocaleTimeFormat(locale: string, width: FormatWidth): string;
  885. /**
  886. * Range of week days that are considered the week-end for the given locale.
  887. *
  888. * @param locale A locale code for the locale format rules to use.
  889. * @returns The range of day values, `[startDay, endDay]`.
  890. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  891. *
  892. * @publicApi
  893. */
  894. export declare function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay];
  895. /**
  896. * Reports the number of decimal digits for a given currency.
  897. * The value depends upon the presence of cents in that particular currency.
  898. *
  899. * @param code The currency code.
  900. * @returns The number of decimal digits, typically 0 or 2.
  901. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  902. *
  903. * @publicApi
  904. */
  905. export declare function getNumberOfCurrencyDigits(code: string): number;
  906. /**
  907. * @description
  908. * A {@link LocationStrategy} used to configure the {@link Location} service to
  909. * represent its state in the
  910. * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
  911. * of the browser's URL.
  912. *
  913. * For instance, if you call `location.go('/foo')`, the browser's URL will become
  914. * `example.com#/foo`.
  915. *
  916. * @usageNotes
  917. *
  918. * ### Example
  919. *
  920. * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}
  921. *
  922. * @publicApi
  923. */
  924. export declare class HashLocationStrategy extends LocationStrategy implements OnDestroy {
  925. private _platformLocation;
  926. private _baseHref;
  927. private _removeListenerFns;
  928. constructor(_platformLocation: PlatformLocation, _baseHref?: string);
  929. /** @nodoc */
  930. ngOnDestroy(): void;
  931. onPopState(fn: LocationChangeListener): void;
  932. getBaseHref(): string;
  933. path(includeHash?: boolean): string;
  934. prepareExternalUrl(internal: string): string;
  935. pushState(state: any, title: string, path: string, queryParams: string): void;
  936. replaceState(state: any, title: string, path: string, queryParams: string): void;
  937. forward(): void;
  938. back(): void;
  939. getState(): unknown;
  940. historyGo(relativePosition?: number): void;
  941. static ɵfac: i0.ɵɵFactoryDeclaration<HashLocationStrategy, [null, { optional: true; }]>;
  942. static ɵprov: i0.ɵɵInjectableDeclaration<HashLocationStrategy>;
  943. }
  944. declare namespace i1 {
  945. export {
  946. NgClass
  947. }
  948. }
  949. declare namespace i10 {
  950. export {
  951. LowerCasePipe,
  952. TitleCasePipe,
  953. UpperCasePipe
  954. }
  955. }
  956. declare namespace i11 {
  957. export {
  958. JsonPipe
  959. }
  960. }
  961. declare namespace i12 {
  962. export {
  963. SlicePipe
  964. }
  965. }
  966. declare namespace i13 {
  967. export {
  968. DecimalPipe,
  969. PercentPipe,
  970. CurrencyPipe
  971. }
  972. }
  973. declare namespace i14 {
  974. export {
  975. DATE_PIPE_DEFAULT_TIMEZONE,
  976. DATE_PIPE_DEFAULT_OPTIONS,
  977. DatePipe
  978. }
  979. }
  980. declare namespace i15 {
  981. export {
  982. I18nPluralPipe
  983. }
  984. }
  985. declare namespace i16 {
  986. export {
  987. I18nSelectPipe
  988. }
  989. }
  990. declare namespace i17 {
  991. export {
  992. defaultComparator,
  993. KeyValue,
  994. KeyValuePipe
  995. }
  996. }
  997. /**
  998. * @ngModule CommonModule
  999. * @description
  1000. *
  1001. * Maps a value to a string that pluralizes the value according to locale rules.
  1002. *
  1003. * @usageNotes
  1004. *
  1005. * ### Example
  1006. *
  1007. * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
  1008. *
  1009. * @publicApi
  1010. */
  1011. export declare class I18nPluralPipe implements PipeTransform {
  1012. private _localization;
  1013. constructor(_localization: NgLocalization);
  1014. /**
  1015. * @param value the number to be formatted
  1016. * @param pluralMap an object that mimics the ICU format, see
  1017. * https://unicode-org.github.io/icu/userguide/format_parse/messages/.
  1018. * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
  1019. * default).
  1020. */
  1021. transform(value: number | null | undefined, pluralMap: {
  1022. [count: string]: string;
  1023. }, locale?: string): string;
  1024. static ɵfac: i0.ɵɵFactoryDeclaration<I18nPluralPipe, never>;
  1025. static ɵpipe: i0.ɵɵPipeDeclaration<I18nPluralPipe, "i18nPlural", true>;
  1026. }
  1027. /**
  1028. * @ngModule CommonModule
  1029. * @description
  1030. *
  1031. * Generic selector that displays the string that matches the current value.
  1032. *
  1033. * If none of the keys of the `mapping` match the `value`, then the content
  1034. * of the `other` key is returned when present, otherwise an empty string is returned.
  1035. *
  1036. * @usageNotes
  1037. *
  1038. * ### Example
  1039. *
  1040. * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
  1041. *
  1042. * @publicApi
  1043. */
  1044. export declare class I18nSelectPipe implements PipeTransform {
  1045. /**
  1046. * @param value a string to be internationalized.
  1047. * @param mapping an object that indicates the text that should be displayed
  1048. * for different values of the provided `value`.
  1049. */
  1050. transform(value: string | null | undefined, mapping: {
  1051. [key: string]: string;
  1052. }): string;
  1053. static ɵfac: i0.ɵɵFactoryDeclaration<I18nSelectPipe, never>;
  1054. static ɵpipe: i0.ɵɵPipeDeclaration<I18nSelectPipe, "i18nSelect", true>;
  1055. }
  1056. declare namespace i2 {
  1057. export {
  1058. NgComponentOutlet
  1059. }
  1060. }
  1061. declare namespace i3 {
  1062. export {
  1063. NgForOfContext,
  1064. NgForOf,
  1065. NgForOf as NgFor
  1066. }
  1067. }
  1068. declare namespace i4 {
  1069. export {
  1070. NgIf,
  1071. NgIfContext
  1072. }
  1073. }
  1074. declare namespace i5 {
  1075. export {
  1076. NgTemplateOutlet
  1077. }
  1078. }
  1079. declare namespace i6 {
  1080. export {
  1081. NgStyle
  1082. }
  1083. }
  1084. declare namespace i7 {
  1085. export {
  1086. SwitchView,
  1087. NgSwitch,
  1088. NgSwitchCase,
  1089. NgSwitchDefault
  1090. }
  1091. }
  1092. declare namespace i8 {
  1093. export {
  1094. NgPlural,
  1095. NgPluralCase
  1096. }
  1097. }
  1098. declare namespace i9 {
  1099. export {
  1100. AsyncPipe
  1101. }
  1102. }
  1103. /**
  1104. * Injection token that configures the image optimized image functionality.
  1105. *
  1106. * @see `NgOptimizedImage`
  1107. * @publicApi
  1108. * @developerPreview
  1109. */
  1110. export declare const IMAGE_CONFIG: InjectionToken<ImageConfig>;
  1111. /**
  1112. * Injection token that configures the image loader function.
  1113. *
  1114. * @see `ImageLoader`
  1115. * @see `NgOptimizedImage`
  1116. * @publicApi
  1117. */
  1118. export declare const IMAGE_LOADER: InjectionToken<ImageLoader>;
  1119. /**
  1120. * A configuration object for the NgOptimizedImage directive. Contains:
  1121. * - breakpoints: An array of integer breakpoints used to generate
  1122. * srcsets for responsive images.
  1123. *
  1124. * Learn more about the responsive image configuration in [the NgOptimizedImage
  1125. * guide](guide/image-directive).
  1126. * @publicApi
  1127. * @developerPreview
  1128. */
  1129. export declare type ImageConfig = {
  1130. breakpoints?: number[];
  1131. };
  1132. /**
  1133. * Represents an image loader function. Image loader functions are used by the
  1134. * NgOptimizedImage directive to produce full image URL based on the image name and its width.
  1135. *
  1136. * @publicApi
  1137. */
  1138. export declare type ImageLoader = (config: ImageLoaderConfig) => string;
  1139. /**
  1140. * Config options recognized by the image loader function.
  1141. *
  1142. * @see `ImageLoader`
  1143. * @see `NgOptimizedImage`
  1144. * @publicApi
  1145. */
  1146. export declare interface ImageLoaderConfig {
  1147. /**
  1148. * Image file name to be added to the image request URL.
  1149. */
  1150. src: string;
  1151. /**
  1152. * Width of the requested image (to be used when generating srcset).
  1153. */
  1154. width?: number;
  1155. /**
  1156. * Additional user-provided parameters for use by the ImageLoader.
  1157. */
  1158. loaderParams?: {
  1159. [key: string]: any;
  1160. };
  1161. }
  1162. /**
  1163. * Returns whether a platform id represents a browser platform.
  1164. * @publicApi
  1165. */
  1166. export declare function isPlatformBrowser(platformId: Object): boolean;
  1167. /**
  1168. * Returns whether a platform id represents a server platform.
  1169. * @publicApi
  1170. */
  1171. export declare function isPlatformServer(platformId: Object): boolean;
  1172. /**
  1173. * Returns whether a platform id represents a web worker app platform.
  1174. * @publicApi
  1175. * @deprecated This function serves no purpose since the removal of the Webworker platform. It will
  1176. * always return `false`.
  1177. */
  1178. export declare function isPlatformWorkerApp(platformId: Object): boolean;
  1179. /**
  1180. * Returns whether a platform id represents a web worker UI platform.
  1181. * @publicApi
  1182. * @deprecated This function serves no purpose since the removal of the Webworker platform. It will
  1183. * always return `false`.
  1184. */
  1185. export declare function isPlatformWorkerUi(platformId: Object): boolean;
  1186. /**
  1187. * @ngModule CommonModule
  1188. * @description
  1189. *
  1190. * Converts a value into its JSON-format representation. Useful for debugging.
  1191. *
  1192. * @usageNotes
  1193. *
  1194. * The following component uses a JSON pipe to convert an object
  1195. * to JSON format, and displays the string in both formats for comparison.
  1196. *
  1197. * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
  1198. *
  1199. * @publicApi
  1200. */
  1201. export declare class JsonPipe implements PipeTransform {
  1202. /**
  1203. * @param value A value of any type to convert into a JSON-format string.
  1204. */
  1205. transform(value: any): string;
  1206. static ɵfac: i0.ɵɵFactoryDeclaration<JsonPipe, never>;
  1207. static ɵpipe: i0.ɵɵPipeDeclaration<JsonPipe, "json", true>;
  1208. }
  1209. /**
  1210. * A key value pair.
  1211. * Usually used to represent the key value pairs from a Map or Object.
  1212. *
  1213. * @publicApi
  1214. */
  1215. export declare interface KeyValue<K, V> {
  1216. key: K;
  1217. value: V;
  1218. }
  1219. /**
  1220. * @ngModule CommonModule
  1221. * @description
  1222. *
  1223. * Transforms Object or Map into an array of key value pairs.
  1224. *
  1225. * The output array will be ordered by keys.
  1226. * By default the comparator will be by Unicode point value.
  1227. * You can optionally pass a compareFn if your keys are complex types.
  1228. *
  1229. * @usageNotes
  1230. * ### Examples
  1231. *
  1232. * This examples show how an Object or a Map can be iterated by ngFor with the use of this
  1233. * keyvalue pipe.
  1234. *
  1235. * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
  1236. *
  1237. * @publicApi
  1238. */
  1239. export declare class KeyValuePipe implements PipeTransform {
  1240. private readonly differs;
  1241. constructor(differs: KeyValueDiffers);
  1242. private differ;
  1243. private keyValues;
  1244. private compareFn;
  1245. transform<K, V>(input: ReadonlyMap<K, V>, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): Array<KeyValue<K, V>>;
  1246. transform<K extends number, V>(input: Record<K, V>, compareFn?: (a: KeyValue<string, V>, b: KeyValue<string, V>) => number): Array<KeyValue<string, V>>;
  1247. transform<K extends string, V>(input: Record<K, V> | ReadonlyMap<K, V>, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): Array<KeyValue<K, V>>;
  1248. transform(input: null | undefined, compareFn?: (a: KeyValue<unknown, unknown>, b: KeyValue<unknown, unknown>) => number): null;
  1249. transform<K, V>(input: ReadonlyMap<K, V> | null | undefined, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): Array<KeyValue<K, V>> | null;
  1250. transform<K extends number, V>(input: Record<K, V> | null | undefined, compareFn?: (a: KeyValue<string, V>, b: KeyValue<string, V>) => number): Array<KeyValue<string, V>> | null;
  1251. transform<K extends string, V>(input: Record<K, V> | ReadonlyMap<K, V> | null | undefined, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): Array<KeyValue<K, V>> | null;
  1252. static ɵfac: i0.ɵɵFactoryDeclaration<KeyValuePipe, never>;
  1253. static ɵpipe: i0.ɵɵPipeDeclaration<KeyValuePipe, "keyvalue", true>;
  1254. }
  1255. /**
  1256. * @description
  1257. *
  1258. * A service that applications can use to interact with a browser's URL.
  1259. *
  1260. * Depending on the `LocationStrategy` used, `Location` persists
  1261. * to the URL's path or the URL's hash segment.
  1262. *
  1263. * @usageNotes
  1264. *
  1265. * It's better to use the `Router.navigate()` service to trigger route changes. Use
  1266. * `Location` only if you need to interact with or create normalized URLs outside of
  1267. * routing.
  1268. *
  1269. * `Location` is responsible for normalizing the URL against the application's base href.
  1270. * A normalized URL is absolute from the URL host, includes the application's base href, and has no
  1271. * trailing slash:
  1272. * - `/my/app/user/123` is normalized
  1273. * - `my/app/user/123` **is not** normalized
  1274. * - `/my/app/user/123/` **is not** normalized
  1275. *
  1276. * ### Example
  1277. *
  1278. * <code-example path='common/location/ts/path_location_component.ts'
  1279. * region='LocationComponent'></code-example>
  1280. *
  1281. * @publicApi
  1282. */
  1283. declare class Location_2 implements OnDestroy {
  1284. constructor(locationStrategy: LocationStrategy);
  1285. /** @nodoc */
  1286. ngOnDestroy(): void;
  1287. /**
  1288. * Normalizes the URL path for this location.
  1289. *
  1290. * @param includeHash True to include an anchor fragment in the path.
  1291. *
  1292. * @returns The normalized URL path.
  1293. */
  1294. path(includeHash?: boolean): string;
  1295. /**
  1296. * Reports the current state of the location history.
  1297. * @returns The current value of the `history.state` object.
  1298. */
  1299. getState(): unknown;
  1300. /**
  1301. * Normalizes the given path and compares to the current normalized path.
  1302. *
  1303. * @param path The given URL path.
  1304. * @param query Query parameters.
  1305. *
  1306. * @returns True if the given URL path is equal to the current normalized path, false
  1307. * otherwise.
  1308. */
  1309. isCurrentPathEqualTo(path: string, query?: string): boolean;
  1310. /**
  1311. * Normalizes a URL path by stripping any trailing slashes.
  1312. *
  1313. * @param url String representing a URL.
  1314. *
  1315. * @returns The normalized URL string.
  1316. */
  1317. normalize(url: string): string;
  1318. /**
  1319. * Normalizes an external URL path.
  1320. * If the given URL doesn't begin with a leading slash (`'/'`), adds one
  1321. * before normalizing. Adds a hash if `HashLocationStrategy` is
  1322. * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
  1323. *
  1324. * @param url String representing a URL.
  1325. *
  1326. * @returns A normalized platform-specific URL.
  1327. */
  1328. prepareExternalUrl(url: string): string;
  1329. /**
  1330. * Changes the browser's URL to a normalized version of a given URL, and pushes a
  1331. * new item onto the platform's history.
  1332. *
  1333. * @param path URL path to normalize.
  1334. * @param query Query parameters.
  1335. * @param state Location history state.
  1336. *
  1337. */
  1338. go(path: string, query?: string, state?: any): void;
  1339. /**
  1340. * Changes the browser's URL to a normalized version of the given URL, and replaces
  1341. * the top item on the platform's history stack.
  1342. *
  1343. * @param path URL path to normalize.
  1344. * @param query Query parameters.
  1345. * @param state Location history state.
  1346. */
  1347. replaceState(path: string, query?: string, state?: any): void;
  1348. /**
  1349. * Navigates forward in the platform's history.
  1350. */
  1351. forward(): void;
  1352. /**
  1353. * Navigates back in the platform's history.
  1354. */
  1355. back(): void;
  1356. /**
  1357. * Navigate to a specific page from session history, identified by its relative position to the
  1358. * current page.
  1359. *
  1360. * @param relativePosition Position of the target page in the history relative to the current
  1361. * page.
  1362. * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
  1363. * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
  1364. * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
  1365. * when `relativePosition` equals 0.
  1366. * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
  1367. */
  1368. historyGo(relativePosition?: number): void;
  1369. /**
  1370. * Registers a URL change listener. Use to catch updates performed by the Angular
  1371. * framework that are not detectible through "popstate" or "hashchange" events.
  1372. *
  1373. * @param fn The change handler function, which take a URL and a location history state.
  1374. * @returns A function that, when executed, unregisters a URL change listener.
  1375. */
  1376. onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
  1377. /**
  1378. * Subscribes to the platform's `popState` events.
  1379. *
  1380. * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
  1381. * `Location.onUrlChange()` to subscribe to URL changes instead.
  1382. *
  1383. * @param value Event that is triggered when the state history changes.
  1384. * @param exception The exception to throw.
  1385. *
  1386. * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
  1387. *
  1388. * @returns Subscribed events.
  1389. */
  1390. subscribe(onNext: (value: PopStateEvent_2) => void, onThrow?: ((exception: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
  1391. /**
  1392. * Normalizes URL parameters by prepending with `?` if needed.
  1393. *
  1394. * @param params String of URL parameters.
  1395. *
  1396. * @returns The normalized URL parameters string.
  1397. */
  1398. static normalizeQueryParams: (params: string) => string;
  1399. /**
  1400. * Joins two parts of a URL with a slash if needed.
  1401. *
  1402. * @param start URL string
  1403. * @param end URL string
  1404. *
  1405. *
  1406. * @returns The joined URL string.
  1407. */
  1408. static joinWithSlash: (start: string, end: string) => string;
  1409. /**
  1410. * Removes a trailing slash from a URL string if needed.
  1411. * Looks for the first occurrence of either `#`, `?`, or the end of the
  1412. * line as `/` characters and removes the trailing slash if one exists.
  1413. *
  1414. * @param url URL string.
  1415. *
  1416. * @returns The URL string, modified if needed.
  1417. */
  1418. static stripTrailingSlash: (url: string) => string;
  1419. static ɵfac: i0.ɵɵFactoryDeclaration<Location_2, never>;
  1420. static ɵprov: i0.ɵɵInjectableDeclaration<Location_2>;
  1421. }
  1422. export { Location_2 as Location }
  1423. /**
  1424. * @description
  1425. * Indicates when a location is initialized.
  1426. *
  1427. * @publicApi
  1428. */
  1429. export declare const LOCATION_INITIALIZED: InjectionToken<Promise<any>>;
  1430. /**
  1431. * @description
  1432. * A serializable version of the event from `onPopState` or `onHashChange`
  1433. *
  1434. * @publicApi
  1435. */
  1436. export declare interface LocationChangeEvent {
  1437. type: string;
  1438. state: any;
  1439. }
  1440. /**
  1441. * @publicApi
  1442. */
  1443. export declare interface LocationChangeListener {
  1444. (event: LocationChangeEvent): any;
  1445. }
  1446. /**
  1447. * Enables the `Location` service to read route state from the browser's URL.
  1448. * Angular provides two strategies:
  1449. * `HashLocationStrategy` and `PathLocationStrategy`.
  1450. *
  1451. * Applications should use the `Router` or `Location` services to
  1452. * interact with application route state.
  1453. *
  1454. * For instance, `HashLocationStrategy` produces URLs like
  1455. * <code class="no-auto-link">http://example.com#/foo</code>,
  1456. * and `PathLocationStrategy` produces
  1457. * <code class="no-auto-link">http://example.com/foo</code> as an equivalent URL.
  1458. *
  1459. * See these two classes for more.
  1460. *
  1461. * @publicApi
  1462. */
  1463. export declare abstract class LocationStrategy {
  1464. abstract path(includeHash?: boolean): string;
  1465. abstract prepareExternalUrl(internal: string): string;
  1466. abstract getState(): unknown;
  1467. abstract pushState(state: any, title: string, url: string, queryParams: string): void;
  1468. abstract replaceState(state: any, title: string, url: string, queryParams: string): void;
  1469. abstract forward(): void;
  1470. abstract back(): void;
  1471. historyGo?(relativePosition: number): void;
  1472. abstract onPopState(fn: LocationChangeListener): void;
  1473. abstract getBaseHref(): string;
  1474. static ɵfac: i0.ɵɵFactoryDeclaration<LocationStrategy, never>;
  1475. static ɵprov: i0.ɵɵInjectableDeclaration<LocationStrategy>;
  1476. }
  1477. /**
  1478. * Transforms text to all lower case.
  1479. *
  1480. * @see `UpperCasePipe`
  1481. * @see `TitleCasePipe`
  1482. * @usageNotes
  1483. *
  1484. * The following example defines a view that allows the user to enter
  1485. * text, and then uses the pipe to convert the input text to all lower case.
  1486. *
  1487. * <code-example path="common/pipes/ts/lowerupper_pipe.ts" region='LowerUpperPipe'></code-example>
  1488. *
  1489. * @ngModule CommonModule
  1490. * @publicApi
  1491. */
  1492. export declare class LowerCasePipe implements PipeTransform {
  1493. /**
  1494. * @param value The string to transform to lower case.
  1495. */
  1496. transform(value: string): string;
  1497. transform(value: null | undefined): null;
  1498. transform(value: string | null | undefined): string | null;
  1499. static ɵfac: i0.ɵɵFactoryDeclaration<LowerCasePipe, never>;
  1500. static ɵpipe: i0.ɵɵPipeDeclaration<LowerCasePipe, "lowercase", true>;
  1501. }
  1502. /**
  1503. * @ngModule CommonModule
  1504. *
  1505. * @usageNotes
  1506. * ```
  1507. * <some-element [ngClass]="'first second'">...</some-element>
  1508. *
  1509. * <some-element [ngClass]="['first', 'second']">...</some-element>
  1510. *
  1511. * <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
  1512. *
  1513. * <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
  1514. *
  1515. * <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
  1516. * ```
  1517. *
  1518. * @description
  1519. *
  1520. * Adds and removes CSS classes on an HTML element.
  1521. *
  1522. * The CSS classes are updated as follows, depending on the type of the expression evaluation:
  1523. * - `string` - the CSS classes listed in the string (space delimited) are added,
  1524. * - `Array` - the CSS classes declared as Array elements are added,
  1525. * - `Object` - keys are CSS classes that get added when the expression given in the value
  1526. * evaluates to a truthy value, otherwise they are removed.
  1527. *
  1528. * @publicApi
  1529. */
  1530. export declare class NgClass implements DoCheck {
  1531. private _iterableDiffers;
  1532. private _keyValueDiffers;
  1533. private _ngEl;
  1534. private _renderer;
  1535. private initialClasses;
  1536. private rawClass;
  1537. private stateMap;
  1538. constructor(_iterableDiffers: IterableDiffers, _keyValueDiffers: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer2);
  1539. set klass(value: string);
  1540. set ngClass(value: string | string[] | Set<string> | {
  1541. [klass: string]: any;
  1542. } | null | undefined);
  1543. ngDoCheck(): void;
  1544. private _updateState;
  1545. private _applyStateDiff;
  1546. private _toggleClass;
  1547. static ɵfac: i0.ɵɵFactoryDeclaration<NgClass, never>;
  1548. static ɵdir: i0.ɵɵDirectiveDeclaration<NgClass, "[ngClass]", never, { "klass": { "alias": "class"; "required": false; }; "ngClass": { "alias": "ngClass"; "required": false; }; }, {}, never, never, true, never>;
  1549. }
  1550. /**
  1551. * Instantiates a {@link Component} type and inserts its Host View into the current View.
  1552. * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
  1553. *
  1554. * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
  1555. * any existing component will be destroyed.
  1556. *
  1557. * @usageNotes
  1558. *
  1559. * ### Fine tune control
  1560. *
  1561. * You can control the component creation process by using the following optional attributes:
  1562. *
  1563. * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
  1564. * the Component. Defaults to the injector of the current view container.
  1565. *
  1566. * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
  1567. * section of the component, if it exists.
  1568. *
  1569. * * `ngComponentOutletNgModule`: Optional NgModule class reference to allow loading another
  1570. * module dynamically, then loading a component from that module.
  1571. *
  1572. * * `ngComponentOutletNgModuleFactory`: Deprecated config option that allows providing optional
  1573. * NgModule factory to allow loading another module dynamically, then loading a component from that
  1574. * module. Use `ngComponentOutletNgModule` instead.
  1575. *
  1576. * ### Syntax
  1577. *
  1578. * Simple
  1579. * ```
  1580. * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
  1581. * ```
  1582. *
  1583. * Customized injector/content
  1584. * ```
  1585. * <ng-container *ngComponentOutlet="componentTypeExpression;
  1586. * injector: injectorExpression;
  1587. * content: contentNodesExpression;">
  1588. * </ng-container>
  1589. * ```
  1590. *
  1591. * Customized NgModule reference
  1592. * ```
  1593. * <ng-container *ngComponentOutlet="componentTypeExpression;
  1594. * ngModule: ngModuleClass;">
  1595. * </ng-container>
  1596. * ```
  1597. *
  1598. * ### A simple example
  1599. *
  1600. * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
  1601. *
  1602. * A more complete example with additional options:
  1603. *
  1604. * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
  1605. *
  1606. * @publicApi
  1607. * @ngModule CommonModule
  1608. */
  1609. export declare class NgComponentOutlet implements OnChanges, OnDestroy {
  1610. private _viewContainerRef;
  1611. ngComponentOutlet: Type<any> | null;
  1612. ngComponentOutletInjector?: Injector;
  1613. ngComponentOutletContent?: any[][];
  1614. ngComponentOutletNgModule?: Type<any>;
  1615. /**
  1616. * @deprecated This input is deprecated, use `ngComponentOutletNgModule` instead.
  1617. */
  1618. ngComponentOutletNgModuleFactory?: NgModuleFactory<any>;
  1619. private _componentRef;
  1620. private _moduleRef;
  1621. constructor(_viewContainerRef: ViewContainerRef);
  1622. /** @nodoc */
  1623. ngOnChanges(changes: SimpleChanges): void;
  1624. /** @nodoc */
  1625. ngOnDestroy(): void;
  1626. static ɵfac: i0.ɵɵFactoryDeclaration<NgComponentOutlet, never>;
  1627. static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutlet, "[ngComponentOutlet]", never, { "ngComponentOutlet": { "alias": "ngComponentOutlet"; "required": false; }; "ngComponentOutletInjector": { "alias": "ngComponentOutletInjector"; "required": false; }; "ngComponentOutletContent": { "alias": "ngComponentOutletContent"; "required": false; }; "ngComponentOutletNgModule": { "alias": "ngComponentOutletNgModule"; "required": false; }; "ngComponentOutletNgModuleFactory": { "alias": "ngComponentOutletNgModuleFactory"; "required": false; }; }, {}, never, never, true, never>;
  1628. }
  1629. /**
  1630. * A [structural directive](guide/structural-directives) that renders
  1631. * a template for each item in a collection.
  1632. * The directive is placed on an element, which becomes the parent
  1633. * of the cloned templates.
  1634. *
  1635. * The `ngForOf` directive is generally used in the
  1636. * [shorthand form](guide/structural-directives#asterisk) `*ngFor`.
  1637. * In this form, the template to be rendered for each iteration is the content
  1638. * of an anchor element containing the directive.
  1639. *
  1640. * The following example shows the shorthand syntax with some options,
  1641. * contained in an `<li>` element.
  1642. *
  1643. * ```
  1644. * <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
  1645. * ```
  1646. *
  1647. * The shorthand form expands into a long form that uses the `ngForOf` selector
  1648. * on an `<ng-template>` element.
  1649. * The content of the `<ng-template>` element is the `<li>` element that held the
  1650. * short-form directive.
  1651. *
  1652. * Here is the expanded version of the short-form example.
  1653. *
  1654. * ```
  1655. * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
  1656. * <li>...</li>
  1657. * </ng-template>
  1658. * ```
  1659. *
  1660. * Angular automatically expands the shorthand syntax as it compiles the template.
  1661. * The context for each embedded view is logically merged to the current component
  1662. * context according to its lexical position.
  1663. *
  1664. * When using the shorthand syntax, Angular allows only [one structural directive
  1665. * on an element](guide/structural-directives#one-per-element).
  1666. * If you want to iterate conditionally, for example,
  1667. * put the `*ngIf` on a container element that wraps the `*ngFor` element.
  1668. * For further discussion, see
  1669. * [Structural Directives](guide/structural-directives#one-per-element).
  1670. *
  1671. * @usageNotes
  1672. *
  1673. * ### Local variables
  1674. *
  1675. * `NgForOf` provides exported values that can be aliased to local variables.
  1676. * For example:
  1677. *
  1678. * ```
  1679. * <li *ngFor="let user of users; index as i; first as isFirst">
  1680. * {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
  1681. * </li>
  1682. * ```
  1683. *
  1684. * The following exported values can be aliased to local variables:
  1685. *
  1686. * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
  1687. * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
  1688. * more complex then a property access, for example when using the async pipe (`userStreams |
  1689. * async`).
  1690. * - `index: number`: The index of the current item in the iterable.
  1691. * - `count: number`: The length of the iterable.
  1692. * - `first: boolean`: True when the item is the first item in the iterable.
  1693. * - `last: boolean`: True when the item is the last item in the iterable.
  1694. * - `even: boolean`: True when the item has an even index in the iterable.
  1695. * - `odd: boolean`: True when the item has an odd index in the iterable.
  1696. *
  1697. * ### Change propagation
  1698. *
  1699. * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
  1700. *
  1701. * * When an item is added, a new instance of the template is added to the DOM.
  1702. * * When an item is removed, its template instance is removed from the DOM.
  1703. * * When items are reordered, their respective templates are reordered in the DOM.
  1704. *
  1705. * Angular uses object identity to track insertions and deletions within the iterator and reproduce
  1706. * those changes in the DOM. This has important implications for animations and any stateful
  1707. * controls that are present, such as `<input>` elements that accept user input. Inserted rows can
  1708. * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
  1709. * such as user input.
  1710. * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).
  1711. *
  1712. * The identities of elements in the iterator can change while the data does not.
  1713. * This can happen, for example, if the iterator is produced from an RPC to the server, and that
  1714. * RPC is re-run. Even if the data hasn't changed, the second response produces objects with
  1715. * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old
  1716. * elements were deleted and all new elements inserted).
  1717. *
  1718. * To avoid this expensive operation, you can customize the default tracking algorithm.
  1719. * by supplying the `trackBy` option to `NgForOf`.
  1720. * `trackBy` takes a function that has two arguments: `index` and `item`.
  1721. * If `trackBy` is given, Angular tracks changes by the return value of the function.
  1722. *
  1723. * @see [Structural Directives](guide/structural-directives)
  1724. * @ngModule CommonModule
  1725. * @publicApi
  1726. */
  1727. declare class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> implements DoCheck {
  1728. private _viewContainer;
  1729. private _template;
  1730. private _differs;
  1731. /**
  1732. * The value of the iterable expression, which can be used as a
  1733. * [template input variable](guide/structural-directives#shorthand).
  1734. */
  1735. set ngForOf(ngForOf: U & NgIterable<T> | undefined | null);
  1736. /**
  1737. * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
  1738. *
  1739. * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
  1740. * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
  1741. * as the key.
  1742. *
  1743. * `NgForOf` uses the computed key to associate items in an iterable with DOM elements
  1744. * it produces for these items.
  1745. *
  1746. * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
  1747. * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
  1748. * primary key), and this iterable could be updated with new object instances that still
  1749. * represent the same underlying entity (for example, when data is re-fetched from the server,
  1750. * and the iterable is recreated and re-rendered, but most of the data is still the same).
  1751. *
  1752. * @see `TrackByFunction`
  1753. */
  1754. set ngForTrackBy(fn: TrackByFunction<T>);
  1755. get ngForTrackBy(): TrackByFunction<T>;
  1756. private _ngForOf;
  1757. private _ngForOfDirty;
  1758. private _differ;
  1759. private _trackByFn;
  1760. constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<NgForOfContext<T, U>>, _differs: IterableDiffers);
  1761. /**
  1762. * A reference to the template that is stamped out for each item in the iterable.
  1763. * @see [template reference variable](guide/template-reference-variables)
  1764. */
  1765. set ngForTemplate(value: TemplateRef<NgForOfContext<T, U>>);
  1766. /**
  1767. * Applies the changes when needed.
  1768. * @nodoc
  1769. */
  1770. ngDoCheck(): void;
  1771. private _applyChanges;
  1772. /**
  1773. * Asserts the correct type of the context for the template that `NgForOf` will render.
  1774. *
  1775. * The presence of this method is a signal to the Ivy template type-check compiler that the
  1776. * `NgForOf` structural directive renders its template with a specific context type.
  1777. */
  1778. static ngTemplateContextGuard<T, U extends NgIterable<T>>(dir: NgForOf<T, U>, ctx: any): ctx is NgForOfContext<T, U>;
  1779. static ɵfac: i0.ɵɵFactoryDeclaration<NgForOf<any, any>, never>;
  1780. static ɵdir: i0.ɵɵDirectiveDeclaration<NgForOf<any, any>, "[ngFor][ngForOf]", never, { "ngForOf": { "alias": "ngForOf"; "required": false; }; "ngForTrackBy": { "alias": "ngForTrackBy"; "required": false; }; "ngForTemplate": { "alias": "ngForTemplate"; "required": false; }; }, {}, never, never, true, never>;
  1781. }
  1782. export { NgForOf as NgFor }
  1783. export { NgForOf }
  1784. /**
  1785. * @publicApi
  1786. */
  1787. export declare class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
  1788. $implicit: T;
  1789. ngForOf: U;
  1790. index: number;
  1791. count: number;
  1792. constructor($implicit: T, ngForOf: U, index: number, count: number);
  1793. get first(): boolean;
  1794. get last(): boolean;
  1795. get even(): boolean;
  1796. get odd(): boolean;
  1797. }
  1798. /**
  1799. * A structural directive that conditionally includes a template based on the value of
  1800. * an expression coerced to Boolean.
  1801. * When the expression evaluates to true, Angular renders the template
  1802. * provided in a `then` clause, and when false or null,
  1803. * Angular renders the template provided in an optional `else` clause. The default
  1804. * template for the `else` clause is blank.
  1805. *
  1806. * A [shorthand form](guide/structural-directives#asterisk) of the directive,
  1807. * `*ngIf="condition"`, is generally used, provided
  1808. * as an attribute of the anchor element for the inserted template.
  1809. * Angular expands this into a more explicit version, in which the anchor element
  1810. * is contained in an `<ng-template>` element.
  1811. *
  1812. * Simple form with shorthand syntax:
  1813. *
  1814. * ```
  1815. * <div *ngIf="condition">Content to render when condition is true.</div>
  1816. * ```
  1817. *
  1818. * Simple form with expanded syntax:
  1819. *
  1820. * ```
  1821. * <ng-template [ngIf]="condition"><div>Content to render when condition is
  1822. * true.</div></ng-template>
  1823. * ```
  1824. *
  1825. * Form with an "else" block:
  1826. *
  1827. * ```
  1828. * <div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
  1829. * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
  1830. * ```
  1831. *
  1832. * Shorthand form with "then" and "else" blocks:
  1833. *
  1834. * ```
  1835. * <div *ngIf="condition; then thenBlock else elseBlock"></div>
  1836. * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
  1837. * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
  1838. * ```
  1839. *
  1840. * Form with storing the value locally:
  1841. *
  1842. * ```
  1843. * <div *ngIf="condition as value; else elseBlock">{{value}}</div>
  1844. * <ng-template #elseBlock>Content to render when value is null.</ng-template>
  1845. * ```
  1846. *
  1847. * @usageNotes
  1848. *
  1849. * The `*ngIf` directive is most commonly used to conditionally show an inline template,
  1850. * as seen in the following example.
  1851. * The default `else` template is blank.
  1852. *
  1853. * {@example common/ngIf/ts/module.ts region='NgIfSimple'}
  1854. *
  1855. * ### Showing an alternative template using `else`
  1856. *
  1857. * To display a template when `expression` evaluates to false, use an `else` template
  1858. * binding as shown in the following example.
  1859. * The `else` binding points to an `<ng-template>` element labeled `#elseBlock`.
  1860. * The template can be defined anywhere in the component view, but is typically placed right after
  1861. * `ngIf` for readability.
  1862. *
  1863. * {@example common/ngIf/ts/module.ts region='NgIfElse'}
  1864. *
  1865. * ### Using an external `then` template
  1866. *
  1867. * In the previous example, the then-clause template is specified inline, as the content of the
  1868. * tag that contains the `ngIf` directive. You can also specify a template that is defined
  1869. * externally, by referencing a labeled `<ng-template>` element. When you do this, you can
  1870. * change which template to use at runtime, as shown in the following example.
  1871. *
  1872. * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
  1873. *
  1874. * ### Storing a conditional result in a variable
  1875. *
  1876. * You might want to show a set of properties from the same object. If you are waiting
  1877. * for asynchronous data, the object can be undefined.
  1878. * In this case, you can use `ngIf` and store the result of the condition in a local
  1879. * variable as shown in the following example.
  1880. *
  1881. * {@example common/ngIf/ts/module.ts region='NgIfAs'}
  1882. *
  1883. * This code uses only one `AsyncPipe`, so only one subscription is created.
  1884. * The conditional statement stores the result of `userStream|async` in the local variable `user`.
  1885. * You can then bind the local `user` repeatedly.
  1886. *
  1887. * The conditional displays the data only if `userStream` returns a value,
  1888. * so you don't need to use the
  1889. * safe-navigation-operator (`?.`)
  1890. * to guard against null values when accessing properties.
  1891. * You can display an alternative template while waiting for the data.
  1892. *
  1893. * ### Shorthand syntax
  1894. *
  1895. * The shorthand syntax `*ngIf` expands into two separate template specifications
  1896. * for the "then" and "else" clauses. For example, consider the following shorthand statement,
  1897. * that is meant to show a loading page while waiting for data to be loaded.
  1898. *
  1899. * ```
  1900. * <div class="hero-list" *ngIf="heroes else loading">
  1901. * ...
  1902. * </div>
  1903. *
  1904. * <ng-template #loading>
  1905. * <div>Loading...</div>
  1906. * </ng-template>
  1907. * ```
  1908. *
  1909. * You can see that the "else" clause references the `<ng-template>`
  1910. * with the `#loading` label, and the template for the "then" clause
  1911. * is provided as the content of the anchor element.
  1912. *
  1913. * However, when Angular expands the shorthand syntax, it creates
  1914. * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.
  1915. * The anchor element containing the template for the "then" clause becomes
  1916. * the content of this unlabeled `<ng-template>` tag.
  1917. *
  1918. * ```
  1919. * <ng-template [ngIf]="heroes" [ngIfElse]="loading">
  1920. * <div class="hero-list">
  1921. * ...
  1922. * </div>
  1923. * </ng-template>
  1924. *
  1925. * <ng-template #loading>
  1926. * <div>Loading...</div>
  1927. * </ng-template>
  1928. * ```
  1929. *
  1930. * The presence of the implicit template object has implications for the nesting of
  1931. * structural directives. For more on this subject, see
  1932. * [Structural Directives](guide/structural-directives#one-per-element).
  1933. *
  1934. * @ngModule CommonModule
  1935. * @publicApi
  1936. */
  1937. export declare class NgIf<T = unknown> {
  1938. private _viewContainer;
  1939. private _context;
  1940. private _thenTemplateRef;
  1941. private _elseTemplateRef;
  1942. private _thenViewRef;
  1943. private _elseViewRef;
  1944. constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext<T>>);
  1945. /**
  1946. * The Boolean expression to evaluate as the condition for showing a template.
  1947. */
  1948. set ngIf(condition: T);
  1949. /**
  1950. * A template to show if the condition expression evaluates to true.
  1951. */
  1952. set ngIfThen(templateRef: TemplateRef<NgIfContext<T>> | null);
  1953. /**
  1954. * A template to show if the condition expression evaluates to false.
  1955. */
  1956. set ngIfElse(templateRef: TemplateRef<NgIfContext<T>> | null);
  1957. private _updateView;
  1958. /**
  1959. * Assert the correct type of the expression bound to the `ngIf` input within the template.
  1960. *
  1961. * The presence of this static field is a signal to the Ivy template type check compiler that
  1962. * when the `NgIf` structural directive renders its template, the type of the expression bound
  1963. * to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to
  1964. * narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.
  1965. */
  1966. static ngTemplateGuard_ngIf: 'binding';
  1967. /**
  1968. * Asserts the correct type of the context for the template that `NgIf` will render.
  1969. *
  1970. * The presence of this method is a signal to the Ivy template type-check compiler that the
  1971. * `NgIf` structural directive renders its template with a specific context type.
  1972. */
  1973. static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): ctx is NgIfContext<Exclude<T, false | 0 | '' | null | undefined>>;
  1974. static ɵfac: i0.ɵɵFactoryDeclaration<NgIf<any>, never>;
  1975. static ɵdir: i0.ɵɵDirectiveDeclaration<NgIf<any>, "[ngIf]", never, { "ngIf": { "alias": "ngIf"; "required": false; }; "ngIfThen": { "alias": "ngIfThen"; "required": false; }; "ngIfElse": { "alias": "ngIfElse"; "required": false; }; }, {}, never, never, true, never>;
  1976. }
  1977. /**
  1978. * @publicApi
  1979. */
  1980. export declare class NgIfContext<T = unknown> {
  1981. $implicit: T;
  1982. ngIf: T;
  1983. }
  1984. /**
  1985. * Returns the plural case based on the locale
  1986. *
  1987. * @publicApi
  1988. */
  1989. export declare class NgLocaleLocalization extends NgLocalization {
  1990. protected locale: string;
  1991. constructor(locale: string);
  1992. getPluralCategory(value: any, locale?: string): string;
  1993. static ɵfac: i0.ɵɵFactoryDeclaration<NgLocaleLocalization, never>;
  1994. static ɵprov: i0.ɵɵInjectableDeclaration<NgLocaleLocalization>;
  1995. }
  1996. /**
  1997. * @publicApi
  1998. */
  1999. export declare abstract class NgLocalization {
  2000. abstract getPluralCategory(value: any, locale?: string): string;
  2001. static ɵfac: i0.ɵɵFactoryDeclaration<NgLocalization, never>;
  2002. static ɵprov: i0.ɵɵInjectableDeclaration<NgLocalization>;
  2003. }
  2004. /**
  2005. * Directive that improves image loading performance by enforcing best practices.
  2006. *
  2007. * `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is
  2008. * prioritized by:
  2009. * - Automatically setting the `fetchpriority` attribute on the `<img>` tag
  2010. * - Lazy loading non-priority images by default
  2011. * - Asserting that there is a corresponding preconnect link tag in the document head
  2012. *
  2013. * In addition, the directive:
  2014. * - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
  2015. * - Automatically generates a srcset
  2016. * - Requires that `width` and `height` are set
  2017. * - Warns if `width` or `height` have been set incorrectly
  2018. * - Warns if the image will be visually distorted when rendered
  2019. *
  2020. * @usageNotes
  2021. * The `NgOptimizedImage` directive is marked as [standalone](guide/standalone-components) and can
  2022. * be imported directly.
  2023. *
  2024. * Follow the steps below to enable and use the directive:
  2025. * 1. Import it into the necessary NgModule or a standalone Component.
  2026. * 2. Optionally provide an `ImageLoader` if you use an image hosting service.
  2027. * 3. Update the necessary `<img>` tags in templates and replace `src` attributes with `ngSrc`.
  2028. * Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image
  2029. * download.
  2030. *
  2031. * Step 1: import the `NgOptimizedImage` directive.
  2032. *
  2033. * ```typescript
  2034. * import { NgOptimizedImage } from '@angular/common';
  2035. *
  2036. * // Include it into the necessary NgModule
  2037. * @NgModule({
  2038. * imports: [NgOptimizedImage],
  2039. * })
  2040. * class AppModule {}
  2041. *
  2042. * // ... or a standalone Component
  2043. * @Component({
  2044. * standalone: true
  2045. * imports: [NgOptimizedImage],
  2046. * })
  2047. * class MyStandaloneComponent {}
  2048. * ```
  2049. *
  2050. * Step 2: configure a loader.
  2051. *
  2052. * To use the **default loader**: no additional code changes are necessary. The URL returned by the
  2053. * generic loader will always match the value of "src". In other words, this loader applies no
  2054. * transformations to the resource URL and the value of the `ngSrc` attribute will be used as is.
  2055. *
  2056. * To use an existing loader for a **third-party image service**: add the provider factory for your
  2057. * chosen service to the `providers` array. In the example below, the Imgix loader is used:
  2058. *
  2059. * ```typescript
  2060. * import {provideImgixLoader} from '@angular/common';
  2061. *
  2062. * // Call the function and add the result to the `providers` array:
  2063. * providers: [
  2064. * provideImgixLoader("https://my.base.url/"),
  2065. * ],
  2066. * ```
  2067. *
  2068. * The `NgOptimizedImage` directive provides the following functions:
  2069. * - `provideCloudflareLoader`
  2070. * - `provideCloudinaryLoader`
  2071. * - `provideImageKitLoader`
  2072. * - `provideImgixLoader`
  2073. *
  2074. * If you use a different image provider, you can create a custom loader function as described
  2075. * below.
  2076. *
  2077. * To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI
  2078. * token.
  2079. *
  2080. * ```typescript
  2081. * import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';
  2082. *
  2083. * // Configure the loader using the `IMAGE_LOADER` token.
  2084. * providers: [
  2085. * {
  2086. * provide: IMAGE_LOADER,
  2087. * useValue: (config: ImageLoaderConfig) => {
  2088. * return `https://example.com/${config.src}-${config.width}.jpg}`;
  2089. * }
  2090. * },
  2091. * ],
  2092. * ```
  2093. *
  2094. * Step 3: update `<img>` tags in templates to use `ngSrc` instead of `src`.
  2095. *
  2096. * ```
  2097. * <img ngSrc="logo.png" width="200" height="100">
  2098. * ```
  2099. *
  2100. * @publicApi
  2101. */
  2102. export declare class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
  2103. private imageLoader;
  2104. private config;
  2105. private renderer;
  2106. private imgElement;
  2107. private injector;
  2108. private readonly isServer;
  2109. private readonly preloadLinkCreator;
  2110. private lcpObserver;
  2111. /**
  2112. * Calculate the rewritten `src` once and store it.
  2113. * This is needed to avoid repetitive calculations and make sure the directive cleanup in the
  2114. * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
  2115. * instance that might be already destroyed).
  2116. */
  2117. private _renderedSrc;
  2118. /**
  2119. * Name of the source image.
  2120. * Image name will be processed by the image loader and the final URL will be applied as the `src`
  2121. * property of the image.
  2122. */
  2123. ngSrc: string;
  2124. /**
  2125. * A comma separated list of width or density descriptors.
  2126. * The image name will be taken from `ngSrc` and combined with the list of width or density
  2127. * descriptors to generate the final `srcset` property of the image.
  2128. *
  2129. * Example:
  2130. * ```
  2131. * <img ngSrc="hello.jpg" ngSrcset="100w, 200w" /> =>
  2132. * <img src="path/hello.jpg" srcset="path/hello.jpg?w=100 100w, path/hello.jpg?w=200 200w" />
  2133. * ```
  2134. */
  2135. ngSrcset: string;
  2136. /**
  2137. * The base `sizes` attribute passed through to the `<img>` element.
  2138. * Providing sizes causes the image to create an automatic responsive srcset.
  2139. */
  2140. sizes?: string;
  2141. /**
  2142. * For responsive images: the intrinsic width of the image in pixels.
  2143. * For fixed size images: the desired rendered width of the image in pixels.
  2144. */
  2145. set width(value: string | number | undefined);
  2146. get width(): number | undefined;
  2147. private _width?;
  2148. /**
  2149. * For responsive images: the intrinsic height of the image in pixels.
  2150. * For fixed size images: the desired rendered height of the image in pixels.* The intrinsic
  2151. * height of the image in pixels.
  2152. */
  2153. set height(value: string | number | undefined);
  2154. get height(): number | undefined;
  2155. private _height?;
  2156. /**
  2157. * The desired loading behavior (lazy, eager, or auto).
  2158. *
  2159. * Setting images as loading='eager' or loading='auto' marks them
  2160. * as non-priority images. Avoid changing this input for priority images.
  2161. */
  2162. loading?: 'lazy' | 'eager' | 'auto';
  2163. /**
  2164. * Indicates whether this image should have a high priority.
  2165. */
  2166. set priority(value: string | boolean | undefined);
  2167. get priority(): boolean;
  2168. private _priority;
  2169. /**
  2170. * Data to pass through to custom loaders.
  2171. */
  2172. loaderParams?: {
  2173. [key: string]: any;
  2174. };
  2175. /**
  2176. * Disables automatic srcset generation for this image.
  2177. */
  2178. set disableOptimizedSrcset(value: string | boolean | undefined);
  2179. get disableOptimizedSrcset(): boolean;
  2180. private _disableOptimizedSrcset;
  2181. /**
  2182. * Sets the image to "fill mode", which eliminates the height/width requirement and adds
  2183. * styles such that the image fills its containing element.
  2184. *
  2185. * @developerPreview
  2186. */
  2187. set fill(value: string | boolean | undefined);
  2188. get fill(): boolean;
  2189. private _fill;
  2190. /** @nodoc */
  2191. ngOnInit(): void;
  2192. private setHostAttributes;
  2193. /** @nodoc */
  2194. ngOnChanges(changes: SimpleChanges): void;
  2195. private callImageLoader;
  2196. private getLoadingBehavior;
  2197. private getFetchPriority;
  2198. private getRewrittenSrc;
  2199. private getRewrittenSrcset;
  2200. private getAutomaticSrcset;
  2201. private getResponsiveSrcset;
  2202. private getFixedSrcset;
  2203. private shouldGenerateAutomaticSrcset;
  2204. /** @nodoc */
  2205. ngOnDestroy(): void;
  2206. private setHostAttribute;
  2207. static ɵfac: i0.ɵɵFactoryDeclaration<NgOptimizedImage, never>;
  2208. static ɵdir: i0.ɵɵDirectiveDeclaration<NgOptimizedImage, "img[ngSrc]", never, { "ngSrc": { "alias": "ngSrc"; "required": false; }; "ngSrcset": { "alias": "ngSrcset"; "required": false; }; "sizes": { "alias": "sizes"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "priority": { "alias": "priority"; "required": false; }; "loaderParams": { "alias": "loaderParams"; "required": false; }; "disableOptimizedSrcset": { "alias": "disableOptimizedSrcset"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "src": { "alias": "src"; "required": false; }; "srcset": { "alias": "srcset"; "required": false; }; }, {}, never, never, true, never>;
  2209. }
  2210. /**
  2211. * @ngModule CommonModule
  2212. *
  2213. * @usageNotes
  2214. * ```
  2215. * <some-element [ngPlural]="value">
  2216. * <ng-template ngPluralCase="=0">there is nothing</ng-template>
  2217. * <ng-template ngPluralCase="=1">there is one</ng-template>
  2218. * <ng-template ngPluralCase="few">there are a few</ng-template>
  2219. * </some-element>
  2220. * ```
  2221. *
  2222. * @description
  2223. *
  2224. * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
  2225. *
  2226. * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
  2227. * that match the switch expression's pluralization category.
  2228. *
  2229. * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
  2230. * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
  2231. * expression:
  2232. * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
  2233. * matches the switch expression exactly,
  2234. * - otherwise, the view will be treated as a "category match", and will only display if exact
  2235. * value matches aren't found and the value maps to its category for the defined locale.
  2236. *
  2237. * See http://cldr.unicode.org/index/cldr-spec/plural-rules
  2238. *
  2239. * @publicApi
  2240. */
  2241. export declare class NgPlural {
  2242. private _localization;
  2243. private _activeView?;
  2244. private _caseViews;
  2245. constructor(_localization: NgLocalization);
  2246. set ngPlural(value: number);
  2247. addCase(value: string, switchView: SwitchView): void;
  2248. private _updateView;
  2249. private _clearViews;
  2250. private _activateView;
  2251. static ɵfac: i0.ɵɵFactoryDeclaration<NgPlural, never>;
  2252. static ɵdir: i0.ɵɵDirectiveDeclaration<NgPlural, "[ngPlural]", never, { "ngPlural": { "alias": "ngPlural"; "required": false; }; }, {}, never, never, true, never>;
  2253. }
  2254. /**
  2255. * @ngModule CommonModule
  2256. *
  2257. * @description
  2258. *
  2259. * Creates a view that will be added/removed from the parent {@link NgPlural} when the
  2260. * given expression matches the plural expression according to CLDR rules.
  2261. *
  2262. * @usageNotes
  2263. * ```
  2264. * <some-element [ngPlural]="value">
  2265. * <ng-template ngPluralCase="=0">...</ng-template>
  2266. * <ng-template ngPluralCase="other">...</ng-template>
  2267. * </some-element>
  2268. *```
  2269. *
  2270. * See {@link NgPlural} for more details and example.
  2271. *
  2272. * @publicApi
  2273. */
  2274. export declare class NgPluralCase {
  2275. value: string;
  2276. constructor(value: string, template: TemplateRef<Object>, viewContainer: ViewContainerRef, ngPlural: NgPlural);
  2277. static ɵfac: i0.ɵɵFactoryDeclaration<NgPluralCase, [{ attribute: "ngPluralCase"; }, null, null, { host: true; }]>;
  2278. static ɵdir: i0.ɵɵDirectiveDeclaration<NgPluralCase, "[ngPluralCase]", never, {}, {}, never, never, true, never>;
  2279. }
  2280. /**
  2281. * @ngModule CommonModule
  2282. *
  2283. * @usageNotes
  2284. *
  2285. * Set the font of the containing element to the result of an expression.
  2286. *
  2287. * ```
  2288. * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
  2289. * ```
  2290. *
  2291. * Set the width of the containing element to a pixel value returned by an expression.
  2292. *
  2293. * ```
  2294. * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
  2295. * ```
  2296. *
  2297. * Set a collection of style values using an expression that returns key-value pairs.
  2298. *
  2299. * ```
  2300. * <some-element [ngStyle]="objExp">...</some-element>
  2301. * ```
  2302. *
  2303. * @description
  2304. *
  2305. * An attribute directive that updates styles for the containing HTML element.
  2306. * Sets one or more style properties, specified as colon-separated key-value pairs.
  2307. * The key is a style name, with an optional `.<unit>` suffix
  2308. * (such as 'top.px', 'font-style.em').
  2309. * The value is an expression to be evaluated.
  2310. * The resulting non-null value, expressed in the given unit,
  2311. * is assigned to the given style property.
  2312. * If the result of evaluation is null, the corresponding style is removed.
  2313. *
  2314. * @publicApi
  2315. */
  2316. export declare class NgStyle implements DoCheck {
  2317. private _ngEl;
  2318. private _differs;
  2319. private _renderer;
  2320. private _ngStyle;
  2321. private _differ;
  2322. constructor(_ngEl: ElementRef, _differs: KeyValueDiffers, _renderer: Renderer2);
  2323. set ngStyle(values: {
  2324. [klass: string]: any;
  2325. } | null | undefined);
  2326. ngDoCheck(): void;
  2327. private _setStyle;
  2328. private _applyChanges;
  2329. static ɵfac: i0.ɵɵFactoryDeclaration<NgStyle, never>;
  2330. static ɵdir: i0.ɵɵDirectiveDeclaration<NgStyle, "[ngStyle]", never, { "ngStyle": { "alias": "ngStyle"; "required": false; }; }, {}, never, never, true, never>;
  2331. }
  2332. /**
  2333. * @ngModule CommonModule
  2334. *
  2335. * @description
  2336. * The `[ngSwitch]` directive on a container specifies an expression to match against.
  2337. * The expressions to match are provided by `ngSwitchCase` directives on views within the container.
  2338. * - Every view that matches is rendered.
  2339. * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.
  2340. * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`
  2341. * or `ngSwitchDefault` directive are preserved at the location.
  2342. *
  2343. * @usageNotes
  2344. * Define a container element for the directive, and specify the switch expression
  2345. * to match against as an attribute:
  2346. *
  2347. * ```
  2348. * <container-element [ngSwitch]="switch_expression">
  2349. * ```
  2350. *
  2351. * Within the container, `*ngSwitchCase` statements specify the match expressions
  2352. * as attributes. Include `*ngSwitchDefault` as the final case.
  2353. *
  2354. * ```
  2355. * <container-element [ngSwitch]="switch_expression">
  2356. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  2357. * ...
  2358. * <some-element *ngSwitchDefault>...</some-element>
  2359. * </container-element>
  2360. * ```
  2361. *
  2362. * ### Usage Examples
  2363. *
  2364. * The following example shows how to use more than one case to display the same view:
  2365. *
  2366. * ```
  2367. * <container-element [ngSwitch]="switch_expression">
  2368. * <!-- the same view can be shown in more than one case -->
  2369. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  2370. * <some-element *ngSwitchCase="match_expression_2">...</some-element>
  2371. * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
  2372. * <!--default case when there are no matches -->
  2373. * <some-element *ngSwitchDefault>...</some-element>
  2374. * </container-element>
  2375. * ```
  2376. *
  2377. * The following example shows how cases can be nested:
  2378. * ```
  2379. * <container-element [ngSwitch]="switch_expression">
  2380. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  2381. * <some-element *ngSwitchCase="match_expression_2">...</some-element>
  2382. * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
  2383. * <ng-container *ngSwitchCase="match_expression_3">
  2384. * <!-- use a ng-container to group multiple root nodes -->
  2385. * <inner-element></inner-element>
  2386. * <inner-other-element></inner-other-element>
  2387. * </ng-container>
  2388. * <some-element *ngSwitchDefault>...</some-element>
  2389. * </container-element>
  2390. * ```
  2391. *
  2392. * @publicApi
  2393. * @see `NgSwitchCase`
  2394. * @see `NgSwitchDefault`
  2395. * @see [Structural Directives](guide/structural-directives)
  2396. *
  2397. */
  2398. export declare class NgSwitch {
  2399. private _defaultViews;
  2400. private _defaultUsed;
  2401. private _caseCount;
  2402. private _lastCaseCheckIndex;
  2403. private _lastCasesMatched;
  2404. private _ngSwitch;
  2405. set ngSwitch(newValue: any);
  2406. private _updateDefaultCases;
  2407. static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitch, never>;
  2408. static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitch, "[ngSwitch]", never, { "ngSwitch": { "alias": "ngSwitch"; "required": false; }; }, {}, never, never, true, never>;
  2409. }
  2410. /**
  2411. * @ngModule CommonModule
  2412. *
  2413. * @description
  2414. * Provides a switch case expression to match against an enclosing `ngSwitch` expression.
  2415. * When the expressions match, the given `NgSwitchCase` template is rendered.
  2416. * If multiple match expressions match the switch expression value, all of them are displayed.
  2417. *
  2418. * @usageNotes
  2419. *
  2420. * Within a switch container, `*ngSwitchCase` statements specify the match expressions
  2421. * as attributes. Include `*ngSwitchDefault` as the final case.
  2422. *
  2423. * ```
  2424. * <container-element [ngSwitch]="switch_expression">
  2425. * <some-element *ngSwitchCase="match_expression_1">...</some-element>
  2426. * ...
  2427. * <some-element *ngSwitchDefault>...</some-element>
  2428. * </container-element>
  2429. * ```
  2430. *
  2431. * Each switch-case statement contains an in-line HTML template or template reference
  2432. * that defines the subtree to be selected if the value of the match expression
  2433. * matches the value of the switch expression.
  2434. *
  2435. * Unlike JavaScript, which uses strict equality, Angular uses loose equality.
  2436. * This means that the empty string, `""` matches 0.
  2437. *
  2438. * @publicApi
  2439. * @see `NgSwitch`
  2440. * @see `NgSwitchDefault`
  2441. *
  2442. */
  2443. export declare class NgSwitchCase implements DoCheck {
  2444. private ngSwitch;
  2445. private _view;
  2446. /**
  2447. * Stores the HTML template to be selected on match.
  2448. */
  2449. ngSwitchCase: any;
  2450. constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
  2451. /**
  2452. * Performs case matching. For internal use only.
  2453. * @nodoc
  2454. */
  2455. ngDoCheck(): void;
  2456. static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchCase, [null, null, { optional: true; host: true; }]>;
  2457. static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchCase, "[ngSwitchCase]", never, { "ngSwitchCase": { "alias": "ngSwitchCase"; "required": false; }; }, {}, never, never, true, never>;
  2458. }
  2459. /**
  2460. * @ngModule CommonModule
  2461. *
  2462. * @description
  2463. *
  2464. * Creates a view that is rendered when no `NgSwitchCase` expressions
  2465. * match the `NgSwitch` expression.
  2466. * This statement should be the final case in an `NgSwitch`.
  2467. *
  2468. * @publicApi
  2469. * @see `NgSwitch`
  2470. * @see `NgSwitchCase`
  2471. *
  2472. */
  2473. export declare class NgSwitchDefault {
  2474. constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
  2475. static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchDefault, [null, null, { optional: true; host: true; }]>;
  2476. static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchDefault, "[ngSwitchDefault]", never, {}, {}, never, never, true, never>;
  2477. }
  2478. /**
  2479. * @ngModule CommonModule
  2480. *
  2481. * @description
  2482. *
  2483. * Inserts an embedded view from a prepared `TemplateRef`.
  2484. *
  2485. * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
  2486. * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
  2487. * by the local template `let` declarations.
  2488. *
  2489. * @usageNotes
  2490. * ```
  2491. * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
  2492. * ```
  2493. *
  2494. * Using the key `$implicit` in the context object will set its value as default.
  2495. *
  2496. * ### Example
  2497. *
  2498. * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
  2499. *
  2500. * @publicApi
  2501. */
  2502. export declare class NgTemplateOutlet<C = unknown> implements OnChanges {
  2503. private _viewContainerRef;
  2504. private _viewRef;
  2505. /**
  2506. * A context object to attach to the {@link EmbeddedViewRef}. This should be an
  2507. * object, the object's keys will be available for binding by the local template `let`
  2508. * declarations.
  2509. * Using the key `$implicit` in the context object will set its value as default.
  2510. */
  2511. ngTemplateOutletContext: C | null;
  2512. /**
  2513. * A string defining the template reference and optionally the context object for the template.
  2514. */
  2515. ngTemplateOutlet: TemplateRef<C> | null;
  2516. /** Injector to be used within the embedded view. */
  2517. ngTemplateOutletInjector: Injector | null;
  2518. constructor(_viewContainerRef: ViewContainerRef);
  2519. /** @nodoc */
  2520. ngOnChanges(changes: SimpleChanges): void;
  2521. static ɵfac: i0.ɵɵFactoryDeclaration<NgTemplateOutlet<any>, never>;
  2522. static ɵdir: i0.ɵɵDirectiveDeclaration<NgTemplateOutlet<any>, "[ngTemplateOutlet]", never, { "ngTemplateOutletContext": { "alias": "ngTemplateOutletContext"; "required": false; }; "ngTemplateOutlet": { "alias": "ngTemplateOutlet"; "required": false; }; "ngTemplateOutletInjector": { "alias": "ngTemplateOutletInjector"; "required": false; }; }, {}, never, never, true, never>;
  2523. }
  2524. /**
  2525. * Format styles that can be used to represent numbers.
  2526. * @see `getLocaleNumberFormat()`.
  2527. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  2528. *
  2529. * @publicApi
  2530. */
  2531. export declare enum NumberFormatStyle {
  2532. Decimal = 0,
  2533. Percent = 1,
  2534. Currency = 2,
  2535. Scientific = 3
  2536. }
  2537. /**
  2538. * Symbols that can be used to replace placeholders in number patterns.
  2539. * Examples are based on `en-US` values.
  2540. *
  2541. * @see `getLocaleNumberSymbol()`
  2542. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  2543. *
  2544. * @publicApi
  2545. */
  2546. export declare enum NumberSymbol {
  2547. /**
  2548. * Decimal separator.
  2549. * For `en-US`, the dot character.
  2550. * Example: 2,345`.`67
  2551. */
  2552. Decimal = 0,
  2553. /**
  2554. * Grouping separator, typically for thousands.
  2555. * For `en-US`, the comma character.
  2556. * Example: 2`,`345.67
  2557. */
  2558. Group = 1,
  2559. /**
  2560. * List-item separator.
  2561. * Example: "one, two, and three"
  2562. */
  2563. List = 2,
  2564. /**
  2565. * Sign for percentage (out of 100).
  2566. * Example: 23.4%
  2567. */
  2568. PercentSign = 3,
  2569. /**
  2570. * Sign for positive numbers.
  2571. * Example: +23
  2572. */
  2573. PlusSign = 4,
  2574. /**
  2575. * Sign for negative numbers.
  2576. * Example: -23
  2577. */
  2578. MinusSign = 5,
  2579. /**
  2580. * Computer notation for exponential value (n times a power of 10).
  2581. * Example: 1.2E3
  2582. */
  2583. Exponential = 6,
  2584. /**
  2585. * Human-readable format of exponential.
  2586. * Example: 1.2x103
  2587. */
  2588. SuperscriptingExponent = 7,
  2589. /**
  2590. * Sign for permille (out of 1000).
  2591. * Example: 23.4‰
  2592. */
  2593. PerMille = 8,
  2594. /**
  2595. * Infinity, can be used with plus and minus.
  2596. * Example: ∞, +∞, -∞
  2597. */
  2598. Infinity = 9,
  2599. /**
  2600. * Not a number.
  2601. * Example: NaN
  2602. */
  2603. NaN = 10,
  2604. /**
  2605. * Symbol used between time units.
  2606. * Example: 10:52
  2607. */
  2608. TimeSeparator = 11,
  2609. /**
  2610. * Decimal separator for currency values (fallback to `Decimal`).
  2611. * Example: $2,345.67
  2612. */
  2613. CurrencyDecimal = 12,
  2614. /**
  2615. * Group separator for currency values (fallback to `Group`).
  2616. * Example: $2,345.67
  2617. */
  2618. CurrencyGroup = 13
  2619. }
  2620. /**
  2621. * @description
  2622. * A {@link LocationStrategy} used to configure the {@link Location} service to
  2623. * represent its state in the
  2624. * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
  2625. * browser's URL.
  2626. *
  2627. * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}
  2628. * or add a `<base href>` element to the document to override the default.
  2629. *
  2630. * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call
  2631. * `location.go('/foo')`, the browser's URL will become
  2632. * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,
  2633. * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.
  2634. *
  2635. * Similarly, if you add `<base href='/my/app/'/>` to the document and call
  2636. * `location.go('/foo')`, the browser's URL will become
  2637. * `example.com/my/app/foo`.
  2638. *
  2639. * Note that when using `PathLocationStrategy`, neither the query nor
  2640. * the fragment in the `<base href>` will be preserved, as outlined
  2641. * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).
  2642. *
  2643. * @usageNotes
  2644. *
  2645. * ### Example
  2646. *
  2647. * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
  2648. *
  2649. * @publicApi
  2650. */
  2651. export declare class PathLocationStrategy extends LocationStrategy implements OnDestroy {
  2652. private _platformLocation;
  2653. private _baseHref;
  2654. private _removeListenerFns;
  2655. constructor(_platformLocation: PlatformLocation, href?: string);
  2656. /** @nodoc */
  2657. ngOnDestroy(): void;
  2658. onPopState(fn: LocationChangeListener): void;
  2659. getBaseHref(): string;
  2660. prepareExternalUrl(internal: string): string;
  2661. path(includeHash?: boolean): string;
  2662. pushState(state: any, title: string, url: string, queryParams: string): void;
  2663. replaceState(state: any, title: string, url: string, queryParams: string): void;
  2664. forward(): void;
  2665. back(): void;
  2666. getState(): unknown;
  2667. historyGo(relativePosition?: number): void;
  2668. static ɵfac: i0.ɵɵFactoryDeclaration<PathLocationStrategy, [null, { optional: true; }]>;
  2669. static ɵprov: i0.ɵɵInjectableDeclaration<PathLocationStrategy>;
  2670. }
  2671. /**
  2672. * @ngModule CommonModule
  2673. * @description
  2674. *
  2675. * Transforms a number to a percentage
  2676. * string, formatted according to locale rules that determine group sizing and
  2677. * separator, decimal-point character, and other locale-specific
  2678. * configurations.
  2679. *
  2680. * @see `formatPercent()`
  2681. *
  2682. * @usageNotes
  2683. * The following code shows how the pipe transforms numbers
  2684. * into text strings, according to various format specifications,
  2685. * where the caller's default locale is `en-US`.
  2686. *
  2687. * <code-example path="common/pipes/ts/percent_pipe.ts" region='PercentPipe'></code-example>
  2688. *
  2689. * @publicApi
  2690. */
  2691. export declare class PercentPipe implements PipeTransform {
  2692. private _locale;
  2693. constructor(_locale: string);
  2694. transform(value: number | string, digitsInfo?: string, locale?: string): string | null;
  2695. transform(value: null | undefined, digitsInfo?: string, locale?: string): null;
  2696. transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null;
  2697. static ɵfac: i0.ɵɵFactoryDeclaration<PercentPipe, never>;
  2698. static ɵpipe: i0.ɵɵPipeDeclaration<PercentPipe, "percent", true>;
  2699. }
  2700. /**
  2701. * This class should not be used directly by an application developer. Instead, use
  2702. * {@link Location}.
  2703. *
  2704. * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be
  2705. * platform-agnostic.
  2706. * This means that we can have different implementation of `PlatformLocation` for the different
  2707. * platforms that Angular supports. For example, `@angular/platform-browser` provides an
  2708. * implementation specific to the browser environment, while `@angular/platform-server` provides
  2709. * one suitable for use with server-side rendering.
  2710. *
  2711. * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
  2712. * when they need to interact with the DOM APIs like pushState, popState, etc.
  2713. *
  2714. * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
  2715. * by the {@link Router} in order to navigate between routes. Since all interactions between {@link
  2716. * Router} /
  2717. * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`
  2718. * class, they are all platform-agnostic.
  2719. *
  2720. * @publicApi
  2721. */
  2722. export declare abstract class PlatformLocation {
  2723. abstract getBaseHrefFromDOM(): string;
  2724. abstract getState(): unknown;
  2725. /**
  2726. * Returns a function that, when executed, removes the `popstate` event handler.
  2727. */
  2728. abstract onPopState(fn: LocationChangeListener): VoidFunction;
  2729. /**
  2730. * Returns a function that, when executed, removes the `hashchange` event handler.
  2731. */
  2732. abstract onHashChange(fn: LocationChangeListener): VoidFunction;
  2733. abstract get href(): string;
  2734. abstract get protocol(): string;
  2735. abstract get hostname(): string;
  2736. abstract get port(): string;
  2737. abstract get pathname(): string;
  2738. abstract get search(): string;
  2739. abstract get hash(): string;
  2740. abstract replaceState(state: any, title: string, url: string): void;
  2741. abstract pushState(state: any, title: string, url: string): void;
  2742. abstract forward(): void;
  2743. abstract back(): void;
  2744. historyGo?(relativePosition: number): void;
  2745. static ɵfac: i0.ɵɵFactoryDeclaration<PlatformLocation, never>;
  2746. static ɵprov: i0.ɵɵInjectableDeclaration<PlatformLocation>;
  2747. }
  2748. /**
  2749. * Plurality cases used for translating plurals to different languages.
  2750. *
  2751. * @see `NgPlural`
  2752. * @see `NgPluralCase`
  2753. * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
  2754. *
  2755. * @publicApi
  2756. */
  2757. export declare enum Plural {
  2758. Zero = 0,
  2759. One = 1,
  2760. Two = 2,
  2761. Few = 3,
  2762. Many = 4,
  2763. Other = 5
  2764. }
  2765. /** @publicApi */
  2766. declare interface PopStateEvent_2 {
  2767. pop?: boolean;
  2768. state?: any;
  2769. type?: string;
  2770. url?: string;
  2771. }
  2772. export { PopStateEvent_2 as PopStateEvent }
  2773. /**
  2774. * Injection token to configure which origins should be excluded
  2775. * from the preconnect checks. It can either be a single string or an array of strings
  2776. * to represent a group of origins, for example:
  2777. *
  2778. * ```typescript
  2779. * {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}
  2780. * ```
  2781. *
  2782. * or:
  2783. *
  2784. * ```typescript
  2785. * {provide: PRECONNECT_CHECK_BLOCKLIST,
  2786. * useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
  2787. * ```
  2788. *
  2789. * @publicApi
  2790. */
  2791. export declare const PRECONNECT_CHECK_BLOCKLIST: InjectionToken<(string | string[])[]>;
  2792. /**
  2793. * Function that generates an ImageLoader for [Cloudflare Image
  2794. * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
  2795. * provider. Note: Cloudflare has multiple image products - this provider is specifically for
  2796. * Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
  2797. *
  2798. * @param path Your domain name, e.g. https://mysite.com
  2799. * @returns Provider that provides an ImageLoader function
  2800. *
  2801. * @publicApi
  2802. */
  2803. export declare const provideCloudflareLoader: (path: string) => Provider[];
  2804. /**
  2805. * Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.
  2806. *
  2807. * @param path Base URL of your Cloudinary images
  2808. * This URL should match one of the following formats:
  2809. * https://res.cloudinary.com/mysite
  2810. * https://mysite.cloudinary.com
  2811. * https://subdomain.mysite.com
  2812. * @returns Set of providers to configure the Cloudinary loader.
  2813. *
  2814. * @publicApi
  2815. */
  2816. export declare const provideCloudinaryLoader: (path: string) => Provider[];
  2817. /**
  2818. * Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.
  2819. *
  2820. * @param path Base URL of your ImageKit images
  2821. * This URL should match one of the following formats:
  2822. * https://ik.imagekit.io/myaccount
  2823. * https://subdomain.mysite.com
  2824. * @returns Set of providers to configure the ImageKit loader.
  2825. *
  2826. * @publicApi
  2827. */
  2828. export declare const provideImageKitLoader: (path: string) => Provider[];
  2829. /**
  2830. * Function that generates an ImageLoader for Imgix and turns it into an Angular provider.
  2831. *
  2832. * @param path path to the desired Imgix origin,
  2833. * e.g. https://somepath.imgix.net or https://images.mysite.com
  2834. * @returns Set of providers to configure the Imgix loader.
  2835. *
  2836. * @publicApi
  2837. */
  2838. export declare const provideImgixLoader: (path: string) => Provider[];
  2839. /**
  2840. * Register global data to be used internally by Angular. See the
  2841. * ["I18n guide"](guide/i18n-common-format-data-locale) to know how to import additional locale
  2842. * data.
  2843. *
  2844. * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1
  2845. *
  2846. * @publicApi
  2847. */
  2848. export declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void;
  2849. /**
  2850. * @ngModule CommonModule
  2851. * @description
  2852. *
  2853. * Creates a new `Array` or `String` containing a subset (slice) of the elements.
  2854. *
  2855. * @usageNotes
  2856. *
  2857. * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
  2858. * and `String.prototype.slice()`.
  2859. *
  2860. * When operating on an `Array`, the returned `Array` is always a copy even when all
  2861. * the elements are being returned.
  2862. *
  2863. * When operating on a blank value, the pipe returns the blank value.
  2864. *
  2865. * ### List Example
  2866. *
  2867. * This `ngFor` example:
  2868. *
  2869. * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
  2870. *
  2871. * produces the following:
  2872. *
  2873. * ```html
  2874. * <li>b</li>
  2875. * <li>c</li>
  2876. * ```
  2877. *
  2878. * ### String Examples
  2879. *
  2880. * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
  2881. *
  2882. * @publicApi
  2883. */
  2884. export declare class SlicePipe implements PipeTransform {
  2885. /**
  2886. * @param value a list or a string to be sliced.
  2887. * @param start the starting index of the subset to return:
  2888. * - **a positive integer**: return the item at `start` index and all items after
  2889. * in the list or string expression.
  2890. * - **a negative integer**: return the item at `start` index from the end and all items after
  2891. * in the list or string expression.
  2892. * - **if positive and greater than the size of the expression**: return an empty list or
  2893. * string.
  2894. * - **if negative and greater than the size of the expression**: return entire list or string.
  2895. * @param end the ending index of the subset to return:
  2896. * - **omitted**: return all items until the end.
  2897. * - **if positive**: return all items before `end` index of the list or string.
  2898. * - **if negative**: return all items before `end` index from the end of the list or string.
  2899. */
  2900. transform<T>(value: ReadonlyArray<T>, start: number, end?: number): Array<T>;
  2901. transform(value: null | undefined, start: number, end?: number): null;
  2902. transform<T>(value: ReadonlyArray<T> | null | undefined, start: number, end?: number): Array<T> | null;
  2903. transform(value: string, start: number, end?: number): string;
  2904. transform(value: string | null | undefined, start: number, end?: number): string | null;
  2905. private supports;
  2906. static ɵfac: i0.ɵɵFactoryDeclaration<SlicePipe, never>;
  2907. static ɵpipe: i0.ɵɵPipeDeclaration<SlicePipe, "slice", true>;
  2908. }
  2909. declare class SwitchView {
  2910. private _viewContainerRef;
  2911. private _templateRef;
  2912. private _created;
  2913. constructor(_viewContainerRef: ViewContainerRef, _templateRef: TemplateRef<Object>);
  2914. create(): void;
  2915. destroy(): void;
  2916. enforceState(created: boolean): void;
  2917. }
  2918. /**
  2919. * Represents a time value with hours and minutes.
  2920. *
  2921. * @publicApi
  2922. */
  2923. export declare type Time = {
  2924. hours: number;
  2925. minutes: number;
  2926. };
  2927. /**
  2928. * Transforms text to title case.
  2929. * Capitalizes the first letter of each word and transforms the
  2930. * rest of the word to lower case.
  2931. * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
  2932. *
  2933. * @see `LowerCasePipe`
  2934. * @see `UpperCasePipe`
  2935. *
  2936. * @usageNotes
  2937. * The following example shows the result of transforming various strings into title case.
  2938. *
  2939. * <code-example path="common/pipes/ts/titlecase_pipe.ts" region='TitleCasePipe'></code-example>
  2940. *
  2941. * @ngModule CommonModule
  2942. * @publicApi
  2943. */
  2944. export declare class TitleCasePipe implements PipeTransform {
  2945. /**
  2946. * @param value The string to transform to title case.
  2947. */
  2948. transform(value: string): string;
  2949. transform(value: null | undefined): null;
  2950. transform(value: string | null | undefined): string | null;
  2951. static ɵfac: i0.ɵɵFactoryDeclaration<TitleCasePipe, never>;
  2952. static ɵpipe: i0.ɵɵPipeDeclaration<TitleCasePipe, "titlecase", true>;
  2953. }
  2954. /**
  2955. * String widths available for translations.
  2956. * The specific character widths are locale-specific.
  2957. * Examples are given for the word "Sunday" in English.
  2958. *
  2959. * @publicApi
  2960. */
  2961. export declare enum TranslationWidth {
  2962. /** 1 character for `en-US`. For example: 'S' */
  2963. Narrow = 0,
  2964. /** 3 characters for `en-US`. For example: 'Sun' */
  2965. Abbreviated = 1,
  2966. /** Full length for `en-US`. For example: "Sunday" */
  2967. Wide = 2,
  2968. /** 2 characters for `en-US`, For example: "Su" */
  2969. Short = 3
  2970. }
  2971. /**
  2972. * Transforms text to all upper case.
  2973. * @see `LowerCasePipe`
  2974. * @see `TitleCasePipe`
  2975. *
  2976. * @ngModule CommonModule
  2977. * @publicApi
  2978. */
  2979. export declare class UpperCasePipe implements PipeTransform {
  2980. /**
  2981. * @param value The string to transform to upper case.
  2982. */
  2983. transform(value: string): string;
  2984. transform(value: null | undefined): null;
  2985. transform(value: string | null | undefined): string | null;
  2986. static ɵfac: i0.ɵɵFactoryDeclaration<UpperCasePipe, never>;
  2987. static ɵpipe: i0.ɵɵPipeDeclaration<UpperCasePipe, "uppercase", true>;
  2988. }
  2989. /**
  2990. * @publicApi
  2991. */
  2992. export declare const VERSION: Version;
  2993. /**
  2994. * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
  2995. *
  2996. * @publicApi
  2997. */
  2998. export declare abstract class ViewportScroller {
  2999. /** @nocollapse */
  3000. static ɵprov: unknown;
  3001. /**
  3002. * Configures the top offset used when scrolling to an anchor.
  3003. * @param offset A position in screen coordinates (a tuple with x and y values)
  3004. * or a function that returns the top offset position.
  3005. *
  3006. */
  3007. abstract setOffset(offset: [number, number] | (() => [number, number])): void;
  3008. /**
  3009. * Retrieves the current scroll position.
  3010. * @returns A position in screen coordinates (a tuple with x and y values).
  3011. */
  3012. abstract getScrollPosition(): [number, number];
  3013. /**
  3014. * Scrolls to a specified position.
  3015. * @param position A position in screen coordinates (a tuple with x and y values).
  3016. */
  3017. abstract scrollToPosition(position: [number, number]): void;
  3018. /**
  3019. * Scrolls to an anchor element.
  3020. * @param anchor The ID of the anchor element.
  3021. */
  3022. abstract scrollToAnchor(anchor: string): void;
  3023. /**
  3024. * Disables automatic scroll restoration provided by the browser.
  3025. * See also [window.history.scrollRestoration
  3026. * info](https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration).
  3027. */
  3028. abstract setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
  3029. }
  3030. /**
  3031. * The value for each day of the week, based on the `en-US` locale
  3032. *
  3033. * @publicApi
  3034. */
  3035. export declare enum WeekDay {
  3036. Sunday = 0,
  3037. Monday = 1,
  3038. Tuesday = 2,
  3039. Wednesday = 3,
  3040. Thursday = 4,
  3041. Friday = 5,
  3042. Saturday = 6
  3043. }
  3044. /**
  3045. * A wrapper around the `XMLHttpRequest` constructor.
  3046. *
  3047. * @publicApi
  3048. */
  3049. export declare abstract class XhrFactory {
  3050. abstract build(): XMLHttpRequest;
  3051. }
  3052. /**
  3053. * Provides DOM operations in an environment-agnostic way.
  3054. *
  3055. * @security Tread carefully! Interacting with the DOM directly is dangerous and
  3056. * can introduce XSS risks.
  3057. */
  3058. export declare abstract class ɵDomAdapter {
  3059. abstract dispatchEvent(el: any, evt: any): any;
  3060. abstract readonly supportsDOMEvents: boolean;
  3061. abstract remove(el: any): void;
  3062. abstract createElement(tagName: any, doc?: any): HTMLElement;
  3063. abstract createHtmlDocument(): Document;
  3064. abstract getDefaultDocument(): Document;
  3065. abstract isElementNode(node: any): boolean;
  3066. abstract isShadowRoot(node: any): boolean;
  3067. abstract onAndCancel(el: any, evt: any, listener: any): Function;
  3068. abstract getGlobalEventTarget(doc: Document, target: string): any;
  3069. abstract getBaseHref(doc: Document): string | null;
  3070. abstract resetBaseElement(): void;
  3071. abstract getUserAgent(): string;
  3072. abstract getCookie(name: string): string | null;
  3073. }
  3074. export declare function ɵgetDOM(): ɵDomAdapter;
  3075. /**
  3076. * Provides an empty implementation of the viewport scroller.
  3077. */
  3078. export declare class ɵNullViewportScroller implements ViewportScroller {
  3079. /**
  3080. * Empty implementation
  3081. */
  3082. setOffset(offset: [number, number] | (() => [number, number])): void;
  3083. /**
  3084. * Empty implementation
  3085. */
  3086. getScrollPosition(): [number, number];
  3087. /**
  3088. * Empty implementation
  3089. */
  3090. scrollToPosition(position: [number, number]): void;
  3091. /**
  3092. * Empty implementation
  3093. */
  3094. scrollToAnchor(anchor: string): void;
  3095. /**
  3096. * Empty implementation
  3097. */
  3098. setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
  3099. }
  3100. export declare function ɵparseCookieValue(cookieStr: string, name: string): string | null;
  3101. export declare const ɵPLATFORM_BROWSER_ID = "browser";
  3102. export declare const ɵPLATFORM_SERVER_ID = "server";
  3103. export declare const ɵPLATFORM_WORKER_APP_ID = "browserWorkerApp";
  3104. export declare const ɵPLATFORM_WORKER_UI_ID = "browserWorkerUi";
  3105. export declare function ɵsetRootDomAdapter(adapter: ɵDomAdapter): void;
  3106. export { }