common.d.ts 106 KB

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