source: trip-planner-front/node_modules/@angular/common/common.d.ts@ 8d391a1

Last change on this file since 8d391a1 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

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