UNPKG

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