UNPKG

113 kBTypeScriptView Raw
1/**
2 * @license Angular v8.0.1
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 * Retrieves the plural function used by ICU expressions to determine the plural case to use
946 * for a given locale.
947 * @param locale A locale code for the locale format rules to use.
948 * @returns The plural function for the locale.
949 * @see `NgPlural`
950 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
951 *
952 * @publicApi
953 */
954export declare function getLocalePluralCase(locale: string): (value: number) => Plural;
955
956/**
957 * Retrieves a localized time-value formatting string.
958 *
959 * @param locale A locale code for the locale format rules to use.
960 * @param width The format type.
961 * @returns The localized formatting string.
962 * @see `FormatWidth`
963 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
964
965 * @publicApi
966 */
967export declare function getLocaleTimeFormat(locale: string, width: FormatWidth): string;
968
969/**
970 * Range of week days that are considered the week-end for the given locale.
971 *
972 * @param locale A locale code for the locale format rules to use.
973 * @returns The range of day values, `[startDay, endDay]`.
974 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
975 *
976 * @publicApi
977 */
978export declare function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay];
979
980/**
981 * Reports the number of decimal digits for a given currency.
982 * The value depends upon the presence of cents in that particular currency.
983 *
984 * @param code The currency code.
985 * @returns The number of decimal digits, typically 0 or 2.
986 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
987 *
988 * @publicApi
989 */
990export declare function getNumberOfCurrencyDigits(code: string): number;
991
992/**
993 * @description
994 * A {@link LocationStrategy} used to configure the {@link Location} service to
995 * represent its state in the
996 * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
997 * of the browser's URL.
998 *
999 * For instance, if you call `location.go('/foo')`, the browser's URL will become
1000 * `example.com#/foo`.
1001 *
1002 * @usageNotes
1003 *
1004 * ### Example
1005 *
1006 * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}
1007 *
1008 * @publicApi
1009 */
1010export declare class HashLocationStrategy extends LocationStrategy {
1011 private _platformLocation;
1012 private _baseHref;
1013 constructor(_platformLocation: PlatformLocation, _baseHref?: string);
1014 onPopState(fn: LocationChangeListener): void;
1015 getBaseHref(): string;
1016 path(includeHash?: boolean): string;
1017 prepareExternalUrl(internal: string): string;
1018 pushState(state: any, title: string, path: string, queryParams: string): void;
1019 replaceState(state: any, title: string, path: string, queryParams: string): void;
1020 forward(): void;
1021 back(): void;
1022}
1023
1024/**
1025 * @ngModule CommonModule
1026 * @description
1027 *
1028 * Maps a value to a string that pluralizes the value according to locale rules.
1029 *
1030 * @usageNotes
1031 *
1032 * ### Example
1033 *
1034 * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
1035 *
1036 * @publicApi
1037 */
1038export declare class I18nPluralPipe implements PipeTransform {
1039 private _localization;
1040 constructor(_localization: NgLocalization);
1041 /**
1042 * @param value the number to be formatted
1043 * @param pluralMap an object that mimics the ICU format, see
1044 * http://userguide.icu-project.org/formatparse/messages.
1045 * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
1046 * default).
1047 */
1048 transform(value: number, pluralMap: {
1049 [count: string]: string;
1050 }, locale?: string): string;
1051}
1052
1053/**
1054 * @ngModule CommonModule
1055 * @description
1056 *
1057 * Generic selector that displays the string that matches the current value.
1058 *
1059 * If none of the keys of the `mapping` match the `value`, then the content
1060 * of the `other` key is returned when present, otherwise an empty string is returned.
1061 *
1062 * @usageNotes
1063 *
1064 * ### Example
1065 *
1066 * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
1067 *
1068 * @publicApi
1069 */
1070export declare class I18nSelectPipe implements PipeTransform {
1071 /**
1072 * @param value a string to be internationalized.
1073 * @param mapping an object that indicates the text that should be displayed
1074 * for different values of the provided `value`.
1075 */
1076 transform(value: string | null | undefined, mapping: {
1077 [key: string]: string;
1078 }): string;
1079}
1080
1081/**
1082 * Returns whether a platform id represents a browser platform.
1083 * @publicApi
1084 */
1085export declare function isPlatformBrowser(platformId: Object): boolean;
1086
1087/**
1088 * Returns whether a platform id represents a server platform.
1089 * @publicApi
1090 */
1091export declare function isPlatformServer(platformId: Object): boolean;
1092
1093/**
1094 * Returns whether a platform id represents a web worker app platform.
1095 * @publicApi
1096 */
1097export declare function isPlatformWorkerApp(platformId: Object): boolean;
1098
1099/**
1100 * Returns whether a platform id represents a web worker UI platform.
1101 * @publicApi
1102 */
1103export declare function isPlatformWorkerUi(platformId: Object): boolean;
1104
1105/**
1106 * @ngModule CommonModule
1107 * @description
1108 *
1109 * Converts a value into its JSON-format representation. Useful for debugging.
1110 *
1111 * @usageNotes
1112 *
1113 * The following component uses a JSON pipe to convert an object
1114 * to JSON format, and displays the string in both formats for comparison.
1115 *
1116 * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
1117 *
1118 * @publicApi
1119 */
1120export declare class JsonPipe implements PipeTransform {
1121 /**
1122 * @param value A value of any type to convert into a JSON-format string.
1123 */
1124 transform(value: any): string;
1125}
1126
1127/**
1128 * A key value pair.
1129 * Usually used to represent the key value pairs from a Map or Object.
1130 *
1131 * @publicApi
1132 */
1133export declare interface KeyValue<K, V> {
1134 key: K;
1135 value: V;
1136}
1137
1138/**
1139 * @ngModule CommonModule
1140 * @description
1141 *
1142 * Transforms Object or Map into an array of key value pairs.
1143 *
1144 * The output array will be ordered by keys.
1145 * By default the comparator will be by Unicode point value.
1146 * You can optionally pass a compareFn if your keys are complex types.
1147 *
1148 * @usageNotes
1149 * ### Examples
1150 *
1151 * This examples show how an Object or a Map can be iterated by ngFor with the use of this keyvalue
1152 * pipe.
1153 *
1154 * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
1155 *
1156 * @publicApi
1157 */
1158export declare class KeyValuePipe implements PipeTransform {
1159 private readonly differs;
1160 constructor(differs: KeyValueDiffers);
1161 private differ;
1162 private keyValues;
1163 transform<K, V>(input: null, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): null;
1164 transform<V>(input: {
1165 [key: string]: V;
1166 } | Map<string, V>, compareFn?: (a: KeyValue<string, V>, b: KeyValue<string, V>) => number): Array<KeyValue<string, V>>;
1167 transform<V>(input: {
1168 [key: number]: V;
1169 } | Map<number, V>, compareFn?: (a: KeyValue<number, V>, b: KeyValue<number, V>) => number): Array<KeyValue<number, V>>;
1170 transform<K, V>(input: Map<K, V>, compareFn?: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number): Array<KeyValue<K, V>>;
1171}
1172
1173/**
1174 * @description
1175 *
1176 * A service that applications can use to interact with a browser's URL.
1177 *
1178 * Depending on the {@link LocationStrategy} used, `Location` will either persist
1179 * to the URL's path or the URL's hash segment.
1180 *
1181 * @usageNotes
1182 *
1183 * It's better to use the {@link Router#navigate} service to trigger route changes. Use
1184 * `Location` only if you need to interact with or create normalized URLs outside of
1185 * routing.
1186 *
1187 * `Location` is responsible for normalizing the URL against the application's base href.
1188 * A normalized URL is absolute from the URL host, includes the application's base href, and has no
1189 * trailing slash:
1190 * - `/my/app/user/123` is normalized
1191 * - `my/app/user/123` **is not** normalized
1192 * - `/my/app/user/123/` **is not** normalized
1193 *
1194 * ### Example
1195 *
1196 * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
1197 *
1198 * @publicApi
1199 */
1200export declare class Location {
1201 constructor(platformStrategy: LocationStrategy, platformLocation: PlatformLocation);
1202 /**
1203 * Returns the normalized URL path.
1204 *
1205 * @param includeHash Whether path has an anchor fragment.
1206 *
1207 * @returns The normalized URL path.
1208 */
1209 path(includeHash?: boolean): string;
1210 /**
1211 * Returns the current value of the history.state object.
1212 */
1213 getState(): unknown;
1214 /**
1215 * Normalizes the given path and compares to the current normalized path.
1216 *
1217 * @param path The given URL path
1218 * @param query Query parameters
1219 *
1220 * @returns `true` if the given URL path is equal to the current normalized path, `false`
1221 * otherwise.
1222 */
1223 isCurrentPathEqualTo(path: string, query?: string): boolean;
1224 /**
1225 * Given a string representing a URL, returns the URL path after stripping the
1226 * trailing slashes.
1227 *
1228 * @param url String representing a URL.
1229 *
1230 * @returns Normalized URL string.
1231 */
1232 normalize(url: string): string;
1233 /**
1234 * Given a string representing a URL, returns the platform-specific external URL path.
1235 * If the given URL doesn't begin with a leading slash (`'/'`), this method adds one
1236 * before normalizing. This method also adds a hash if `HashLocationStrategy` is
1237 * used, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
1238 *
1239 *
1240 * @param url String representing a URL.
1241 *
1242 * @returns A normalized platform-specific URL.
1243 */
1244 prepareExternalUrl(url: string): string;
1245 /**
1246 * Changes the browsers URL to a normalized version of the given URL, and pushes a
1247 * new item onto the platform's history.
1248 *
1249 * @param path URL path to normalizze
1250 * @param query Query parameters
1251 * @param state Location history state
1252 *
1253 */
1254 go(path: string, query?: string, state?: any): void;
1255 /**
1256 * Changes the browser's URL to a normalized version of the given URL, and replaces
1257 * the top item on the platform's history stack.
1258 *
1259 * @param path URL path to normalizze
1260 * @param query Query parameters
1261 * @param state Location history state
1262 */
1263 replaceState(path: string, query?: string, state?: any): void;
1264 /**
1265 * Navigates forward in the platform's history.
1266 */
1267 forward(): void;
1268 /**
1269 * Navigates back in the platform's history.
1270 */
1271 back(): void;
1272 /**
1273 * Register URL change listeners. This API can be used to catch updates performed by the Angular
1274 * framework. These are not detectible through "popstate" or "hashchange" events.
1275 */
1276 onUrlChange(fn: (url: string, state: unknown) => void): void;
1277 /**
1278 * Subscribe to the platform's `popState` events.
1279 *
1280 * @param value Event that is triggered when the state history changes.
1281 * @param exception The exception to throw.
1282 *
1283 * @returns Subscribed events.
1284 */
1285 subscribe(onNext: (value: PopStateEvent) => void, onThrow?: ((exception: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
1286 /**
1287 * Given a string of url parameters, prepend with `?` if needed, otherwise return the
1288 * parameters as is.
1289 *
1290 * @param params String of URL parameters
1291 *
1292 * @returns URL parameters prepended with `?` or the parameters as is.
1293 */
1294 static normalizeQueryParams(params: string): string;
1295 /**
1296 * Given 2 parts of a URL, join them with a slash if needed.
1297 *
1298 * @param start URL string
1299 * @param end URL string
1300 *
1301 *
1302 * @returns Given URL strings joined with a slash, if needed.
1303 */
1304 static joinWithSlash(start: string, end: string): string;
1305 /**
1306 * If URL has a trailing slash, remove it, otherwise return the URL as is. The
1307 * method looks for the first occurrence of either `#`, `?`, or the end of the
1308 * line as `/` characters and removes the trailing slash if one exists.
1309 *
1310 * @param url URL string
1311 *
1312 * @returns Returns a URL string after removing the trailing slash if one exists, otherwise
1313 * returns the string as is.
1314 */
1315 static stripTrailingSlash(url: string): string;
1316}
1317
1318/**
1319 * @description
1320 * Indicates when a location is initialized.
1321 *
1322 * @publicApi
1323 */
1324export declare const LOCATION_INITIALIZED: InjectionToken<Promise<any>>;
1325
1326/**
1327 * @description
1328 * A serializable version of the event from `onPopState` or `onHashChange`
1329 *
1330 * @publicApi
1331 */
1332export declare interface LocationChangeEvent {
1333 type: string;
1334 state: any;
1335}
1336
1337/**
1338 * @publicApi
1339 */
1340export declare interface LocationChangeListener {
1341 (event: LocationChangeEvent): any;
1342}
1343
1344/**
1345 * `LocationStrategy` is responsible for representing and reading route state
1346 * from the browser's URL. Angular provides two strategies:
1347 * {@link HashLocationStrategy} and {@link PathLocationStrategy}.
1348 *
1349 * This is used under the hood of the {@link Location} service.
1350 *
1351 * Applications should use the {@link Router} or {@link Location} services to
1352 * interact with application route state.
1353 *
1354 * For instance, {@link HashLocationStrategy} produces URLs like
1355 * `http://example.com#/foo`, and {@link PathLocationStrategy} produces
1356 * `http://example.com/foo` as an equivalent URL.
1357 *
1358 * See these two classes for more.
1359 *
1360 * @publicApi
1361 */
1362export declare abstract class LocationStrategy {
1363 abstract path(includeHash?: boolean): string;
1364 abstract prepareExternalUrl(internal: string): string;
1365 abstract pushState(state: any, title: string, url: string, queryParams: string): void;
1366 abstract replaceState(state: any, title: string, url: string, queryParams: string): void;
1367 abstract forward(): void;
1368 abstract back(): void;
1369 abstract onPopState(fn: LocationChangeListener): void;
1370 abstract getBaseHref(): string;
1371}
1372
1373/**
1374 * Transforms text to all lower case.
1375 *
1376 * @see `UpperCasePipe`
1377 * @see `TitleCasePipe`
1378 * @usageNotes
1379 *
1380 * The following example defines a view that allows the user to enter
1381 * text, and then uses the pipe to convert the input text to all lower case.
1382 *
1383 * <code-example path="common/pipes/ts/lowerupper_pipe.ts" region='LowerUpperPipe'></code-example>
1384 *
1385 * @ngModule CommonModule
1386 * @publicApi
1387 */
1388export declare class LowerCasePipe implements PipeTransform {
1389 /**
1390 * @param value The string to transform to lower case.
1391 */
1392 transform(value: string): string;
1393}
1394
1395/**
1396 * @ngModule CommonModule
1397 *
1398 * @usageNotes
1399 * ```
1400 * <some-element [ngClass]="'first second'">...</some-element>
1401 *
1402 * <some-element [ngClass]="['first', 'second']">...</some-element>
1403 *
1404 * <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
1405 *
1406 * <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
1407 *
1408 * <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
1409 * ```
1410 *
1411 * @description
1412 *
1413 * Adds and removes CSS classes on an HTML element.
1414 *
1415 * The CSS classes are updated as follows, depending on the type of the expression evaluation:
1416 * - `string` - the CSS classes listed in the string (space delimited) are added,
1417 * - `Array` - the CSS classes declared as Array elements are added,
1418 * - `Object` - keys are CSS classes that get added when the expression given in the value
1419 * evaluates to a truthy value, otherwise they are removed.
1420 *
1421 * @publicApi
1422 */
1423export declare class NgClass extends NgClassBase implements DoCheck {
1424 constructor(delegate: ɵNgClassImpl);
1425 klass: string;
1426 ngClass: string | string[] | Set<string> | {
1427 [klass: string]: any;
1428 };
1429 ngDoCheck(): void;
1430}
1431
1432/**
1433 * Serves as the base non-VE container for NgClass.
1434 *
1435 * While this is a base class that NgClass extends from, the
1436 * class itself acts as a container for non-VE code to setup
1437 * a link to the `[class]` host binding (via the static
1438 * `ngDirectiveDef` property on the class).
1439 *
1440 * Note that the `ngDirectiveDef` property's code is switched
1441 * depending if VE is present or not (this allows for the
1442 * binding code to be set only for newer versions of Angular).
1443 *
1444 * @publicApi
1445 */
1446export declare class NgClassBase {
1447 protected _delegate: ɵNgClassImpl;
1448 static ngDirectiveDef: any;
1449 constructor(_delegate: ɵNgClassImpl);
1450 getValue(): {
1451 [key: string]: any;
1452 } | null;
1453}
1454
1455/**
1456 * Instantiates a single {@link Component} type and inserts its Host View into current View.
1457 * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
1458 *
1459 * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
1460 * any existing component will get destroyed.
1461 *
1462 * @usageNotes
1463 *
1464 * ### Fine tune control
1465 *
1466 * You can control the component creation process by using the following optional attributes:
1467 *
1468 * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
1469 * the Component. Defaults to the injector of the current view container.
1470 *
1471 * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
1472 * section of the component, if exists.
1473 *
1474 * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other
1475 * module, then load a component from that module.
1476 *
1477 * ### Syntax
1478 *
1479 * Simple
1480 * ```
1481 * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
1482 * ```
1483 *
1484 * Customized injector/content
1485 * ```
1486 * <ng-container *ngComponentOutlet="componentTypeExpression;
1487 * injector: injectorExpression;
1488 * content: contentNodesExpression;">
1489 * </ng-container>
1490 * ```
1491 *
1492 * Customized ngModuleFactory
1493 * ```
1494 * <ng-container *ngComponentOutlet="componentTypeExpression;
1495 * ngModuleFactory: moduleFactory;">
1496 * </ng-container>
1497 * ```
1498 *
1499 * ### A simple example
1500 *
1501 * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
1502 *
1503 * A more complete example with additional options:
1504 *
1505 * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
1506 *
1507 * @publicApi
1508 * @ngModule CommonModule
1509 */
1510export declare class NgComponentOutlet implements OnChanges, OnDestroy {
1511 private _viewContainerRef;
1512 ngComponentOutlet: Type<any>;
1513 ngComponentOutletInjector: Injector;
1514 ngComponentOutletContent: any[][];
1515 ngComponentOutletNgModuleFactory: NgModuleFactory<any>;
1516 private _componentRef;
1517 private _moduleRef;
1518 constructor(_viewContainerRef: ViewContainerRef);
1519 ngOnChanges(changes: SimpleChanges): void;
1520 ngOnDestroy(): void;
1521}
1522
1523/**
1524 * A [structural directive](guide/structural-directives) that renders
1525 * a template for each item in a collection.
1526 * The directive is placed on an element, which becomes the parent
1527 * of the cloned templates.
1528 *
1529 * The `ngForOf` directive is generally used in the
1530 * [shorthand form](guide/structural-directives#the-asterisk--prefix) `*ngFor`.
1531 * In this form, the template to be rendered for each iteration is the content
1532 * of an anchor element containing the directive.
1533 *
1534 * The following example shows the shorthand syntax with some options,
1535 * contained in an `<li>` element.
1536 *
1537 * ```
1538 * <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
1539 * ```
1540 *
1541 * The shorthand form expands into a long form that uses the `ngForOf` selector
1542 * on an `<ng-template>` element.
1543 * The content of the `<ng-template>` element is the `<li>` element that held the
1544 * short-form directive.
1545 *
1546 * Here is the expanded version of the short-form example.
1547 *
1548 * ```
1549 * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
1550 * <li>...</li>
1551 * </ng-template>
1552 * ```
1553 *
1554 * Angular automatically expands the shorthand syntax as it compiles the template.
1555 * The context for each embedded view is logically merged to the current component
1556 * context according to its lexical position.
1557 *
1558 * When using the shorthand syntax, Angular allows only [one structural directive
1559 * on an element](guide/structural-directives#one-structural-directive-per-host-element).
1560 * If you want to iterate conditionally, for example,
1561 * put the `*ngIf` on a container element that wraps the `*ngFor` element.
1562 * For futher discussion, see
1563 * [Structural Directives](guide/structural-directives#one-per-element).
1564 *
1565 * @usageNotes
1566 *
1567 * ### Local variables
1568 *
1569 * `NgForOf` provides exported values that can be aliased to local variables.
1570 * For example:
1571 *
1572 * ```
1573 * <li *ngFor="let user of userObservable | async as users; index as i; first as isFirst">
1574 * {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
1575 * </li>
1576 * ```
1577 *
1578 * The following exported values can be aliased to local variables:
1579 *
1580 * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
1581 * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
1582 * more complex then a property access, for example when using the async pipe (`userStreams |
1583 * async`).
1584 * - `index: number`: The index of the current item in the iterable.
1585 * - `first: boolean`: True when the item is the first item in the iterable.
1586 * - `last: boolean`: True when the item is the last item in the iterable.
1587 * - `even: boolean`: True when the item has an even index in the iterable.
1588 * - `odd: boolean`: True when the item has an odd index in the iterable.
1589 *
1590 * ### Change propagation
1591 *
1592 * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
1593 *
1594 * * When an item is added, a new instance of the template is added to the DOM.
1595 * * When an item is removed, its template instance is removed from the DOM.
1596 * * When items are reordered, their respective templates are reordered in the DOM.
1597 *
1598 * Angular uses object identity to track insertions and deletions within the iterator and reproduce
1599 * those changes in the DOM. This has important implications for animations and any stateful
1600 * controls that are present, such as `<input>` elements that accept user input. Inserted rows can
1601 * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
1602 * such as user input.
1603 * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).
1604 *
1605 * The identities of elements in the iterator can change while the data does not.
1606 * This can happen, for example, if the iterator is produced from an RPC to the server, and that
1607 * RPC is re-run. Even if the data hasn't changed, the second response produces objects with
1608 * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old
1609 * elements were deleted and all new elements inserted).
1610 *
1611 * To avoid this expensive operation, you can customize the default tracking algorithm.
1612 * by supplying the `trackBy` option to `NgForOf`.
1613 * `trackBy` takes a function that has two arguments: `index` and `item`.
1614 * If `trackBy` is given, Angular tracks changes by the return value of the function.
1615 *
1616 * @see [Structural Directives](guide/structural-directives)
1617 * @ngModule CommonModule
1618 * @publicApi
1619 */
1620export declare class NgForOf<T> implements DoCheck {
1621 private _viewContainer;
1622 private _template;
1623 private _differs;
1624 /**
1625 * The value of the iterable expression, which can be used as a
1626 * [template input variable](guide/structural-directives#template-input-variable).
1627 */
1628 ngForOf: NgIterable<T>;
1629 /**
1630 * A function that defines how to track changes for items in the iterable.
1631 *
1632 * When items are added, moved, or removed in the iterable,
1633 * the directive must re-render the appropriate DOM nodes.
1634 * To minimize churn in the DOM, only nodes that have changed
1635 * are re-rendered.
1636 *
1637 * By default, the change detector assumes that
1638 * the object instance identifies the node in the iterable.
1639 * When this function is supplied, the directive uses
1640 * the result of calling this function to identify the item node,
1641 * rather than the identity of the object itself.
1642 *
1643 * The function receives two inputs,
1644 * the iteration index and the node object ID.
1645 */
1646 ngForTrackBy: TrackByFunction<T>;
1647 private _ngForOf;
1648 private _ngForOfDirty;
1649 private _differ;
1650 private _trackByFn;
1651 constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<NgForOfContext<T>>, _differs: IterableDiffers);
1652 /**
1653 * A reference to the template that is stamped out for each item in the iterable.
1654 * @see [template reference variable](guide/template-syntax#template-reference-variables--var-)
1655 */
1656 ngForTemplate: TemplateRef<NgForOfContext<T>>;
1657 /**
1658 * Applies the changes when needed.
1659 */
1660 ngDoCheck(): void;
1661 private _applyChanges;
1662 private _perViewChange;
1663 /**
1664 * Asserts the correct type of the context for the template that `NgForOf` will render.
1665 *
1666 * The presence of this method is a signal to the Ivy template type-check compiler that the
1667 * `NgForOf` structural directive renders its template with a specific context type.
1668 */
1669 static ngTemplateContextGuard<T>(dir: NgForOf<T>, ctx: any): ctx is NgForOfContext<T>;
1670}
1671
1672/**
1673 * @publicApi
1674 */
1675export declare class NgForOfContext<T> {
1676 $implicit: T;
1677 ngForOf: NgIterable<T>;
1678 index: number;
1679 count: number;
1680 constructor($implicit: T, ngForOf: NgIterable<T>, index: number, count: number);
1681 readonly first: boolean;
1682 readonly last: boolean;
1683 readonly even: boolean;
1684 readonly odd: boolean;
1685}
1686
1687/**
1688 * A structural directive that conditionally includes a template based on the value of
1689 * an expression coerced to Boolean.
1690 * When the expression evaluates to true, Angular renders the template
1691 * provided in a `then` clause, and when false or null,
1692 * Angular renders the template provided in an optional `else` clause. The default
1693 * template for the `else` clause is blank.
1694 *
1695 * A [shorthand form](guide/structural-directives#the-asterisk--prefix) of the directive,
1696 * `*ngIf="condition"`, is generally used, provided
1697 * as an attribute of the anchor element for the inserted template.
1698 * Angular expands this into a more explicit version, in which the anchor element
1699 * is contained in an `<ng-template>` element.
1700 *
1701 * Simple form with shorthand syntax:
1702 *
1703 * ```
1704 * <div *ngIf="condition">Content to render when condition is true.</div>
1705 * ```
1706 *
1707 * Simple form with expanded syntax:
1708 *
1709 * ```
1710 * <ng-template [ngIf]="condition"><div>Content to render when condition is
1711 * true.</div></ng-template>
1712 * ```
1713 *
1714 * Form with an "else" block:
1715 *
1716 * ```
1717 * <div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
1718 * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
1719 * ```
1720 *
1721 * Shorthand form with "then" and "else" blocks:
1722 *
1723 * ```
1724 * <div *ngIf="condition; then thenBlock else elseBlock"></div>
1725 * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
1726 * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
1727 * ```
1728 *
1729 * Form with storing the value locally:
1730 *
1731 * ```
1732 * <div *ngIf="condition as value; else elseBlock">{{value}}</div>
1733 * <ng-template #elseBlock>Content to render when value is null.</ng-template>
1734 * ```
1735 *
1736 * @usageNotes
1737 *
1738 * The `*ngIf` directive is most commonly used to conditionally show an inline template,
1739 * as seen in the following example.
1740 * The default `else` template is blank.
1741 *
1742 * {@example common/ngIf/ts/module.ts region='NgIfSimple'}
1743 *
1744 * ### Showing an alternative template using `else`
1745 *
1746 * To display a template when `expression` evaluates to false, use an `else` template
1747 * binding as shown in the following example.
1748 * The `else` binding points to an `<ng-template>` element labeled `#elseBlock`.
1749 * The template can be defined anywhere in the component view, but is typically placed right after
1750 * `ngIf` for readability.
1751 *
1752 * {@example common/ngIf/ts/module.ts region='NgIfElse'}
1753 *
1754 * ### Using an external `then` template
1755 *
1756 * In the previous example, the then-clause template is specified inline, as the content of the
1757 * tag that contains the `ngIf` directive. You can also specify a template that is defined
1758 * externally, by referencing a labeled `<ng-template>` element. When you do this, you can
1759 * change which template to use at runtime, as shown in the following example.
1760 *
1761 * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
1762 *
1763 * ### Storing a conditional result in a variable
1764 *
1765 * You might want to show a set of properties from the same object. If you are waiting
1766 * for asynchronous data, the object can be undefined.
1767 * In this case, you can use `ngIf` and store the result of the condition in a local
1768 * variable as shown in the the following example.
1769 *
1770 * {@example common/ngIf/ts/module.ts region='NgIfAs'}
1771 *
1772 * This code uses only one `AsyncPipe`, so only one subscription is created.
1773 * The conditional statement stores the result of `userStream|async` in the local variable `user`.
1774 * You can then bind the local `user` repeatedly.
1775 *
1776 * The conditional displays the data only if `userStream` returns a value,
1777 * so you don't need to use the
1778 * [safe-navigation-operator](guide/template-syntax#safe-navigation-operator) (`?.`)
1779 * to guard against null values when accessing properties.
1780 * You can display an alternative template while waiting for the data.
1781 *
1782 * ### Shorthand syntax
1783 *
1784 * The shorthand syntax `*ngIf` expands into two separate template specifications
1785 * for the "then" and "else" clauses. For example, consider the following shorthand statement,
1786 * that is meant to show a loading page while waiting for data to be loaded.
1787 *
1788 * ```
1789 * <div class="hero-list" *ngIf="heroes else loading">
1790 * ...
1791 * </div>
1792 *
1793 * <ng-template #loading>
1794 * <div>Loading...</div>
1795 * </ng-template>
1796 * ```
1797 *
1798 * You can see that the "else" clause references the `<ng-template>`
1799 * with the `#loading` label, and the template for the "then" clause
1800 * is provided as the content of the anchor element.
1801 *
1802 * However, when Angular expands the shorthand syntax, it creates
1803 * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.
1804 * The anchor element containing the template for the "then" clause becomes
1805 * the content of this unlabeled `<ng-template>` tag.
1806 *
1807 * ```
1808 * <ng-template [ngIf]="hero-list" [ngIfElse]="loading">
1809 * <div class="hero-list">
1810 * ...
1811 * </div>
1812 * </ng-template>
1813 *
1814 * <ng-template #loading>
1815 * <div>Loading...</div>
1816 * </ng-template>
1817 * ```
1818 *
1819 * The presence of the implicit template object has implications for the nesting of
1820 * structural directives. For more on this subject, see
1821 * [Structural Directives](https://angular.io/guide/structural-directives#one-per-element).
1822 *
1823 * @ngModule CommonModule
1824 * @publicApi
1825 */
1826export declare class NgIf {
1827 private _viewContainer;
1828 private _context;
1829 private _thenTemplateRef;
1830 private _elseTemplateRef;
1831 private _thenViewRef;
1832 private _elseViewRef;
1833 constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext>);
1834 /**
1835 * The Boolean expression to evaluate as the condition for showing a template.
1836 */
1837 ngIf: any;
1838 /**
1839 * A template to show if the condition expression evaluates to true.
1840 */
1841 ngIfThen: TemplateRef<NgIfContext> | null;
1842 /**
1843 * A template to show if the condition expression evaluates to false.
1844 */
1845 ngIfElse: TemplateRef<NgIfContext> | null;
1846 private _updateView;
1847 /**
1848 * Assert the correct type of the expression bound to the `ngIf` input within the template.
1849 *
1850 * The presence of this method is a signal to the Ivy template type check compiler that when the
1851 * `NgIf` structural directive renders its template, the type of the expression bound to `ngIf`
1852 * should be narrowed in some way. For `NgIf`, it is narrowed to be non-null, which allows the
1853 * strictNullChecks feature of TypeScript to work with `NgIf`.
1854 */
1855 static ngTemplateGuard_ngIf<E>(dir: NgIf, expr: E): expr is NonNullable<E>;
1856}
1857
1858/**
1859 * @publicApi
1860 */
1861export declare class NgIfContext {
1862 $implicit: any;
1863 ngIf: any;
1864}
1865
1866/**
1867 * Returns the plural case based on the locale
1868 *
1869 * @publicApi
1870 */
1871export declare class NgLocaleLocalization extends NgLocalization {
1872 protected locale: string;
1873 /** @deprecated from v5 */
1874 protected deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined;
1875 constructor(locale: string,
1876 /** @deprecated from v5 */
1877 deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined);
1878 getPluralCategory(value: any, locale?: string): string;
1879}
1880
1881/**
1882 * @publicApi
1883 */
1884export declare abstract class NgLocalization {
1885 abstract getPluralCategory(value: any, locale?: string): string;
1886}
1887
1888/**
1889 * @ngModule CommonModule
1890 *
1891 * @usageNotes
1892 * ```
1893 * <some-element [ngPlural]="value">
1894 * <ng-template ngPluralCase="=0">there is nothing</ng-template>
1895 * <ng-template ngPluralCase="=1">there is one</ng-template>
1896 * <ng-template ngPluralCase="few">there are a few</ng-template>
1897 * </some-element>
1898 * ```
1899 *
1900 * @description
1901 *
1902 * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
1903 *
1904 * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
1905 * that match the switch expression's pluralization category.
1906 *
1907 * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
1908 * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
1909 * expression:
1910 * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
1911 * matches the switch expression exactly,
1912 * - otherwise, the view will be treated as a "category match", and will only display if exact
1913 * value matches aren't found and the value maps to its category for the defined locale.
1914 *
1915 * See http://cldr.unicode.org/index/cldr-spec/plural-rules
1916 *
1917 * @publicApi
1918 */
1919export declare class NgPlural {
1920 private _localization;
1921 private _switchValue;
1922 private _activeView;
1923 private _caseViews;
1924 constructor(_localization: NgLocalization);
1925 ngPlural: number;
1926 addCase(value: string, switchView: SwitchView): void;
1927 private _updateView;
1928 private _clearViews;
1929 private _activateView;
1930}
1931
1932/**
1933 * @ngModule CommonModule
1934 *
1935 * @description
1936 *
1937 * Creates a view that will be added/removed from the parent {@link NgPlural} when the
1938 * given expression matches the plural expression according to CLDR rules.
1939 *
1940 * @usageNotes
1941 * ```
1942 * <some-element [ngPlural]="value">
1943 * <ng-template ngPluralCase="=0">...</ng-template>
1944 * <ng-template ngPluralCase="other">...</ng-template>
1945 * </some-element>
1946 *```
1947 *
1948 * See {@link NgPlural} for more details and example.
1949 *
1950 * @publicApi
1951 */
1952export declare class NgPluralCase {
1953 value: string;
1954 constructor(value: string, template: TemplateRef<Object>, viewContainer: ViewContainerRef, ngPlural: NgPlural);
1955}
1956
1957/**
1958 * @ngModule CommonModule
1959 *
1960 * @usageNotes
1961 *
1962 * Set the font of the containing element to the result of an expression.
1963 *
1964 * ```
1965 * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
1966 * ```
1967 *
1968 * Set the width of the containing element to a pixel value returned by an expression.
1969 *
1970 * ```
1971 * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
1972 * ```
1973 *
1974 * Set a collection of style values using an expression that returns key-value pairs.
1975 *
1976 * ```
1977 * <some-element [ngStyle]="objExp">...</some-element>
1978 * ```
1979 *
1980 * @description
1981 *
1982 * An attribute directive that updates styles for the containing HTML element.
1983 * Sets one or more style properties, specified as colon-separated key-value pairs.
1984 * The key is a style name, with an optional `.<unit>` suffix
1985 * (such as 'top.px', 'font-style.em').
1986 * The value is an expression to be evaluated.
1987 * The resulting non-null value, expressed in the given unit,
1988 * is assigned to the given style property.
1989 * If the result of evaluation is null, the corresponding style is removed.
1990 *
1991 * @publicApi
1992 */
1993export declare class NgStyle extends NgStyleBase implements DoCheck {
1994 constructor(delegate: ɵNgStyleImpl);
1995 ngStyle: {
1996 [klass: string]: any;
1997 } | null;
1998 ngDoCheck(): void;
1999}
2000
2001/**
2002 * Serves as the base non-VE container for NgStyle.
2003 *
2004 * While this is a base class that NgStyle extends from, the
2005 * class itself acts as a container for non-VE code to setup
2006 * a link to the `[style]` host binding (via the static
2007 * `ngDirectiveDef` property on the class).
2008 *
2009 * Note that the `ngDirectiveDef` property's code is switched
2010 * depending if VE is present or not (this allows for the
2011 * binding code to be set only for newer versions of Angular).
2012 *
2013 * @publicApi
2014 */
2015export declare class NgStyleBase {
2016 protected _delegate: ɵNgStyleImpl;
2017 static ngDirectiveDef: any;
2018 constructor(_delegate: ɵNgStyleImpl);
2019 getValue(): {
2020 [key: string]: any;
2021 } | null;
2022}
2023
2024/**
2025 * @ngModule CommonModule
2026 *
2027 * @description A structural directive that adds or removes templates (displaying or hiding views)
2028 * when the next match expression matches the switch expression.
2029 *
2030 * The `[ngSwitch]` directive on a container specifies an expression to match against.
2031 * The expressions to match are provided by `ngSwitchCase` directives on views within the container.
2032 * - Every view that matches is rendered.
2033 * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.
2034 * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`
2035 * or `ngSwitchDefault` directive are preserved at the location.
2036 *
2037 * @usageNotes
2038 * Define a container element for the directive, and specify the switch expression
2039 * to match against as an attribute:
2040 *
2041 * ```
2042 * <container-element [ngSwitch]="switch_expression">
2043 * ```
2044 *
2045 * Within the container, `*ngSwitchCase` statements specify the match expressions
2046 * as attributes. Include `*ngSwitchDefault` as the final case.
2047 *
2048 * ```
2049 * <container-element [ngSwitch]="switch_expression">
2050 * <some-element *ngSwitchCase="match_expression_1">...</some-element>
2051 * ...
2052 * <some-element *ngSwitchDefault>...</some-element>
2053 * </container-element>
2054 * ```
2055 *
2056 * ### Usage Examples
2057 *
2058 * The following example shows how to use more than one case to display the same view:
2059 *
2060 * ```
2061 * <container-element [ngSwitch]="switch_expression">
2062 * <!-- the same view can be shown in more than one case -->
2063 * <some-element *ngSwitchCase="match_expression_1">...</some-element>
2064 * <some-element *ngSwitchCase="match_expression_2">...</some-element>
2065 * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
2066 * <!--default case when there are no matches -->
2067 * <some-element *ngSwitchDefault>...</some-element>
2068 * </container-element>
2069 * ```
2070 *
2071 * The following example shows how cases can be nested:
2072 * ```
2073 * <container-element [ngSwitch]="switch_expression">
2074 * <some-element *ngSwitchCase="match_expression_1">...</some-element>
2075 * <some-element *ngSwitchCase="match_expression_2">...</some-element>
2076 * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
2077 * <ng-container *ngSwitchCase="match_expression_3">
2078 * <!-- use a ng-container to group multiple root nodes -->
2079 * <inner-element></inner-element>
2080 * <inner-other-element></inner-other-element>
2081 * </ng-container>
2082 * <some-element *ngSwitchDefault>...</some-element>
2083 * </container-element>
2084 * ```
2085 *
2086 * @publicApi
2087 * @see `NgSwitchCase`
2088 * @see `NgSwitchDefault`
2089 * @see [Structural Directives](guide/structural-directives)
2090 *
2091 */
2092export declare class NgSwitch {
2093 private _defaultViews;
2094 private _defaultUsed;
2095 private _caseCount;
2096 private _lastCaseCheckIndex;
2097 private _lastCasesMatched;
2098 private _ngSwitch;
2099 ngSwitch: any;
2100 private _updateDefaultCases;
2101}
2102
2103/**
2104 * @ngModule CommonModule
2105 *
2106 * @description
2107 * Provides a switch case expression to match against an enclosing `ngSwitch` expression.
2108 * When the expressions match, the given `NgSwitchCase` template is rendered.
2109 * If multiple match expressions match the switch expression value, all of them are displayed.
2110 *
2111 * @usageNotes
2112 *
2113 * Within a switch container, `*ngSwitchCase` statements specify the match expressions
2114 * as attributes. Include `*ngSwitchDefault` as the final case.
2115 *
2116 * ```
2117 * <container-element [ngSwitch]="switch_expression">
2118 * <some-element *ngSwitchCase="match_expression_1">...</some-element>
2119 * ...
2120 * <some-element *ngSwitchDefault>...</some-element>
2121 * </container-element>
2122 * ```
2123 *
2124 * Each switch-case statement contains an in-line HTML template or template reference
2125 * that defines the subtree to be selected if the value of the match expression
2126 * matches the value of the switch expression.
2127 *
2128 * Unlike JavaScript, which uses strict equality, Angular uses loose equality.
2129 * This means that the empty string, `""` matches 0.
2130 *
2131 * @publicApi
2132 * @see `NgSwitch`
2133 * @see `NgSwitchDefault`
2134 *
2135 */
2136export declare class NgSwitchCase implements DoCheck {
2137 private ngSwitch;
2138 private _view;
2139 /**
2140 * Stores the HTML template to be selected on match.
2141 */
2142 ngSwitchCase: any;
2143 constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
2144 /**
2145 * Performs case matching. For internal use only.
2146 */
2147 ngDoCheck(): void;
2148}
2149
2150/**
2151 * @ngModule CommonModule
2152 *
2153 * @description
2154 *
2155 * Creates a view that is rendered when no `NgSwitchCase` expressions
2156 * match the `NgSwitch` expression.
2157 * This statement should be the final case in an `NgSwitch`.
2158 *
2159 * @publicApi
2160 * @see `NgSwitch`
2161 * @see `NgSwitchCase`
2162 *
2163 */
2164export declare class NgSwitchDefault {
2165 constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
2166}
2167
2168/**
2169 * @ngModule CommonModule
2170 *
2171 * @description
2172 *
2173 * Inserts an embedded view from a prepared `TemplateRef`.
2174 *
2175 * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
2176 * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
2177 * by the local template `let` declarations.
2178 *
2179 * @usageNotes
2180 * ```
2181 * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
2182 * ```
2183 *
2184 * Using the key `$implicit` in the context object will set its value as default.
2185 *
2186 * ### Example
2187 *
2188 * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
2189 *
2190 * @publicApi
2191 */
2192export declare class NgTemplateOutlet implements OnChanges {
2193 private _viewContainerRef;
2194 private _viewRef;
2195 /**
2196 * A context object to attach to the {@link EmbeddedViewRef}. This should be an
2197 * object, the object's keys will be available for binding by the local template `let`
2198 * declarations.
2199 * Using the key `$implicit` in the context object will set its value as default.
2200 */
2201 ngTemplateOutletContext: Object | null;
2202 /**
2203 * A string defining the template reference and optionally the context object for the template.
2204 */
2205 ngTemplateOutlet: TemplateRef<any> | null;
2206 constructor(_viewContainerRef: ViewContainerRef);
2207 ngOnChanges(changes: SimpleChanges): void;
2208 /**
2209 * We need to re-create existing embedded view if:
2210 * - templateRef has changed
2211 * - context has changes
2212 *
2213 * We mark context object as changed when the corresponding object
2214 * shape changes (new properties are added or existing properties are removed).
2215 * In other words we consider context with the same properties as "the same" even
2216 * if object reference changes (see https://github.com/angular/angular/issues/13407).
2217 */
2218 private _shouldRecreateView;
2219 private _hasContextShapeChanged;
2220 private _updateExistingContext;
2221}
2222
2223
2224/**
2225 * Format styles that can be used to represent numbers.
2226 * @see `getLocaleNumberFormat()`.
2227 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
2228 *
2229 * @publicApi
2230 */
2231export declare enum NumberFormatStyle {
2232 Decimal = 0,
2233 Percent = 1,
2234 Currency = 2,
2235 Scientific = 3
2236}
2237
2238/**
2239 * Symbols that can be used to replace placeholders in number patterns.
2240 * Examples are based on `en-US` values.
2241 *
2242 * @see `getLocaleNumberSymbol()`
2243 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
2244 *
2245 * @publicApi
2246 */
2247export declare enum NumberSymbol {
2248 /**
2249 * Decimal separator.
2250 * For `en-US`, the dot character.
2251 * Example : 2,345`.`67
2252 */
2253 Decimal = 0,
2254 /**
2255 * Grouping separator, typically for thousands.
2256 * For `en-US`, the comma character.
2257 * Example: 2`,`345.67
2258 */
2259 Group = 1,
2260 /**
2261 * List-item separator.
2262 * Example: "one, two, and three"
2263 */
2264 List = 2,
2265 /**
2266 * Sign for percentage (out of 100).
2267 * Example: 23.4%
2268 */
2269 PercentSign = 3,
2270 /**
2271 * Sign for positive numbers.
2272 * Example: +23
2273 */
2274 PlusSign = 4,
2275 /**
2276 * Sign for negative numbers.
2277 * Example: -23
2278 */
2279 MinusSign = 5,
2280 /**
2281 * Computer notation for exponential value (n times a power of 10).
2282 * Example: 1.2E3
2283 */
2284 Exponential = 6,
2285 /**
2286 * Human-readable format of exponential.
2287 * Example: 1.2x103
2288 */
2289 SuperscriptingExponent = 7,
2290 /**
2291 * Sign for permille (out of 1000).
2292 * Example: 23.4‰
2293 */
2294 PerMille = 8,
2295 /**
2296 * Infinity, can be used with plus and minus.
2297 * Example: ∞, +∞, -∞
2298 */
2299 Infinity = 9,
2300 /**
2301 * Not a number.
2302 * Example: NaN
2303 */
2304 NaN = 10,
2305 /**
2306 * Symbol used between time units.
2307 * Example: 10:52
2308 */
2309 TimeSeparator = 11,
2310 /**
2311 * Decimal separator for currency values (fallback to `Decimal`).
2312 * Example: $2,345.67
2313 */
2314 CurrencyDecimal = 12,
2315 /**
2316 * Group separator for currency values (fallback to `Group`).
2317 * Example: $2,345.67
2318 */
2319 CurrencyGroup = 13
2320}
2321
2322/**
2323 * @description
2324 * A {@link LocationStrategy} used to configure the {@link Location} service to
2325 * represent its state in the
2326 * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
2327 * browser's URL.
2328 *
2329 * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF}
2330 * or add a base element to the document. This URL prefix that will be preserved
2331 * when generating and recognizing URLs.
2332 *
2333 * For instance, if you provide an `APP_BASE_HREF` of `'/my/app'` and call
2334 * `location.go('/foo')`, the browser's URL will become
2335 * `example.com/my/app/foo`.
2336 *
2337 * Similarly, if you add `<base href='/my/app'/>` to the document and call
2338 * `location.go('/foo')`, the browser's URL will become
2339 * `example.com/my/app/foo`.
2340 *
2341 * @usageNotes
2342 *
2343 * ### Example
2344 *
2345 * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
2346 *
2347 * @publicApi
2348 */
2349export declare class PathLocationStrategy extends LocationStrategy {
2350 private _platformLocation;
2351 private _baseHref;
2352 constructor(_platformLocation: PlatformLocation, href?: string);
2353 onPopState(fn: LocationChangeListener): void;
2354 getBaseHref(): string;
2355 prepareExternalUrl(internal: string): string;
2356 path(includeHash?: boolean): string;
2357 pushState(state: any, title: string, url: string, queryParams: string): void;
2358 replaceState(state: any, title: string, url: string, queryParams: string): void;
2359 forward(): void;
2360 back(): void;
2361}
2362
2363/**
2364 * @ngModule CommonModule
2365 * @description
2366 *
2367 * Transforms a number to a percentage
2368 * string, formatted according to locale rules that determine group sizing and
2369 * separator, decimal-point character, and other locale-specific
2370 * configurations.
2371 *
2372 * @see `formatPercent()`
2373 *
2374 * @usageNotes
2375 * The following code shows how the pipe transforms numbers
2376 * into text strings, according to various format specifications,
2377 * where the caller's default locale is `en-US`.
2378 *
2379 * <code-example path="common/pipes/ts/percent_pipe.ts" region='PercentPipe'></code-example>
2380 *
2381 * @publicApi
2382 */
2383export declare class PercentPipe implements PipeTransform {
2384 private _locale;
2385 constructor(_locale: string);
2386 /**
2387 *
2388 * @param value The number to be formatted as a percentage.
2389 * @param digitsInfo Decimal representation options, specified by a string
2390 * in the following format:<br>
2391 * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
2392 * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
2393 * Default is `1`.
2394 * - `minFractionDigits`: The minimum number of digits after the decimal point.
2395 * Default is `0`.
2396 * - `maxFractionDigits`: The maximum number of digits after the decimal point.
2397 * Default is `0`.
2398 * @param locale A locale code for the locale format rules to use.
2399 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
2400 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
2401 */
2402 transform(value: any, digitsInfo?: string, locale?: string): string | null;
2403}
2404
2405/**
2406 * This class should not be used directly by an application developer. Instead, use
2407 * {@link Location}.
2408 *
2409 * `PlatformLocation` encapsulates all calls to DOM apis, which allows the Router to be platform
2410 * agnostic.
2411 * This means that we can have different implementation of `PlatformLocation` for the different
2412 * platforms that angular supports. For example, `@angular/platform-browser` provides an
2413 * implementation specific to the browser environment, while `@angular/platform-webworker` provides
2414 * one suitable for use with web workers.
2415 *
2416 * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
2417 * when they need to interact with the DOM apis like pushState, popState, etc...
2418 *
2419 * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
2420 * by the {@link Router} in order to navigate between routes. Since all interactions between {@link
2421 * Router} /
2422 * {@link Location} / {@link LocationStrategy} and DOM apis flow through the `PlatformLocation`
2423 * class they are all platform independent.
2424 *
2425 * @publicApi
2426 */
2427export declare abstract class PlatformLocation {
2428 abstract getBaseHrefFromDOM(): string;
2429 abstract getState(): unknown;
2430 abstract onPopState(fn: LocationChangeListener): void;
2431 abstract onHashChange(fn: LocationChangeListener): void;
2432 abstract readonly href: string;
2433 abstract readonly protocol: string;
2434 abstract readonly hostname: string;
2435 abstract readonly port: string;
2436 abstract readonly pathname: string;
2437 abstract readonly search: string;
2438 abstract readonly hash: string;
2439 abstract replaceState(state: any, title: string, url: string): void;
2440 abstract pushState(state: any, title: string, url: string): void;
2441 abstract forward(): void;
2442 abstract back(): void;
2443}
2444
2445/**
2446 * Plurality cases used for translating plurals to different languages.
2447 *
2448 * @see `NgPlural`
2449 * @see `NgPluralCase`
2450 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
2451 *
2452 * @publicApi */
2453export declare enum Plural {
2454 Zero = 0,
2455 One = 1,
2456 Two = 2,
2457 Few = 3,
2458 Many = 4,
2459 Other = 5
2460}
2461
2462/** @publicApi */
2463export declare interface PopStateEvent {
2464 pop?: boolean;
2465 state?: any;
2466 type?: string;
2467 url?: string;
2468}
2469
2470/**
2471 * Register global data to be used internally by Angular. See the
2472 * ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data.
2473 *
2474 * @publicApi
2475 */
2476declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void;
2477export { registerLocaleData }
2478export { registerLocaleData as ɵregisterLocaleData }
2479
2480/**
2481 * @ngModule CommonModule
2482 * @description
2483 *
2484 * Creates a new `Array` or `String` containing a subset (slice) of the elements.
2485 *
2486 * @usageNotes
2487 *
2488 * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
2489 * and `String.prototype.slice()`.
2490 *
2491 * When operating on an `Array`, the returned `Array` is always a copy even when all
2492 * the elements are being returned.
2493 *
2494 * When operating on a blank value, the pipe returns the blank value.
2495 *
2496 * ### List Example
2497 *
2498 * This `ngFor` example:
2499 *
2500 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
2501 *
2502 * produces the following:
2503 *
2504 * ```html
2505 * <li>b</li>
2506 * <li>c</li>
2507 * ```
2508 *
2509 * ### String Examples
2510 *
2511 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
2512 *
2513 * @publicApi
2514 */
2515export declare class SlicePipe implements PipeTransform {
2516 /**
2517 * @param value a list or a string to be sliced.
2518 * @param start the starting index of the subset to return:
2519 * - **a positive integer**: return the item at `start` index and all items after
2520 * in the list or string expression.
2521 * - **a negative integer**: return the item at `start` index from the end and all items after
2522 * in the list or string expression.
2523 * - **if positive and greater than the size of the expression**: return an empty list or
2524 * string.
2525 * - **if negative and greater than the size of the expression**: return entire list or string.
2526 * @param end the ending index of the subset to return:
2527 * - **omitted**: return all items until the end.
2528 * - **if positive**: return all items before `end` index of the list or string.
2529 * - **if negative**: return all items before `end` index from the end of the list or string.
2530 */
2531 transform<T>(value: ReadonlyArray<T>, start: number, end?: number): Array<T>;
2532 transform(value: string, start: number, end?: number): string;
2533 transform(value: null, start: number, end?: number): null;
2534 transform(value: undefined, start: number, end?: number): undefined;
2535 private supports;
2536}
2537
2538declare class SwitchView {
2539 private _viewContainerRef;
2540 private _templateRef;
2541 private _created;
2542 constructor(_viewContainerRef: ViewContainerRef, _templateRef: TemplateRef<Object>);
2543 create(): void;
2544 destroy(): void;
2545 enforceState(created: boolean): void;
2546}
2547
2548/**
2549 * Represents a time value with hours and minutes.
2550 *
2551 * @publicApi
2552 */
2553export declare type Time = {
2554 hours: number;
2555 minutes: number;
2556};
2557
2558/**
2559 * Transforms text to title case.
2560 * Capitalizes the first letter of each word, and transforms the
2561 * rest of the word to lower case.
2562 * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
2563 *
2564 * @see `LowerCasePipe`
2565 * @see `UpperCasePipe`
2566 *
2567 * @usageNotes
2568 * The following example shows the result of transforming various strings into title case.
2569 *
2570 * <code-example path="common/pipes/ts/titlecase_pipe.ts" region='TitleCasePipe'></code-example>
2571 *
2572 * @ngModule CommonModule
2573 * @publicApi
2574 */
2575export declare class TitleCasePipe implements PipeTransform {
2576 /**
2577 * @param value The string to transform to title case.
2578 */
2579 transform(value: string): string;
2580}
2581
2582/**
2583 * String widths available for translations.
2584 * The specific character widths are locale-specific.
2585 * Examples are given for the word "Sunday" in English.
2586 *
2587 * @publicApi
2588 */
2589export declare enum TranslationWidth {
2590 /** 1 character for `en-US`. For example: 'S' */
2591 Narrow = 0,
2592 /** 3 characters for `en-US`. For example: 'Sun' */
2593 Abbreviated = 1,
2594 /** Full length for `en-US`. For example: "Sunday" */
2595 Wide = 2,
2596 /** 2 characters for `en-US`, For example: "Su" */
2597 Short = 3
2598}
2599
2600/**
2601 * Transforms text to all upper case.
2602 * @see `LowerCasePipe`
2603 * @see `TitleCasePipe`
2604 *
2605 * @ngModule CommonModule
2606 * @publicApi
2607 */
2608export declare class UpperCasePipe implements PipeTransform {
2609 /**
2610 * @param value The string to transform to upper case.
2611 */
2612 transform(value: string): string;
2613}
2614
2615/**
2616 * @publicApi
2617 */
2618export declare const VERSION: Version;
2619
2620/**
2621 * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
2622 *
2623 * @publicApi
2624 */
2625export declare abstract class ViewportScroller {
2626 /** @nocollapse */
2627 static ngInjectableDef: never;
2628 /**
2629 * Configures the top offset used when scrolling to an anchor.
2630 * @param offset A position in screen coordinates (a tuple with x and y values)
2631 * or a function that returns the top offset position.
2632 *
2633 */
2634 abstract setOffset(offset: [number, number] | (() => [number, number])): void;
2635 /**
2636 * Retrieves the current scroll position.
2637 * @returns A position in screen coordinates (a tuple with x and y values).
2638 */
2639 abstract getScrollPosition(): [number, number];
2640 /**
2641 * Scrolls to a specified position.
2642 * @param position A position in screen coordinates (a tuple with x and y values).
2643 */
2644 abstract scrollToPosition(position: [number, number]): void;
2645 /**
2646 * Scrolls to an anchor element.
2647 * @param anchor The ID of the anchor element.
2648 */
2649 abstract scrollToAnchor(anchor: string): void;
2650 /**
2651 * Disables automatic scroll restoration provided by the browser.
2652 * See also [window.history.scrollRestoration
2653 * info](https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration).
2654 */
2655 abstract setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
2656}
2657
2658/**
2659 * The value for each day of the week, based on the `en-US` locale
2660 *
2661 * @publicApi
2662 */
2663export declare enum WeekDay {
2664 Sunday = 0,
2665 Monday = 1,
2666 Tuesday = 2,
2667 Wednesday = 3,
2668 Thursday = 4,
2669 Friday = 5,
2670 Saturday = 6
2671}
2672
2673/**
2674 * @deprecated from v5
2675 */
2676export declare const ɵangular_packages_common_common_a: InjectionToken<boolean>;
2677
2678/**
2679 * Returns the plural case based on the locale
2680 *
2681 * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts
2682 * @publicApi
2683 */
2684export declare function ɵangular_packages_common_common_b(locale: string, nLike: number | string): Plural;
2685
2686/**
2687 * Index of each type of locale data from the locale data array
2688 */
2689export declare const enum ɵangular_packages_common_common_c {
2690 LocaleId = 0,
2691 DayPeriodsFormat = 1,
2692 DayPeriodsStandalone = 2,
2693 DaysFormat = 3,
2694 DaysStandalone = 4,
2695 MonthsFormat = 5,
2696 MonthsStandalone = 6,
2697 Eras = 7,
2698 FirstDayOfWeek = 8,
2699 WeekendRange = 9,
2700 DateFormat = 10,
2701 TimeFormat = 11,
2702 DateTimeFormat = 12,
2703 NumberSymbols = 13,
2704 NumberFormats = 14,
2705 CurrencySymbol = 15,
2706 CurrencyName = 16,
2707 Currencies = 17,
2708 PluralCase = 18,
2709 ExtraData = 19
2710}
2711
2712/**
2713 * Finds the locale data for a given locale.
2714 *
2715 * @param locale The locale code.
2716 * @returns The locale data.
2717 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
2718 *
2719 * @publicApi
2720 */
2721export declare function ɵangular_packages_common_common_d(locale: string): any;
2722
2723/**
2724 * A collection of Angular directives that are likely to be used in each and every Angular
2725 * application.
2726 */
2727export declare const ɵangular_packages_common_common_e: Provider[];
2728
2729/**
2730 * A collection of Angular pipes that are likely to be used in each and every application.
2731 */
2732export declare const ɵangular_packages_common_common_f: (typeof AsyncPipe | typeof SlicePipe | typeof DecimalPipe | typeof PercentPipe | typeof CurrencyPipe | typeof DatePipe | typeof I18nPluralPipe | typeof I18nSelectPipe | typeof KeyValuePipe)[];
2733
2734/**
2735 * A collection of deprecated i18n pipes that require intl api
2736 *
2737 * @deprecated from v5
2738 */
2739export declare const ɵangular_packages_common_common_g: Provider[];
2740
2741export declare class ɵangular_packages_common_common_h implements ɵNgClassImpl {
2742 private _value;
2743 private _ngClassDiffer;
2744 private _classStringDiffer;
2745 getValue(): {
2746 [key: string]: boolean;
2747 } | null;
2748 setClass(value: string): void;
2749 setNgClass(value: string | string[] | Set<string> | {
2750 [klass: string]: any;
2751 }): void;
2752 applyChanges(): void;
2753}
2754
2755export declare const ɵangular_packages_common_common_i: {
2756 provide: typeof ɵNgClassImpl;
2757 useClass: typeof ɵNgClassR2Impl;
2758};
2759
2760export declare const ɵangular_packages_common_common_j: {
2761 provide: typeof ɵNgClassImpl;
2762 useClass: typeof ɵNgClassR2Impl;
2763};
2764
2765export declare class ɵangular_packages_common_common_k implements ɵNgStyleImpl {
2766 private _differ;
2767 private _value;
2768 getValue(): {
2769 [key: string]: any;
2770 } | null;
2771 setNgStyle(value: {
2772 [key: string]: any;
2773 } | null): void;
2774 applyChanges(): void;
2775}
2776
2777export declare const ɵangular_packages_common_common_l: {
2778 provide: typeof ɵNgStyleImpl;
2779 useClass: typeof ɵNgStyleR2Impl;
2780};
2781
2782export declare const ɵangular_packages_common_common_m: {
2783 provide: typeof ɵNgStyleImpl;
2784 useClass: typeof ɵNgStyleR2Impl;
2785};
2786
2787export declare const ɵngClassDirectiveDef__POST_R3__: never;
2788
2789/**
2790 * Used as a token for an injected service within the NgClass directive.
2791 *
2792 * NgClass behaves differenly whether or not VE is being used or not. If
2793 * present then the legacy ngClass diffing algorithm will be used as an
2794 * injected service. Otherwise the new diffing algorithm (which delegates
2795 * to the `[class]` binding) will be used. This toggle behavior is done so
2796 * via the ivy_switch mechanism.
2797 */
2798export declare abstract class ɵNgClassImpl {
2799 abstract setClass(value: string): void;
2800 abstract setNgClass(value: string | string[] | Set<string> | {
2801 [klass: string]: any;
2802 }): void;
2803 abstract applyChanges(): void;
2804 abstract getValue(): {
2805 [key: string]: any;
2806 } | null;
2807}
2808
2809export declare const ɵNgClassImplProvider__POST_R3__: {
2810 provide: typeof ɵNgClassImpl;
2811 useClass: typeof ɵangular_packages_common_common_h;
2812};
2813
2814export declare class ɵNgClassR2Impl implements ɵNgClassImpl {
2815 private _iterableDiffers;
2816 private _keyValueDiffers;
2817 private _ngEl;
2818 private _renderer;
2819 private _iterableDiffer;
2820 private _keyValueDiffer;
2821 private _initialClasses;
2822 private _rawClass;
2823 constructor(_iterableDiffers: IterableDiffers, _keyValueDiffers: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer2);
2824 getValue(): null;
2825 setClass(value: string): void;
2826 setNgClass(value: string): void;
2827 applyChanges(): void;
2828 private _applyKeyValueChanges;
2829 private _applyIterableChanges;
2830 /**
2831 * Applies a collection of CSS classes to the DOM element.
2832 *
2833 * For argument of type Set and Array CSS class names contained in those collections are always
2834 * added.
2835 * For argument of type Map CSS class name in the map's key is toggled based on the value (added
2836 * for truthy and removed for falsy).
2837 */
2838 private _applyClasses;
2839 /**
2840 * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup
2841 * purposes.
2842 */
2843 private _removeClasses;
2844 private _toggleClass;
2845}
2846
2847export declare const ɵngStyleDirectiveDef__POST_R3__: never;
2848
2849/**
2850 * Used as a token for an injected service within the NgStyle directive.
2851 *
2852 * NgStyle behaves differenly whether or not VE is being used or not. If
2853 * present then the legacy ngClass diffing algorithm will be used as an
2854 * injected service. Otherwise the new diffing algorithm (which delegates
2855 * to the `[style]` binding) will be used. This toggle behavior is done so
2856 * via the ivy_switch mechanism.
2857 */
2858export declare abstract class ɵNgStyleImpl {
2859 abstract getValue(): {
2860 [key: string]: any;
2861 } | null;
2862 abstract setNgStyle(value: {
2863 [key: string]: any;
2864 } | null): void;
2865 abstract applyChanges(): void;
2866}
2867
2868export declare const ɵNgStyleImplProvider__POST_R3__: {
2869 provide: typeof ɵNgStyleImpl;
2870 useClass: typeof ɵangular_packages_common_common_k;
2871};
2872
2873export declare class ɵNgStyleR2Impl implements ɵNgStyleImpl {
2874 private _ngEl;
2875 private _differs;
2876 private _renderer;
2877 private _ngStyle;
2878 private _differ;
2879 constructor(_ngEl: ElementRef, _differs: KeyValueDiffers, _renderer: Renderer2);
2880 getValue(): null;
2881 /**
2882 * A map of style properties, specified as colon-separated
2883 * key-value pairs.
2884 * * The key is a style name, with an optional `.<unit>` suffix
2885 * (such as 'top.px', 'font-style.em').
2886 * * The value is an expression to be evaluated.
2887 */
2888 setNgStyle(values: {
2889 [key: string]: string;
2890 }): void;
2891 /**
2892 * Applies the new styles if needed.
2893 */
2894 applyChanges(): void;
2895 private _applyChanges;
2896 private _setStyle;
2897}
2898
2899/**
2900 * Provides an empty implementation of the viewport scroller. This will
2901 * live in @angular/common as it will be used by both platform-server and platform-webworker.
2902 */
2903export declare class ɵNullViewportScroller implements ViewportScroller {
2904 /**
2905 * Empty implementation
2906 */
2907 setOffset(offset: [number, number] | (() => [number, number])): void;
2908 /**
2909 * Empty implementation
2910 */
2911 getScrollPosition(): [number, number];
2912 /**
2913 * Empty implementation
2914 */
2915 scrollToPosition(position: [number, number]): void;
2916 /**
2917 * Empty implementation
2918 */
2919 scrollToAnchor(anchor: string): void;
2920 /**
2921 * Empty implementation
2922 */
2923 setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
2924}
2925
2926
2927export declare function ɵparseCookieValue(cookieStr: string, name: string): string | null;
2928
2929
2930export declare const ɵPLATFORM_BROWSER_ID = "browser";
2931
2932export declare const ɵPLATFORM_SERVER_ID = "server";
2933
2934export declare const ɵPLATFORM_WORKER_APP_ID = "browserWorkerApp";
2935
2936export declare const ɵPLATFORM_WORKER_UI_ID = "browserWorkerUi";
2937
2938export { }
2939
\No newline at end of file