UNPKG

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