UNPKG

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