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