UNPKG

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