index.d.ts 128 KB

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