@angular/common 20.0.0-next.3 → 20.0.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,13 +1,18 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.3
2
+ * @license Angular v20.0.0-next.5
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i0 from '@angular/core';
8
- import { ɵNavigation as _Navigation, ɵNavigationHistoryEntry as _NavigationHistoryEntry, ɵNavigationUpdateCurrentEntryOptions as _NavigationUpdateCurrentEntryOptions, ɵNavigationTransition as _NavigationTransition, ɵNavigationNavigateOptions as _NavigationNavigateOptions, ɵNavigationResult as _NavigationResult, ɵNavigationReloadOptions as _NavigationReloadOptions, ɵNavigationOptions as _NavigationOptions, ɵNavigateEvent as _NavigateEvent, ɵNavigationCurrentEntryChangeEvent as _NavigationCurrentEntryChangeEvent, InjectionToken, OnDestroy, DoCheck, ElementRef, Renderer2, OnChanges, Type, Injector, NgModuleFactory, ViewContainerRef, SimpleChanges, NgIterable, TrackByFunction, TemplateRef, IterableDiffers, KeyValueDiffers, PipeTransform, ChangeDetectorRef, Version, Provider, OnInit } from '@angular/core';
9
- export { ɵIMAGE_CONFIG as IMAGE_CONFIG, ɵImageConfig as ImageConfig } from '@angular/core';
10
- import { SubscriptionLike, Observable, Subscribable } from 'rxjs';
8
+ import { ɵNavigation as _Navigation, ɵNavigationHistoryEntry as _NavigationHistoryEntry, ɵNavigationUpdateCurrentEntryOptions as _NavigationUpdateCurrentEntryOptions, ɵNavigationTransition as _NavigationTransition, ɵNavigationNavigateOptions as _NavigationNavigateOptions, ɵNavigationResult as _NavigationResult, ɵNavigationReloadOptions as _NavigationReloadOptions, ɵNavigationOptions as _NavigationOptions, ɵNavigateEvent as _NavigateEvent, ɵNavigationCurrentEntryChangeEvent as _NavigationCurrentEntryChangeEvent, OnDestroy, Version, InjectionToken, Provider, OnInit, OnChanges, SimpleChanges } from '@angular/core';
9
+ export { DOCUMENT, ɵIMAGE_CONFIG as IMAGE_CONFIG, ɵImageConfig as ImageConfig } from '@angular/core';
10
+ import { L as LocationStrategy } from './common_module.d-BP8xLQft.js';
11
+ export { y as APP_BASE_HREF, A as AsyncPipe, C as CommonModule, t as CurrencyPipe, q as DATE_PIPE_DEFAULT_OPTIONS, p as DATE_PIPE_DEFAULT_TIMEZONE, D as DatePipe, o as DatePipeConfig, u as DecimalPipe, I as I18nPluralPipe, r as I18nSelectPipe, J as JsonPipe, v as KeyValue, K as KeyValuePipe, w as Location, s as LowerCasePipe, b as NgClass, n as NgComponentOutlet, c as NgFor, c as NgForOf, d as NgForOfContext, e as NgIf, f as NgIfContext, N as NgLocaleLocalization, a as NgLocalization, g as NgPlural, h as NgPluralCase, i as NgStyle, j as NgSwitch, k as NgSwitchCase, l as NgSwitchDefault, m as NgTemplateOutlet, z as PathLocationStrategy, P as PercentPipe, x as PopStateEvent, S as SlicePipe, T as TitleCasePipe, U as UpperCasePipe } from './common_module.d-BP8xLQft.js';
12
+ import { P as PlatformLocation, L as LocationChangeListener } from './platform_location.d-BWJDgVlg.js';
13
+ export { B as BrowserPlatformLocation, a as LOCATION_INITIALIZED, b as LocationChangeEvent } from './platform_location.d-BWJDgVlg.js';
14
+ export { X as XhrFactory } from './xhr.d-Bbgj1reV.js';
15
+ import 'rxjs';
11
16
 
12
17
  declare function getDOM(): DomAdapter;
13
18
  declare function setRootDomAdapter(adapter: DomAdapter): void;
@@ -61,217 +66,6 @@ declare abstract class PlatformNavigation implements _Navigation {
61
66
  static ɵprov: i0.ɵɵInjectableDeclaration<PlatformNavigation>;
62
67
  }
63
68
 
64
- /**
65
- * This class should not be used directly by an application developer. Instead, use
66
- * {@link Location}.
67
- *
68
- * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be
69
- * platform-agnostic.
70
- * This means that we can have different implementation of `PlatformLocation` for the different
71
- * platforms that Angular supports. For example, `@angular/platform-browser` provides an
72
- * implementation specific to the browser environment, while `@angular/platform-server` provides
73
- * one suitable for use with server-side rendering.
74
- *
75
- * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
76
- * when they need to interact with the DOM APIs like pushState, popState, etc.
77
- *
78
- * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
79
- * by the {@link /api/router/Router Router} in order to navigate between routes. Since all interactions between
80
- * {@link /api/router/Router Router} /
81
- * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`
82
- * class, they are all platform-agnostic.
83
- *
84
- * @publicApi
85
- */
86
- declare abstract class PlatformLocation {
87
- abstract getBaseHrefFromDOM(): string;
88
- abstract getState(): unknown;
89
- /**
90
- * Returns a function that, when executed, removes the `popstate` event handler.
91
- */
92
- abstract onPopState(fn: LocationChangeListener): VoidFunction;
93
- /**
94
- * Returns a function that, when executed, removes the `hashchange` event handler.
95
- */
96
- abstract onHashChange(fn: LocationChangeListener): VoidFunction;
97
- abstract get href(): string;
98
- abstract get protocol(): string;
99
- abstract get hostname(): string;
100
- abstract get port(): string;
101
- abstract get pathname(): string;
102
- abstract get search(): string;
103
- abstract get hash(): string;
104
- abstract replaceState(state: any, title: string, url: string): void;
105
- abstract pushState(state: any, title: string, url: string): void;
106
- abstract forward(): void;
107
- abstract back(): void;
108
- historyGo?(relativePosition: number): void;
109
- static ɵfac: i0.ɵɵFactoryDeclaration<PlatformLocation, never>;
110
- static ɵprov: i0.ɵɵInjectableDeclaration<PlatformLocation>;
111
- }
112
- /**
113
- * @description
114
- * Indicates when a location is initialized.
115
- *
116
- * @publicApi
117
- */
118
- declare const LOCATION_INITIALIZED: InjectionToken<Promise<any>>;
119
- /**
120
- * @description
121
- * A serializable version of the event from `onPopState` or `onHashChange`
122
- *
123
- * @publicApi
124
- */
125
- interface LocationChangeEvent {
126
- type: string;
127
- state: any;
128
- }
129
- /**
130
- * @publicApi
131
- */
132
- interface LocationChangeListener {
133
- (event: LocationChangeEvent): any;
134
- }
135
- /**
136
- * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
137
- * This class should not be used directly by an application developer. Instead, use
138
- * {@link Location}.
139
- *
140
- * @publicApi
141
- */
142
- declare class BrowserPlatformLocation extends PlatformLocation {
143
- private _location;
144
- private _history;
145
- private _doc;
146
- constructor();
147
- getBaseHrefFromDOM(): string;
148
- onPopState(fn: LocationChangeListener): VoidFunction;
149
- onHashChange(fn: LocationChangeListener): VoidFunction;
150
- get href(): string;
151
- get protocol(): string;
152
- get hostname(): string;
153
- get port(): string;
154
- get pathname(): string;
155
- get search(): string;
156
- get hash(): string;
157
- set pathname(newPath: string);
158
- pushState(state: any, title: string, url: string): void;
159
- replaceState(state: any, title: string, url: string): void;
160
- forward(): void;
161
- back(): void;
162
- historyGo(relativePosition?: number): void;
163
- getState(): unknown;
164
- static ɵfac: i0.ɵɵFactoryDeclaration<BrowserPlatformLocation, never>;
165
- static ɵprov: i0.ɵɵInjectableDeclaration<BrowserPlatformLocation>;
166
- }
167
-
168
- /**
169
- * Enables the `Location` service to read route state from the browser's URL.
170
- * Angular provides two strategies:
171
- * `HashLocationStrategy` and `PathLocationStrategy`.
172
- *
173
- * Applications should use the `Router` or `Location` services to
174
- * interact with application route state.
175
- *
176
- * For instance, `HashLocationStrategy` produces URLs like
177
- * <code class="no-auto-link">http://example.com/#/foo</code>,
178
- * and `PathLocationStrategy` produces
179
- * <code class="no-auto-link">http://example.com/foo</code> as an equivalent URL.
180
- *
181
- * See these two classes for more.
182
- *
183
- * @publicApi
184
- */
185
- declare abstract class LocationStrategy {
186
- abstract path(includeHash?: boolean): string;
187
- abstract prepareExternalUrl(internal: string): string;
188
- abstract getState(): unknown;
189
- abstract pushState(state: any, title: string, url: string, queryParams: string): void;
190
- abstract replaceState(state: any, title: string, url: string, queryParams: string): void;
191
- abstract forward(): void;
192
- abstract back(): void;
193
- historyGo?(relativePosition: number): void;
194
- abstract onPopState(fn: LocationChangeListener): void;
195
- abstract getBaseHref(): string;
196
- static ɵfac: i0.ɵɵFactoryDeclaration<LocationStrategy, never>;
197
- static ɵprov: i0.ɵɵInjectableDeclaration<LocationStrategy>;
198
- }
199
- /**
200
- * A predefined DI token for the base href
201
- * to be used with the `PathLocationStrategy`.
202
- * The base href is the URL prefix that should be preserved when generating
203
- * and recognizing URLs.
204
- *
205
- * @usageNotes
206
- *
207
- * The following example shows how to use this token to configure the root app injector
208
- * with a base href value, so that the DI framework can supply the dependency anywhere in the app.
209
- *
210
- * ```ts
211
- * import {NgModule} from '@angular/core';
212
- * import {APP_BASE_HREF} from '@angular/common';
213
- *
214
- * @NgModule({
215
- * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
216
- * })
217
- * class AppModule {}
218
- * ```
219
- *
220
- * @publicApi
221
- */
222
- declare const APP_BASE_HREF: InjectionToken<string>;
223
- /**
224
- * @description
225
- * A {@link LocationStrategy} used to configure the {@link Location} service to
226
- * represent its state in the
227
- * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
228
- * browser's URL.
229
- *
230
- * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}
231
- * or add a `<base href>` element to the document to override the default.
232
- *
233
- * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call
234
- * `location.go('/foo')`, the browser's URL will become
235
- * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,
236
- * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.
237
- *
238
- * Similarly, if you add `<base href='/my/app/'/>` to the document and call
239
- * `location.go('/foo')`, the browser's URL will become
240
- * `example.com/my/app/foo`.
241
- *
242
- * Note that when using `PathLocationStrategy`, neither the query nor
243
- * the fragment in the `<base href>` will be preserved, as outlined
244
- * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).
245
- *
246
- * @usageNotes
247
- *
248
- * ### Example
249
- *
250
- * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
251
- *
252
- * @publicApi
253
- */
254
- declare class PathLocationStrategy extends LocationStrategy implements OnDestroy {
255
- private _platformLocation;
256
- private _baseHref;
257
- private _removeListenerFns;
258
- constructor(_platformLocation: PlatformLocation, href?: string);
259
- /** @nodoc */
260
- ngOnDestroy(): void;
261
- onPopState(fn: LocationChangeListener): void;
262
- getBaseHref(): string;
263
- prepareExternalUrl(internal: string): string;
264
- path(includeHash?: boolean): string;
265
- pushState(state: any, title: string, url: string, queryParams: string): void;
266
- replaceState(state: any, title: string, url: string, queryParams: string): void;
267
- forward(): void;
268
- back(): void;
269
- getState(): unknown;
270
- historyGo(relativePosition?: number): void;
271
- static ɵfac: i0.ɵɵFactoryDeclaration<PathLocationStrategy, [null, { optional: true; }]>;
272
- static ɵprov: i0.ɵɵInjectableDeclaration<PathLocationStrategy>;
273
- }
274
-
275
69
  /**
276
70
  * @description
277
71
  * A {@link LocationStrategy} used to configure the {@link Location} service to
@@ -311,180 +105,6 @@ declare class HashLocationStrategy extends LocationStrategy implements OnDestroy
311
105
  static ɵprov: i0.ɵɵInjectableDeclaration<HashLocationStrategy>;
312
106
  }
313
107
 
314
- /** @publicApi */
315
- interface PopStateEvent {
316
- pop?: boolean;
317
- state?: any;
318
- type?: string;
319
- url?: string;
320
- }
321
- /**
322
- * @description
323
- *
324
- * A service that applications can use to interact with a browser's URL.
325
- *
326
- * Depending on the `LocationStrategy` used, `Location` persists
327
- * to the URL's path or the URL's hash segment.
328
- *
329
- * @usageNotes
330
- *
331
- * It's better to use the `Router.navigate()` service to trigger route changes. Use
332
- * `Location` only if you need to interact with or create normalized URLs outside of
333
- * routing.
334
- *
335
- * `Location` is responsible for normalizing the URL against the application's base href.
336
- * A normalized URL is absolute from the URL host, includes the application's base href, and has no
337
- * trailing slash:
338
- * - `/my/app/user/123` is normalized
339
- * - `my/app/user/123` **is not** normalized
340
- * - `/my/app/user/123/` **is not** normalized
341
- *
342
- * ### Example
343
- *
344
- * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
345
- *
346
- * @publicApi
347
- */
348
- declare class Location implements OnDestroy {
349
- constructor(locationStrategy: LocationStrategy);
350
- /** @nodoc */
351
- ngOnDestroy(): void;
352
- /**
353
- * Normalizes the URL path for this location.
354
- *
355
- * @param includeHash True to include an anchor fragment in the path.
356
- *
357
- * @returns The normalized URL path.
358
- */
359
- path(includeHash?: boolean): string;
360
- /**
361
- * Reports the current state of the location history.
362
- * @returns The current value of the `history.state` object.
363
- */
364
- getState(): unknown;
365
- /**
366
- * Normalizes the given path and compares to the current normalized path.
367
- *
368
- * @param path The given URL path.
369
- * @param query Query parameters.
370
- *
371
- * @returns True if the given URL path is equal to the current normalized path, false
372
- * otherwise.
373
- */
374
- isCurrentPathEqualTo(path: string, query?: string): boolean;
375
- /**
376
- * Normalizes a URL path by stripping any trailing slashes.
377
- *
378
- * @param url String representing a URL.
379
- *
380
- * @returns The normalized URL string.
381
- */
382
- normalize(url: string): string;
383
- /**
384
- * Normalizes an external URL path.
385
- * If the given URL doesn't begin with a leading slash (`'/'`), adds one
386
- * before normalizing. Adds a hash if `HashLocationStrategy` is
387
- * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
388
- *
389
- * @param url String representing a URL.
390
- *
391
- * @returns A normalized platform-specific URL.
392
- */
393
- prepareExternalUrl(url: string): string;
394
- /**
395
- * Changes the browser's URL to a normalized version of a given URL, and pushes a
396
- * new item onto the platform's history.
397
- *
398
- * @param path URL path to normalize.
399
- * @param query Query parameters.
400
- * @param state Location history state.
401
- *
402
- */
403
- go(path: string, query?: string, state?: any): void;
404
- /**
405
- * Changes the browser's URL to a normalized version of the given URL, and replaces
406
- * the top item on the platform's history stack.
407
- *
408
- * @param path URL path to normalize.
409
- * @param query Query parameters.
410
- * @param state Location history state.
411
- */
412
- replaceState(path: string, query?: string, state?: any): void;
413
- /**
414
- * Navigates forward in the platform's history.
415
- */
416
- forward(): void;
417
- /**
418
- * Navigates back in the platform's history.
419
- */
420
- back(): void;
421
- /**
422
- * Navigate to a specific page from session history, identified by its relative position to the
423
- * current page.
424
- *
425
- * @param relativePosition Position of the target page in the history relative to the current
426
- * page.
427
- * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
428
- * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
429
- * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
430
- * when `relativePosition` equals 0.
431
- * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
432
- */
433
- historyGo(relativePosition?: number): void;
434
- /**
435
- * Registers a URL change listener. Use to catch updates performed by the Angular
436
- * framework that are not detectible through "popstate" or "hashchange" events.
437
- *
438
- * @param fn The change handler function, which take a URL and a location history state.
439
- * @returns A function that, when executed, unregisters a URL change listener.
440
- */
441
- onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
442
- /**
443
- * Subscribes to the platform's `popState` events.
444
- *
445
- * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
446
- * `Location.onUrlChange()` to subscribe to URL changes instead.
447
- *
448
- * @param value Event that is triggered when the state history changes.
449
- * @param exception The exception to throw.
450
- *
451
- * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
452
- *
453
- * @returns Subscribed events.
454
- */
455
- subscribe(onNext: (value: PopStateEvent) => void, onThrow?: ((exception: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
456
- /**
457
- * Normalizes URL parameters by prepending with `?` if needed.
458
- *
459
- * @param params String of URL parameters.
460
- *
461
- * @returns The normalized URL parameters string.
462
- */
463
- static normalizeQueryParams: (params: string) => string;
464
- /**
465
- * Joins two parts of a URL with a slash if needed.
466
- *
467
- * @param start URL string
468
- * @param end URL string
469
- *
470
- *
471
- * @returns The joined URL string.
472
- */
473
- static joinWithSlash: (start: string, end: string) => string;
474
- /**
475
- * Removes a trailing slash from a URL string if needed.
476
- * Looks for the first occurrence of either `#`, `?`, or the end of the
477
- * line as `/` characters and removes the trailing slash if one exists.
478
- *
479
- * @param url URL string.
480
- *
481
- * @returns The URL string, modified if needed.
482
- */
483
- static stripTrailingSlash: (url: string) => string;
484
- static ɵfac: i0.ɵɵFactoryDeclaration<Location, never>;
485
- static ɵprov: i0.ɵɵInjectableDeclaration<Location>;
486
- }
487
-
488
108
  /**
489
109
  * @ngModule CommonModule
490
110
  * @description
@@ -572,27 +192,6 @@ declare function formatPercent(value: number, locale: string, digitsInfo?: strin
572
192
  */
573
193
  declare function formatNumber(value: number, locale: string, digitsInfo?: string): string;
574
194
 
575
- /**
576
- * @publicApi
577
- */
578
- declare abstract class NgLocalization {
579
- abstract getPluralCategory(value: any, locale?: string): string;
580
- static ɵfac: i0.ɵɵFactoryDeclaration<NgLocalization, never>;
581
- static ɵprov: i0.ɵɵInjectableDeclaration<NgLocalization>;
582
- }
583
- /**
584
- * Returns the plural case based on the locale
585
- *
586
- * @publicApi
587
- */
588
- declare class NgLocaleLocalization extends NgLocalization {
589
- protected locale: string;
590
- constructor(locale: string);
591
- getPluralCategory(value: any, locale?: string): string;
592
- static ɵfac: i0.ɵɵFactoryDeclaration<NgLocaleLocalization, never>;
593
- static ɵprov: i0.ɵɵInjectableDeclaration<NgLocaleLocalization>;
594
- }
595
-
596
195
  /**
597
196
  * Register global data to be used internally by Angular. See the
598
197
  * ["I18n guide"](guide/i18n/format-data-locale) to know how to import additional locale
@@ -1174,1680 +773,48 @@ declare function getNumberOfCurrencyDigits(code: string): number;
1174
773
 
1175
774
  declare function parseCookieValue(cookieStr: string, name: string): string | null;
1176
775
 
776
+ declare const PLATFORM_BROWSER_ID = "browser";
777
+ declare const PLATFORM_SERVER_ID = "server";
1177
778
  /**
1178
- * @ngModule CommonModule
1179
- *
1180
- * @usageNotes
1181
- * ```html
1182
- * <some-element [ngClass]="stringExp|arrayExp|objExp|Set">...</some-element>
1183
- *
1184
- * <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
1185
- * ```
1186
- *
1187
- * For more simple use cases you can use the [class bindings](/guide/templates/binding#css-class-and-style-property-bindings) directly.
1188
- * It doesn't require importing a directive.
1189
- *
1190
- * ```html
1191
- * <some-element [class]="'first second'">...</some-element>
1192
- *
1193
- * <some-element [class.expanded]="isExpanded">...</some-element>
1194
- *
1195
- * <some-element [class]="['first', 'second']">...</some-element>
1196
- *
1197
- * <some-element [class]="{'first': true, 'second': true, 'third': false}">...</some-element>
1198
- * ```
779
+ * Returns whether a platform id represents a browser platform.
780
+ * @publicApi
781
+ */
782
+ declare function isPlatformBrowser(platformId: Object): boolean;
783
+ /**
784
+ * Returns whether a platform id represents a server platform.
785
+ * @publicApi
786
+ */
787
+ declare function isPlatformServer(platformId: Object): boolean;
788
+
789
+ /**
790
+ * @module
1199
791
  * @description
1200
- *
1201
- * Adds and removes CSS classes on an HTML element.
1202
- *
1203
- * The CSS classes are updated as follows, depending on the type of the expression evaluation:
1204
- * - `string` - the CSS classes listed in the string (space delimited) are added,
1205
- * - `Array` - the CSS classes declared as Array elements are added,
1206
- * - `Object` - keys are CSS classes that get added when the expression given in the value
1207
- * evaluates to a truthy value, otherwise they are removed.
1208
- *
1209
- *
1210
- * @see [Class bindings](/guide/templates/binding#css-class-and-style-property-bindings)
1211
- *
792
+ * Entry point for all public APIs of the common package.
793
+ */
794
+
795
+ /**
1212
796
  * @publicApi
1213
797
  */
1214
- declare class NgClass implements DoCheck {
1215
- private _ngEl;
1216
- private _renderer;
1217
- private initialClasses;
1218
- private rawClass;
1219
- private stateMap;
1220
- constructor(_ngEl: ElementRef, _renderer: Renderer2);
1221
- set klass(value: string);
1222
- set ngClass(value: string | string[] | Set<string> | {
1223
- [klass: string]: any;
1224
- } | null | undefined);
1225
- ngDoCheck(): void;
1226
- private _updateState;
1227
- private _applyStateDiff;
1228
- private _toggleClass;
1229
- static ɵfac: i0.ɵɵFactoryDeclaration<NgClass, never>;
1230
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgClass, "[ngClass]", never, { "klass": { "alias": "class"; "required": false; }; "ngClass": { "alias": "ngClass"; "required": false; }; }, {}, never, never, true, never>;
1231
- }
798
+ declare const VERSION: Version;
1232
799
 
1233
800
  /**
1234
- * Instantiates a {@link /api/core/Component Component} type and inserts its Host View into the current View.
1235
- * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
1236
- *
1237
- * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
1238
- * any existing component will be destroyed.
1239
- *
1240
- * @usageNotes
1241
- *
1242
- * ### Fine tune control
1243
- *
1244
- * You can control the component creation process by using the following optional attributes:
1245
- *
1246
- * * `ngComponentOutletInputs`: Optional component inputs object, which will be bind to the
1247
- * component.
1248
- *
1249
- * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
1250
- * the Component. Defaults to the injector of the current view container.
1251
- *
1252
- * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
1253
- * section of the component, if it exists.
1254
- *
1255
- * * `ngComponentOutletNgModule`: Optional NgModule class reference to allow loading another
1256
- * module dynamically, then loading a component from that module.
1257
- *
1258
- * * `ngComponentOutletNgModuleFactory`: Deprecated config option that allows providing optional
1259
- * NgModule factory to allow loading another module dynamically, then loading a component from that
1260
- * module. Use `ngComponentOutletNgModule` instead.
1261
- *
1262
- * ### Syntax
1263
- *
1264
- * Simple
1265
- * ```html
1266
- * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
1267
- * ```
1268
- *
1269
- * With inputs
1270
- * ```html
1271
- * <ng-container *ngComponentOutlet="componentTypeExpression;
1272
- * inputs: inputsExpression;">
1273
- * </ng-container>
1274
- * ```
1275
- *
1276
- * Customized injector/content
1277
- * ```html
1278
- * <ng-container *ngComponentOutlet="componentTypeExpression;
1279
- * injector: injectorExpression;
1280
- * content: contentNodesExpression;">
1281
- * </ng-container>
1282
- * ```
1283
- *
1284
- * Customized NgModule reference
1285
- * ```html
1286
- * <ng-container *ngComponentOutlet="componentTypeExpression;
1287
- * ngModule: ngModuleClass;">
1288
- * </ng-container>
1289
- * ```
1290
- *
1291
- * ### A simple example
1292
- *
1293
- * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
1294
- *
1295
- * A more complete example with additional options:
1296
- *
1297
- * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
801
+ * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
1298
802
  *
1299
803
  * @publicApi
1300
- * @ngModule CommonModule
1301
804
  */
1302
- declare class NgComponentOutlet<T = any> implements OnChanges, DoCheck, OnDestroy {
1303
- private _viewContainerRef;
1304
- /** Component that should be rendered in the outlet. */
1305
- ngComponentOutlet: Type<any> | null;
1306
- ngComponentOutletInputs?: Record<string, unknown>;
1307
- ngComponentOutletInjector?: Injector;
1308
- ngComponentOutletContent?: any[][];
1309
- ngComponentOutletNgModule?: Type<any>;
805
+ declare abstract class ViewportScroller {
806
+ /** @nocollapse */
807
+ static ɵprov: unknown;
1310
808
  /**
1311
- * @deprecated This input is deprecated, use `ngComponentOutletNgModule` instead.
809
+ * Configures the top offset used when scrolling to an anchor.
810
+ * @param offset A position in screen coordinates (a tuple with x and y values)
811
+ * or a function that returns the top offset position.
812
+ *
1312
813
  */
1313
- ngComponentOutletNgModuleFactory?: NgModuleFactory<any>;
1314
- private _componentRef;
1315
- private _moduleRef;
814
+ abstract setOffset(offset: [number, number] | (() => [number, number])): void;
1316
815
  /**
1317
- * A helper data structure that allows us to track inputs that were part of the
1318
- * ngComponentOutletInputs expression. Tracking inputs is necessary for proper removal of ones
1319
- * that are no longer referenced.
1320
- */
1321
- private _inputsUsed;
1322
- /**
1323
- * Gets the instance of the currently-rendered component.
1324
- * Will be null if no component has been rendered.
1325
- */
1326
- get componentInstance(): T | null;
1327
- constructor(_viewContainerRef: ViewContainerRef);
1328
- private _needToReCreateNgModuleInstance;
1329
- private _needToReCreateComponentInstance;
1330
- /** @nodoc */
1331
- ngOnChanges(changes: SimpleChanges): void;
1332
- /** @nodoc */
1333
- ngDoCheck(): void;
1334
- /** @nodoc */
1335
- ngOnDestroy(): void;
1336
- private _applyInputStateDiff;
1337
- static ɵfac: i0.ɵɵFactoryDeclaration<NgComponentOutlet<any>, never>;
1338
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutlet<any>, "[ngComponentOutlet]", ["ngComponentOutlet"], { "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>;
1339
- }
1340
-
1341
- /**
1342
- * @publicApi
1343
- */
1344
- declare class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
1345
- /** Reference to the current item from the collection. */
1346
- $implicit: T;
1347
- /**
1348
- * The value of the iterable expression. Useful when the expression is
1349
- * more complex then a property access, for example when using the async pipe
1350
- * (`userStreams | async`).
1351
- */
1352
- ngForOf: U;
1353
- /** Returns an index of the current item in the collection. */
1354
- index: number;
1355
- /** Returns total amount of items in the collection. */
1356
- count: number;
1357
- constructor(
1358
- /** Reference to the current item from the collection. */
1359
- $implicit: T,
1360
- /**
1361
- * The value of the iterable expression. Useful when the expression is
1362
- * more complex then a property access, for example when using the async pipe
1363
- * (`userStreams | async`).
1364
- */
1365
- ngForOf: U,
1366
- /** Returns an index of the current item in the collection. */
1367
- index: number,
1368
- /** Returns total amount of items in the collection. */
1369
- count: number);
1370
- get first(): boolean;
1371
- get last(): boolean;
1372
- get even(): boolean;
1373
- get odd(): boolean;
1374
- }
1375
- /**
1376
- * A [structural directive](guide/directives/structural-directives) that renders
1377
- * a template for each item in a collection.
1378
- * The directive is placed on an element, which becomes the parent
1379
- * of the cloned templates.
1380
- *
1381
- * The `ngForOf` directive is generally used in the
1382
- * [shorthand form](guide/directives/structural-directives#asterisk) `*ngFor`.
1383
- * In this form, the template to be rendered for each iteration is the content
1384
- * of an anchor element containing the directive.
1385
- *
1386
- * The following example shows the shorthand syntax with some options,
1387
- * contained in an `<li>` element.
1388
- *
1389
- * ```html
1390
- * <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
1391
- * ```
1392
- *
1393
- * The shorthand form expands into a long form that uses the `ngForOf` selector
1394
- * on an `<ng-template>` element.
1395
- * The content of the `<ng-template>` element is the `<li>` element that held the
1396
- * short-form directive.
1397
- *
1398
- * Here is the expanded version of the short-form example.
1399
- *
1400
- * ```html
1401
- * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
1402
- * <li>...</li>
1403
- * </ng-template>
1404
- * ```
1405
- *
1406
- * Angular automatically expands the shorthand syntax as it compiles the template.
1407
- * The context for each embedded view is logically merged to the current component
1408
- * context according to its lexical position.
1409
- *
1410
- * When using the shorthand syntax, Angular allows only [one structural directive
1411
- * on an element](guide/directives/structural-directives#one-per-element).
1412
- * If you want to iterate conditionally, for example,
1413
- * put the `*ngIf` on a container element that wraps the `*ngFor` element.
1414
- * For further discussion, see
1415
- * [Structural Directives](guide/directives/structural-directives#one-per-element).
1416
- *
1417
- * @usageNotes
1418
- *
1419
- * ### Local variables
1420
- *
1421
- * `NgForOf` provides exported values that can be aliased to local variables.
1422
- * For example:
1423
- *
1424
- * ```html
1425
- * <li *ngFor="let user of users; index as i; first as isFirst">
1426
- * {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
1427
- * </li>
1428
- * ```
1429
- *
1430
- * The following exported values can be aliased to local variables:
1431
- *
1432
- * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
1433
- * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
1434
- * more complex then a property access, for example when using the async pipe (`userStreams |
1435
- * async`).
1436
- * - `index: number`: The index of the current item in the iterable.
1437
- * - `count: number`: The length of the iterable.
1438
- * - `first: boolean`: True when the item is the first item in the iterable.
1439
- * - `last: boolean`: True when the item is the last item in the iterable.
1440
- * - `even: boolean`: True when the item has an even index in the iterable.
1441
- * - `odd: boolean`: True when the item has an odd index in the iterable.
1442
- *
1443
- * ### Change propagation
1444
- *
1445
- * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
1446
- *
1447
- * * When an item is added, a new instance of the template is added to the DOM.
1448
- * * When an item is removed, its template instance is removed from the DOM.
1449
- * * When items are reordered, their respective templates are reordered in the DOM.
1450
- *
1451
- * Angular uses object identity to track insertions and deletions within the iterator and reproduce
1452
- * those changes in the DOM. This has important implications for animations and any stateful
1453
- * controls that are present, such as `<input>` elements that accept user input. Inserted rows can
1454
- * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
1455
- * such as user input.
1456
- * For more on animations, see [Transitions and Triggers](guide/animations/transition-and-triggers).
1457
- *
1458
- * The identities of elements in the iterator can change while the data does not.
1459
- * This can happen, for example, if the iterator is produced from an RPC to the server, and that
1460
- * RPC is re-run. Even if the data hasn't changed, the second response produces objects with
1461
- * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old
1462
- * elements were deleted and all new elements inserted).
1463
- *
1464
- * To avoid this expensive operation, you can customize the default tracking algorithm.
1465
- * by supplying the `trackBy` option to `NgForOf`.
1466
- * `trackBy` takes a function that has two arguments: `index` and `item`.
1467
- * If `trackBy` is given, Angular tracks changes by the return value of the function.
1468
- *
1469
- * @see [Structural Directives](guide/directives/structural-directives)
1470
- * @ngModule CommonModule
1471
- * @publicApi
1472
- */
1473
- declare class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> implements DoCheck {
1474
- private _viewContainer;
1475
- private _template;
1476
- private _differs;
1477
- /**
1478
- * The value of the iterable expression, which can be used as a
1479
- * [template input variable](guide/directives/structural-directives#shorthand).
1480
- */
1481
- set ngForOf(ngForOf: (U & NgIterable<T>) | undefined | null);
1482
- /**
1483
- * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
1484
- *
1485
- * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
1486
- * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
1487
- * as the key.
1488
- *
1489
- * `NgForOf` uses the computed key to associate items in an iterable with DOM elements
1490
- * it produces for these items.
1491
- *
1492
- * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
1493
- * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
1494
- * primary key), and this iterable could be updated with new object instances that still
1495
- * represent the same underlying entity (for example, when data is re-fetched from the server,
1496
- * and the iterable is recreated and re-rendered, but most of the data is still the same).
1497
- *
1498
- * @see {@link TrackByFunction}
1499
- */
1500
- set ngForTrackBy(fn: TrackByFunction<T>);
1501
- get ngForTrackBy(): TrackByFunction<T>;
1502
- private _ngForOf;
1503
- private _ngForOfDirty;
1504
- private _differ;
1505
- private _trackByFn;
1506
- constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<NgForOfContext<T, U>>, _differs: IterableDiffers);
1507
- /**
1508
- * A reference to the template that is stamped out for each item in the iterable.
1509
- * @see [template reference variable](guide/templates/variables#template-reference-variables)
1510
- */
1511
- set ngForTemplate(value: TemplateRef<NgForOfContext<T, U>>);
1512
- /**
1513
- * Applies the changes when needed.
1514
- * @nodoc
1515
- */
1516
- ngDoCheck(): void;
1517
- private _applyChanges;
1518
- /**
1519
- * Asserts the correct type of the context for the template that `NgForOf` will render.
1520
- *
1521
- * The presence of this method is a signal to the Ivy template type-check compiler that the
1522
- * `NgForOf` structural directive renders its template with a specific context type.
1523
- */
1524
- static ngTemplateContextGuard<T, U extends NgIterable<T>>(dir: NgForOf<T, U>, ctx: any): ctx is NgForOfContext<T, U>;
1525
- static ɵfac: i0.ɵɵFactoryDeclaration<NgForOf<any, any>, never>;
1526
- 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>;
1527
- }
1528
-
1529
- /**
1530
- * A structural directive that conditionally includes a template based on the value of
1531
- * an expression coerced to Boolean.
1532
- * When the expression evaluates to true, Angular renders the template
1533
- * provided in a `then` clause, and when false or null,
1534
- * Angular renders the template provided in an optional `else` clause. The default
1535
- * template for the `else` clause is blank.
1536
- *
1537
- * A [shorthand form](guide/directives/structural-directives#asterisk) of the directive,
1538
- * `*ngIf="condition"`, is generally used, provided
1539
- * as an attribute of the anchor element for the inserted template.
1540
- * Angular expands this into a more explicit version, in which the anchor element
1541
- * is contained in an `<ng-template>` element.
1542
- *
1543
- * Simple form with shorthand syntax:
1544
- *
1545
- * ```html
1546
- * <div *ngIf="condition">Content to render when condition is true.</div>
1547
- * ```
1548
- *
1549
- * Simple form with expanded syntax:
1550
- *
1551
- * ```html
1552
- * <ng-template [ngIf]="condition"><div>Content to render when condition is
1553
- * true.</div></ng-template>
1554
- * ```
1555
- *
1556
- * Form with an "else" block:
1557
- *
1558
- * ```html
1559
- * <div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
1560
- * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
1561
- * ```
1562
- *
1563
- * Shorthand form with "then" and "else" blocks:
1564
- *
1565
- * ```html
1566
- * <div *ngIf="condition; then thenBlock else elseBlock"></div>
1567
- * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
1568
- * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
1569
- * ```
1570
- *
1571
- * Form with storing the value locally:
1572
- *
1573
- * ```html
1574
- * <div *ngIf="condition as value; else elseBlock">{{value}}</div>
1575
- * <ng-template #elseBlock>Content to render when value is null.</ng-template>
1576
- * ```
1577
- *
1578
- * @usageNotes
1579
- *
1580
- * The `*ngIf` directive is most commonly used to conditionally show an inline template,
1581
- * as seen in the following example.
1582
- * The default `else` template is blank.
1583
- *
1584
- * {@example common/ngIf/ts/module.ts region='NgIfSimple'}
1585
- *
1586
- * ### Showing an alternative template using `else`
1587
- *
1588
- * To display a template when `expression` evaluates to false, use an `else` template
1589
- * binding as shown in the following example.
1590
- * The `else` binding points to an `<ng-template>` element labeled `#elseBlock`.
1591
- * The template can be defined anywhere in the component view, but is typically placed right after
1592
- * `ngIf` for readability.
1593
- *
1594
- * {@example common/ngIf/ts/module.ts region='NgIfElse'}
1595
- *
1596
- * ### Using an external `then` template
1597
- *
1598
- * In the previous example, the then-clause template is specified inline, as the content of the
1599
- * tag that contains the `ngIf` directive. You can also specify a template that is defined
1600
- * externally, by referencing a labeled `<ng-template>` element. When you do this, you can
1601
- * change which template to use at runtime, as shown in the following example.
1602
- *
1603
- * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
1604
- *
1605
- * ### Storing a conditional result in a variable
1606
- *
1607
- * You might want to show a set of properties from the same object. If you are waiting
1608
- * for asynchronous data, the object can be undefined.
1609
- * In this case, you can use `ngIf` and store the result of the condition in a local
1610
- * variable as shown in the following example.
1611
- *
1612
- * {@example common/ngIf/ts/module.ts region='NgIfAs'}
1613
- *
1614
- * This code uses only one `AsyncPipe`, so only one subscription is created.
1615
- * The conditional statement stores the result of `userStream|async` in the local variable `user`.
1616
- * You can then bind the local `user` repeatedly.
1617
- *
1618
- * The conditional displays the data only if `userStream` returns a value,
1619
- * so you don't need to use the
1620
- * safe-navigation-operator (`?.`)
1621
- * to guard against null values when accessing properties.
1622
- * You can display an alternative template while waiting for the data.
1623
- *
1624
- * ### Shorthand syntax
1625
- *
1626
- * The shorthand syntax `*ngIf` expands into two separate template specifications
1627
- * for the "then" and "else" clauses. For example, consider the following shorthand statement,
1628
- * that is meant to show a loading page while waiting for data to be loaded.
1629
- *
1630
- * ```html
1631
- * <div class="hero-list" *ngIf="heroes else loading">
1632
- * ...
1633
- * </div>
1634
- *
1635
- * <ng-template #loading>
1636
- * <div>Loading...</div>
1637
- * </ng-template>
1638
- * ```
1639
- *
1640
- * You can see that the "else" clause references the `<ng-template>`
1641
- * with the `#loading` label, and the template for the "then" clause
1642
- * is provided as the content of the anchor element.
1643
- *
1644
- * However, when Angular expands the shorthand syntax, it creates
1645
- * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.
1646
- * The anchor element containing the template for the "then" clause becomes
1647
- * the content of this unlabeled `<ng-template>` tag.
1648
- *
1649
- * ```html
1650
- * <ng-template [ngIf]="heroes" [ngIfElse]="loading">
1651
- * <div class="hero-list">
1652
- * ...
1653
- * </div>
1654
- * </ng-template>
1655
- *
1656
- * <ng-template #loading>
1657
- * <div>Loading...</div>
1658
- * </ng-template>
1659
- * ```
1660
- *
1661
- * The presence of the implicit template object has implications for the nesting of
1662
- * structural directives. For more on this subject, see
1663
- * [Structural Directives](guide/directives/structural-directives#one-per-element).
1664
- *
1665
- * @ngModule CommonModule
1666
- * @publicApi
1667
- */
1668
- declare class NgIf<T = unknown> {
1669
- private _viewContainer;
1670
- private _context;
1671
- private _thenTemplateRef;
1672
- private _elseTemplateRef;
1673
- private _thenViewRef;
1674
- private _elseViewRef;
1675
- constructor(_viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext<T>>);
1676
- /**
1677
- * The Boolean expression to evaluate as the condition for showing a template.
1678
- */
1679
- set ngIf(condition: T);
1680
- /**
1681
- * A template to show if the condition expression evaluates to true.
1682
- */
1683
- set ngIfThen(templateRef: TemplateRef<NgIfContext<T>> | null);
1684
- /**
1685
- * A template to show if the condition expression evaluates to false.
1686
- */
1687
- set ngIfElse(templateRef: TemplateRef<NgIfContext<T>> | null);
1688
- private _updateView;
1689
- /**
1690
- * Assert the correct type of the expression bound to the `ngIf` input within the template.
1691
- *
1692
- * The presence of this static field is a signal to the Ivy template type check compiler that
1693
- * when the `NgIf` structural directive renders its template, the type of the expression bound
1694
- * to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to
1695
- * narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.
1696
- */
1697
- static ngTemplateGuard_ngIf: 'binding';
1698
- /**
1699
- * Asserts the correct type of the context for the template that `NgIf` will render.
1700
- *
1701
- * The presence of this method is a signal to the Ivy template type-check compiler that the
1702
- * `NgIf` structural directive renders its template with a specific context type.
1703
- */
1704
- static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any): ctx is NgIfContext<Exclude<T, false | 0 | '' | null | undefined>>;
1705
- static ɵfac: i0.ɵɵFactoryDeclaration<NgIf<any>, never>;
1706
- 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>;
1707
- }
1708
- /**
1709
- * @publicApi
1710
- */
1711
- declare class NgIfContext<T = unknown> {
1712
- $implicit: T;
1713
- ngIf: T;
1714
- }
1715
-
1716
- /**
1717
- * @ngModule CommonModule
1718
- *
1719
- * @description
1720
- *
1721
- * Inserts an embedded view from a prepared `TemplateRef`.
1722
- *
1723
- * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
1724
- * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
1725
- * by the local template `let` declarations.
1726
- *
1727
- * @usageNotes
1728
- * ```html
1729
- * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
1730
- * ```
1731
- *
1732
- * Using the key `$implicit` in the context object will set its value as default.
1733
- *
1734
- * ### Example
1735
- *
1736
- * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
1737
- *
1738
- * @publicApi
1739
- */
1740
- declare class NgTemplateOutlet<C = unknown> implements OnChanges {
1741
- private _viewContainerRef;
1742
- private _viewRef;
1743
- /**
1744
- * A context object to attach to the {@link EmbeddedViewRef}. This should be an
1745
- * object, the object's keys will be available for binding by the local template `let`
1746
- * declarations.
1747
- * Using the key `$implicit` in the context object will set its value as default.
1748
- */
1749
- ngTemplateOutletContext: C | null;
1750
- /**
1751
- * A string defining the template reference and optionally the context object for the template.
1752
- */
1753
- ngTemplateOutlet: TemplateRef<C> | null;
1754
- /** Injector to be used within the embedded view. */
1755
- ngTemplateOutletInjector: Injector | null;
1756
- constructor(_viewContainerRef: ViewContainerRef);
1757
- ngOnChanges(changes: SimpleChanges): void;
1758
- /**
1759
- * We need to re-create existing embedded view if either is true:
1760
- * - the outlet changed.
1761
- * - the injector changed.
1762
- */
1763
- private _shouldRecreateView;
1764
- /**
1765
- * For a given outlet instance, we create a proxy object that delegates
1766
- * to the user-specified context. This allows changing, or swapping out
1767
- * the context object completely without having to destroy/re-create the view.
1768
- */
1769
- private _createContextForwardProxy;
1770
- static ɵfac: i0.ɵɵFactoryDeclaration<NgTemplateOutlet<any>, never>;
1771
- 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>;
1772
- }
1773
-
1774
- /**
1775
- * @ngModule CommonModule
1776
- *
1777
- * @usageNotes
1778
- *
1779
- * Set the width of the containing element to a pixel value returned by an expression.
1780
- *
1781
- * ```html
1782
- * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
1783
- * ```
1784
- *
1785
- * Set a collection of style values using an expression that returns key-value pairs.
1786
- *
1787
- * ```html
1788
- * <some-element [ngStyle]="objExp">...</some-element>
1789
- * ```
1790
- *
1791
- * For more simple use cases you can use the [style bindings](/guide/templates/binding#css-class-and-style-property-bindings) directly.
1792
- * It doesn't require importing a directive.
1793
- *
1794
- * Set the font of the containing element to the result of an expression.
1795
- *
1796
- * ```html
1797
- * <some-element [style]="{'font-style': styleExp}">...</some-element>
1798
- * ```
1799
- *
1800
- * @description
1801
- *
1802
- * An attribute directive that updates styles for the containing HTML element.
1803
- * Sets one or more style properties, specified as colon-separated key-value pairs.
1804
- * The key is a style name, with an optional `.<unit>` suffix
1805
- * (such as 'top.px', 'font-style.em').
1806
- * The value is an expression to be evaluated.
1807
- * The resulting non-null value, expressed in the given unit,
1808
- * is assigned to the given style property.
1809
- * If the result of evaluation is null, the corresponding style is removed.
1810
- *
1811
- * @see [Style bindings](/guide/templates/binding#css-class-and-style-property-bindings)
1812
- *
1813
- * @publicApi
1814
- */
1815
- declare class NgStyle implements DoCheck {
1816
- private _ngEl;
1817
- private _differs;
1818
- private _renderer;
1819
- private _ngStyle;
1820
- private _differ;
1821
- constructor(_ngEl: ElementRef, _differs: KeyValueDiffers, _renderer: Renderer2);
1822
- set ngStyle(values: {
1823
- [klass: string]: any;
1824
- } | null | undefined);
1825
- ngDoCheck(): void;
1826
- private _setStyle;
1827
- private _applyChanges;
1828
- static ɵfac: i0.ɵɵFactoryDeclaration<NgStyle, never>;
1829
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgStyle, "[ngStyle]", never, { "ngStyle": { "alias": "ngStyle"; "required": false; }; }, {}, never, never, true, never>;
1830
- }
1831
-
1832
- declare class SwitchView {
1833
- private _viewContainerRef;
1834
- private _templateRef;
1835
- private _created;
1836
- constructor(_viewContainerRef: ViewContainerRef, _templateRef: TemplateRef<Object>);
1837
- create(): void;
1838
- destroy(): void;
1839
- enforceState(created: boolean): void;
1840
- }
1841
- /**
1842
- * @ngModule CommonModule
1843
- *
1844
- * @description
1845
- * The `[ngSwitch]` directive on a container specifies an expression to match against.
1846
- * The expressions to match are provided by `ngSwitchCase` directives on views within the container.
1847
- * - Every view that matches is rendered.
1848
- * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.
1849
- * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`
1850
- * or `ngSwitchDefault` directive are preserved at the location.
1851
- *
1852
- * @usageNotes
1853
- * Define a container element for the directive, and specify the switch expression
1854
- * to match against as an attribute:
1855
- *
1856
- * ```html
1857
- * <container-element [ngSwitch]="switch_expression">
1858
- * ```
1859
- *
1860
- * Within the container, `*ngSwitchCase` statements specify the match expressions
1861
- * as attributes. Include `*ngSwitchDefault` as the final case.
1862
- *
1863
- * ```html
1864
- * <container-element [ngSwitch]="switch_expression">
1865
- * <some-element *ngSwitchCase="match_expression_1">...</some-element>
1866
- * ...
1867
- * <some-element *ngSwitchDefault>...</some-element>
1868
- * </container-element>
1869
- * ```
1870
- *
1871
- * ### Usage Examples
1872
- *
1873
- * The following example shows how to use more than one case to display the same view:
1874
- *
1875
- * ```html
1876
- * <container-element [ngSwitch]="switch_expression">
1877
- * <!-- the same view can be shown in more than one case -->
1878
- * <some-element *ngSwitchCase="match_expression_1">...</some-element>
1879
- * <some-element *ngSwitchCase="match_expression_2">...</some-element>
1880
- * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
1881
- * <!--default case when there are no matches -->
1882
- * <some-element *ngSwitchDefault>...</some-element>
1883
- * </container-element>
1884
- * ```
1885
- *
1886
- * The following example shows how cases can be nested:
1887
- * ```html
1888
- * <container-element [ngSwitch]="switch_expression">
1889
- * <some-element *ngSwitchCase="match_expression_1">...</some-element>
1890
- * <some-element *ngSwitchCase="match_expression_2">...</some-element>
1891
- * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
1892
- * <ng-container *ngSwitchCase="match_expression_3">
1893
- * <!-- use a ng-container to group multiple root nodes -->
1894
- * <inner-element></inner-element>
1895
- * <inner-other-element></inner-other-element>
1896
- * </ng-container>
1897
- * <some-element *ngSwitchDefault>...</some-element>
1898
- * </container-element>
1899
- * ```
1900
- *
1901
- * @publicApi
1902
- * @see {@link NgSwitchCase}
1903
- * @see {@link NgSwitchDefault}
1904
- * @see [Structural Directives](guide/directives/structural-directives)
1905
- *
1906
- */
1907
- declare class NgSwitch {
1908
- private _defaultViews;
1909
- private _defaultUsed;
1910
- private _caseCount;
1911
- private _lastCaseCheckIndex;
1912
- private _lastCasesMatched;
1913
- private _ngSwitch;
1914
- set ngSwitch(newValue: any);
1915
- private _updateDefaultCases;
1916
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitch, never>;
1917
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitch, "[ngSwitch]", never, { "ngSwitch": { "alias": "ngSwitch"; "required": false; }; }, {}, never, never, true, never>;
1918
- }
1919
- /**
1920
- * @ngModule CommonModule
1921
- *
1922
- * @description
1923
- * Provides a switch case expression to match against an enclosing `ngSwitch` expression.
1924
- * When the expressions match, the given `NgSwitchCase` template is rendered.
1925
- * If multiple match expressions match the switch expression value, all of them are displayed.
1926
- *
1927
- * @usageNotes
1928
- *
1929
- * Within a switch container, `*ngSwitchCase` statements specify the match expressions
1930
- * as attributes. Include `*ngSwitchDefault` as the final case.
1931
- *
1932
- * ```html
1933
- * <container-element [ngSwitch]="switch_expression">
1934
- * <some-element *ngSwitchCase="match_expression_1">...</some-element>
1935
- * ...
1936
- * <some-element *ngSwitchDefault>...</some-element>
1937
- * </container-element>
1938
- * ```
1939
- *
1940
- * Each switch-case statement contains an in-line HTML template or template reference
1941
- * that defines the subtree to be selected if the value of the match expression
1942
- * matches the value of the switch expression.
1943
- *
1944
- * As of Angular v17 the NgSwitch directive uses strict equality comparison (`===`) instead of
1945
- * loose equality (`==`) to match different cases.
1946
- *
1947
- * @publicApi
1948
- * @see {@link NgSwitch}
1949
- * @see {@link NgSwitchDefault}
1950
- *
1951
- */
1952
- declare class NgSwitchCase implements DoCheck {
1953
- private ngSwitch;
1954
- private _view;
1955
- /**
1956
- * Stores the HTML template to be selected on match.
1957
- */
1958
- ngSwitchCase: any;
1959
- constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
1960
- /**
1961
- * Performs case matching. For internal use only.
1962
- * @nodoc
1963
- */
1964
- ngDoCheck(): void;
1965
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchCase, [null, null, { optional: true; host: true; }]>;
1966
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchCase, "[ngSwitchCase]", never, { "ngSwitchCase": { "alias": "ngSwitchCase"; "required": false; }; }, {}, never, never, true, never>;
1967
- }
1968
- /**
1969
- * @ngModule CommonModule
1970
- *
1971
- * @description
1972
- *
1973
- * Creates a view that is rendered when no `NgSwitchCase` expressions
1974
- * match the `NgSwitch` expression.
1975
- * This statement should be the final case in an `NgSwitch`.
1976
- *
1977
- * @publicApi
1978
- * @see {@link NgSwitch}
1979
- * @see {@link NgSwitchCase}
1980
- *
1981
- */
1982
- declare class NgSwitchDefault {
1983
- constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
1984
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSwitchDefault, [null, null, { optional: true; host: true; }]>;
1985
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSwitchDefault, "[ngSwitchDefault]", never, {}, {}, never, never, true, never>;
1986
- }
1987
-
1988
- /**
1989
- * @ngModule CommonModule
1990
- *
1991
- * @usageNotes
1992
- * ```html
1993
- * <some-element [ngPlural]="value">
1994
- * <ng-template ngPluralCase="=0">there is nothing</ng-template>
1995
- * <ng-template ngPluralCase="=1">there is one</ng-template>
1996
- * <ng-template ngPluralCase="few">there are a few</ng-template>
1997
- * </some-element>
1998
- * ```
1999
- *
2000
- * @description
2001
- *
2002
- * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
2003
- *
2004
- * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
2005
- * that match the switch expression's pluralization category.
2006
- *
2007
- * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
2008
- * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
2009
- * expression:
2010
- * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
2011
- * matches the switch expression exactly,
2012
- * - otherwise, the view will be treated as a "category match", and will only display if exact
2013
- * value matches aren't found and the value maps to its category for the defined locale.
2014
- *
2015
- * See http://cldr.unicode.org/index/cldr-spec/plural-rules
2016
- *
2017
- * @publicApi
2018
- */
2019
- declare class NgPlural {
2020
- private _localization;
2021
- private _activeView?;
2022
- private _caseViews;
2023
- constructor(_localization: NgLocalization);
2024
- set ngPlural(value: number);
2025
- addCase(value: string, switchView: SwitchView): void;
2026
- private _updateView;
2027
- private _clearViews;
2028
- private _activateView;
2029
- static ɵfac: i0.ɵɵFactoryDeclaration<NgPlural, never>;
2030
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgPlural, "[ngPlural]", never, { "ngPlural": { "alias": "ngPlural"; "required": false; }; }, {}, never, never, true, never>;
2031
- }
2032
- /**
2033
- * @ngModule CommonModule
2034
- *
2035
- * @description
2036
- *
2037
- * Creates a view that will be added/removed from the parent {@link NgPlural} when the
2038
- * given expression matches the plural expression according to CLDR rules.
2039
- *
2040
- * @usageNotes
2041
- * ```html
2042
- * <some-element [ngPlural]="value">
2043
- * <ng-template ngPluralCase="=0">...</ng-template>
2044
- * <ng-template ngPluralCase="other">...</ng-template>
2045
- * </some-element>
2046
- *```
2047
- *
2048
- * See {@link NgPlural} for more details and example.
2049
- *
2050
- * @publicApi
2051
- */
2052
- declare class NgPluralCase {
2053
- value: string;
2054
- constructor(value: string, template: TemplateRef<Object>, viewContainer: ViewContainerRef, ngPlural: NgPlural);
2055
- static ɵfac: i0.ɵɵFactoryDeclaration<NgPluralCase, [{ attribute: "ngPluralCase"; }, null, null, { host: true; }]>;
2056
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgPluralCase, "[ngPluralCase]", never, {}, {}, never, never, true, never>;
2057
- }
2058
-
2059
- /**
2060
- * @ngModule CommonModule
2061
- * @description
2062
- *
2063
- * Unwraps a value from an asynchronous primitive.
2064
- *
2065
- * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
2066
- * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
2067
- * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
2068
- * potential memory leaks. When the reference of the expression changes, the `async` pipe
2069
- * automatically unsubscribes from the old `Observable` or `Promise` and subscribes to the new one.
2070
- *
2071
- * @usageNotes
2072
- *
2073
- * ### Examples
2074
- *
2075
- * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
2076
- * promise.
2077
- *
2078
- * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
2079
- *
2080
- * It's also possible to use `async` with Observables. The example below binds the `time` Observable
2081
- * to the view. The Observable continuously updates the view with the current time.
2082
- *
2083
- * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
2084
- *
2085
- * @publicApi
2086
- */
2087
- declare class AsyncPipe implements OnDestroy, PipeTransform {
2088
- private _ref;
2089
- private _latestValue;
2090
- private markForCheckOnValueUpdate;
2091
- private _subscription;
2092
- private _obj;
2093
- private _strategy;
2094
- private readonly applicationErrorHandler;
2095
- constructor(ref: ChangeDetectorRef);
2096
- ngOnDestroy(): void;
2097
- transform<T>(obj: Observable<T> | Subscribable<T> | Promise<T>): T | null;
2098
- transform<T>(obj: null | undefined): null;
2099
- transform<T>(obj: Observable<T> | Subscribable<T> | Promise<T> | null | undefined): T | null;
2100
- private _subscribe;
2101
- private _selectStrategy;
2102
- private _dispose;
2103
- private _updateLatestValue;
2104
- static ɵfac: i0.ɵɵFactoryDeclaration<AsyncPipe, never>;
2105
- static ɵpipe: i0.ɵɵPipeDeclaration<AsyncPipe, "async", true>;
2106
- }
2107
-
2108
- /**
2109
- * Transforms text to all lower case.
2110
- *
2111
- * @see {@link UpperCasePipe}
2112
- * @see {@link TitleCasePipe}
2113
- * @usageNotes
2114
- *
2115
- * The following example defines a view that allows the user to enter
2116
- * text, and then uses the pipe to convert the input text to all lower case.
2117
- *
2118
- * {@example common/pipes/ts/lowerupper_pipe.ts region='LowerUpperPipe'}
2119
- *
2120
- * @ngModule CommonModule
2121
- * @publicApi
2122
- */
2123
- declare class LowerCasePipe implements PipeTransform {
2124
- /**
2125
- * @param value The string to transform to lower case.
2126
- */
2127
- transform(value: string): string;
2128
- transform(value: null | undefined): null;
2129
- transform(value: string | null | undefined): string | null;
2130
- static ɵfac: i0.ɵɵFactoryDeclaration<LowerCasePipe, never>;
2131
- static ɵpipe: i0.ɵɵPipeDeclaration<LowerCasePipe, "lowercase", true>;
2132
- }
2133
- /**
2134
- * Transforms text to title case.
2135
- * Capitalizes the first letter of each word and transforms the
2136
- * rest of the word to lower case.
2137
- * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
2138
- *
2139
- * @see {@link LowerCasePipe}
2140
- * @see {@link UpperCasePipe}
2141
- *
2142
- * @usageNotes
2143
- * The following example shows the result of transforming various strings into title case.
2144
- *
2145
- * {@example common/pipes/ts/titlecase_pipe.ts region='TitleCasePipe'}
2146
- *
2147
- * @ngModule CommonModule
2148
- * @publicApi
2149
- */
2150
- declare class TitleCasePipe implements PipeTransform {
2151
- /**
2152
- * @param value The string to transform to title case.
2153
- */
2154
- transform(value: string): string;
2155
- transform(value: null | undefined): null;
2156
- transform(value: string | null | undefined): string | null;
2157
- static ɵfac: i0.ɵɵFactoryDeclaration<TitleCasePipe, never>;
2158
- static ɵpipe: i0.ɵɵPipeDeclaration<TitleCasePipe, "titlecase", true>;
2159
- }
2160
- /**
2161
- * Transforms text to all upper case.
2162
- * @see {@link LowerCasePipe}
2163
- * @see {@link TitleCasePipe}
2164
- *
2165
- * @ngModule CommonModule
2166
- * @publicApi
2167
- */
2168
- declare class UpperCasePipe implements PipeTransform {
2169
- /**
2170
- * @param value The string to transform to upper case.
2171
- */
2172
- transform(value: string): string;
2173
- transform(value: null | undefined): null;
2174
- transform(value: string | null | undefined): string | null;
2175
- static ɵfac: i0.ɵɵFactoryDeclaration<UpperCasePipe, never>;
2176
- static ɵpipe: i0.ɵɵPipeDeclaration<UpperCasePipe, "uppercase", true>;
2177
- }
2178
-
2179
- /**
2180
- * @ngModule CommonModule
2181
- * @description
2182
- *
2183
- * Converts a value into its JSON-format representation. Useful for debugging.
2184
- *
2185
- * @usageNotes
2186
- *
2187
- * The following component uses a JSON pipe to convert an object
2188
- * to JSON format, and displays the string in both formats for comparison.
2189
- *
2190
- * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
2191
- *
2192
- * @publicApi
2193
- */
2194
- declare class JsonPipe implements PipeTransform {
2195
- /**
2196
- * @param value A value of any type to convert into a JSON-format string.
2197
- */
2198
- transform(value: any): string;
2199
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonPipe, never>;
2200
- static ɵpipe: i0.ɵɵPipeDeclaration<JsonPipe, "json", true>;
2201
- }
2202
-
2203
- /**
2204
- * @ngModule CommonModule
2205
- * @description
2206
- *
2207
- * Creates a new `Array` or `String` containing a subset (slice) of the elements.
2208
- *
2209
- * @usageNotes
2210
- *
2211
- * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
2212
- * and `String.prototype.slice()`.
2213
- *
2214
- * When operating on an `Array`, the returned `Array` is always a copy even when all
2215
- * the elements are being returned.
2216
- *
2217
- * When operating on a blank value, the pipe returns the blank value.
2218
- *
2219
- * ### List Example
2220
- *
2221
- * This `ngFor` example:
2222
- *
2223
- * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
2224
- *
2225
- * produces the following:
2226
- *
2227
- * ```html
2228
- * <li>b</li>
2229
- * <li>c</li>
2230
- * ```
2231
- *
2232
- * ### String Examples
2233
- *
2234
- * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
2235
- *
2236
- * @publicApi
2237
- */
2238
- declare class SlicePipe implements PipeTransform {
2239
- /**
2240
- * @param value a list or a string to be sliced.
2241
- * @param start the starting index of the subset to return:
2242
- * - **a positive integer**: return the item at `start` index and all items after
2243
- * in the list or string expression.
2244
- * - **a negative integer**: return the item at `start` index from the end and all items after
2245
- * in the list or string expression.
2246
- * - **if positive and greater than the size of the expression**: return an empty list or
2247
- * string.
2248
- * - **if negative and greater than the size of the expression**: return entire list or string.
2249
- * @param end the ending index of the subset to return:
2250
- * - **omitted**: return all items until the end.
2251
- * - **if positive**: return all items before `end` index of the list or string.
2252
- * - **if negative**: return all items before `end` index from the end of the list or string.
2253
- */
2254
- transform<T>(value: ReadonlyArray<T>, start: number, end?: number): Array<T>;
2255
- transform(value: null | undefined, start: number, end?: number): null;
2256
- transform<T>(value: ReadonlyArray<T> | null | undefined, start: number, end?: number): Array<T> | null;
2257
- transform(value: string, start: number, end?: number): string;
2258
- transform(value: string | null | undefined, start: number, end?: number): string | null;
2259
- static ɵfac: i0.ɵɵFactoryDeclaration<SlicePipe, never>;
2260
- static ɵpipe: i0.ɵɵPipeDeclaration<SlicePipe, "slice", true>;
2261
- }
2262
-
2263
- /**
2264
- * @ngModule CommonModule
2265
- * @description
2266
- *
2267
- * Formats a value according to digit options and locale rules.
2268
- * Locale determines group sizing and separator,
2269
- * decimal point character, and other locale-specific configurations.
2270
- *
2271
- * @see {@link formatNumber}
2272
- *
2273
- * @usageNotes
2274
- *
2275
- * ### digitsInfo
2276
- *
2277
- * The value's decimal representation is specified by the `digitsInfo`
2278
- * parameter, written in the following format:<br>
2279
- *
2280
- * ```
2281
- * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
2282
- * ```
2283
- *
2284
- * - `minIntegerDigits`:
2285
- * The minimum number of integer digits before the decimal point.
2286
- * Default is 1.
2287
- *
2288
- * - `minFractionDigits`:
2289
- * The minimum number of digits after the decimal point.
2290
- * Default is 0.
2291
- *
2292
- * - `maxFractionDigits`:
2293
- * The maximum number of digits after the decimal point.
2294
- * Default is 3.
2295
- *
2296
- * If the formatted value is truncated it will be rounded using the "to-nearest" method:
2297
- *
2298
- * ```
2299
- * {{3.6 | number: '1.0-0'}}
2300
- * <!--will output '4'-->
2301
- *
2302
- * {{-3.6 | number:'1.0-0'}}
2303
- * <!--will output '-4'-->
2304
- * ```
2305
- *
2306
- * ### locale
2307
- *
2308
- * `locale` will format a value according to locale rules.
2309
- * Locale determines group sizing and separator,
2310
- * decimal point character, and other locale-specific configurations.
2311
- *
2312
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
2313
- *
2314
- * See [Setting your app locale](guide/i18n/locale-id).
2315
- *
2316
- * ### Example
2317
- *
2318
- * The following code shows how the pipe transforms values
2319
- * according to various format specifications,
2320
- * where the caller's default locale is `en-US`.
2321
- *
2322
- * {@example common/pipes/ts/number_pipe.ts region='NumberPipe'}
2323
- *
2324
- * @publicApi
2325
- */
2326
- declare class DecimalPipe implements PipeTransform {
2327
- private _locale;
2328
- constructor(_locale: string);
2329
- /**
2330
- * @param value The value to be formatted.
2331
- * @param digitsInfo Sets digit and decimal representation.
2332
- * [See more](#digitsinfo).
2333
- * @param locale Specifies what locale format rules to use.
2334
- * [See more](#locale).
2335
- */
2336
- transform(value: number | string, digitsInfo?: string, locale?: string): string | null;
2337
- transform(value: null | undefined, digitsInfo?: string, locale?: string): null;
2338
- transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null;
2339
- static ɵfac: i0.ɵɵFactoryDeclaration<DecimalPipe, never>;
2340
- static ɵpipe: i0.ɵɵPipeDeclaration<DecimalPipe, "number", true>;
2341
- }
2342
- /**
2343
- * @ngModule CommonModule
2344
- * @description
2345
- *
2346
- * Transforms a number to a percentage
2347
- * string, formatted according to locale rules that determine group sizing and
2348
- * separator, decimal-point character, and other locale-specific
2349
- * configurations.
2350
- *
2351
- * @see {@link formatPercent}
2352
- *
2353
- * @usageNotes
2354
- * The following code shows how the pipe transforms numbers
2355
- * into text strings, according to various format specifications,
2356
- * where the caller's default locale is `en-US`.
2357
- *
2358
- * {@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}
2359
- *
2360
- * @publicApi
2361
- */
2362
- declare class PercentPipe implements PipeTransform {
2363
- private _locale;
2364
- constructor(_locale: string);
2365
- transform(value: number | string, digitsInfo?: string, locale?: string): string | null;
2366
- transform(value: null | undefined, digitsInfo?: string, locale?: string): null;
2367
- transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null;
2368
- static ɵfac: i0.ɵɵFactoryDeclaration<PercentPipe, never>;
2369
- static ɵpipe: i0.ɵɵPipeDeclaration<PercentPipe, "percent", true>;
2370
- }
2371
- /**
2372
- * @ngModule CommonModule
2373
- * @description
2374
- *
2375
- * Transforms a number to a currency string, formatted according to locale rules
2376
- * that determine group sizing and separator, decimal-point character,
2377
- * and other locale-specific configurations.
2378
- *
2379
- *
2380
- * @see {@link getCurrencySymbol}
2381
- * @see {@link formatCurrency}
2382
- *
2383
- * @usageNotes
2384
- * The following code shows how the pipe transforms numbers
2385
- * into text strings, according to various format specifications,
2386
- * where the caller's default locale is `en-US`.
2387
- *
2388
- * {@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}
2389
- *
2390
- * @publicApi
2391
- */
2392
- declare class CurrencyPipe implements PipeTransform {
2393
- private _locale;
2394
- private _defaultCurrencyCode;
2395
- constructor(_locale: string, _defaultCurrencyCode?: string);
2396
- /**
2397
- *
2398
- * @param value The number to be formatted as currency.
2399
- * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code,
2400
- * such as `USD` for the US dollar and `EUR` for the euro. The default currency code can be
2401
- * configured using the `DEFAULT_CURRENCY_CODE` injection token.
2402
- * @param display The format for the currency indicator. One of the following:
2403
- * - `code`: Show the code (such as `USD`).
2404
- * - `symbol`(default): Show the symbol (such as `$`).
2405
- * - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their
2406
- * currency.
2407
- * For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the
2408
- * locale has no narrow symbol, uses the standard symbol for the locale.
2409
- * - String: Use the given string value instead of a code or a symbol.
2410
- * For example, an empty string will suppress the currency & symbol.
2411
- * - Boolean (marked deprecated in v5): `true` for symbol and false for `code`.
2412
- *
2413
- * @param digitsInfo Decimal representation options, specified by a string
2414
- * in the following format:<br>
2415
- * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
2416
- * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
2417
- * Default is `1`.
2418
- * - `minFractionDigits`: The minimum number of digits after the decimal point.
2419
- * Default is `2`.
2420
- * - `maxFractionDigits`: The maximum number of digits after the decimal point.
2421
- * Default is `2`.
2422
- * If not provided, the number will be formatted with the proper amount of digits,
2423
- * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies.
2424
- * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none.
2425
- * @param locale A locale code for the locale format rules to use.
2426
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
2427
- * See [Setting your app locale](guide/i18n/locale-id).
2428
- */
2429
- transform(value: number | string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
2430
- transform(value: null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): null;
2431
- transform(value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
2432
- static ɵfac: i0.ɵɵFactoryDeclaration<CurrencyPipe, never>;
2433
- static ɵpipe: i0.ɵɵPipeDeclaration<CurrencyPipe, "currency", true>;
2434
- }
2435
-
2436
- /**
2437
- * An interface that describes the date pipe configuration, which can be provided using the
2438
- * `DATE_PIPE_DEFAULT_OPTIONS` token.
2439
- *
2440
- * @see {@link DATE_PIPE_DEFAULT_OPTIONS}
2441
- *
2442
- * @publicApi
2443
- */
2444
- interface DatePipeConfig {
2445
- dateFormat?: string;
2446
- timezone?: string;
2447
- }
2448
-
2449
- /**
2450
- * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).
2451
- * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.
2452
- *
2453
- * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe
2454
- */
2455
- declare const DATE_PIPE_DEFAULT_TIMEZONE: InjectionToken<string>;
2456
- /**
2457
- * DI token that allows to provide default configuration for the `DatePipe` instances in an
2458
- * application. The value is an object which can include the following fields:
2459
- * - `dateFormat`: configures the default date format. If not provided, the `DatePipe`
2460
- * will use the 'mediumDate' as a value.
2461
- * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will
2462
- * use the end-user's local system timezone.
2463
- *
2464
- * @see {@link DatePipeConfig}
2465
- *
2466
- * @usageNotes
2467
- *
2468
- * Various date pipe default values can be overwritten by providing this token with
2469
- * the value that has this interface.
2470
- *
2471
- * For example:
2472
- *
2473
- * Override the default date format by providing a value using the token:
2474
- * ```ts
2475
- * providers: [
2476
- * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}
2477
- * ]
2478
- * ```
2479
- *
2480
- * Override the default timezone by providing a value using the token:
2481
- * ```ts
2482
- * providers: [
2483
- * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}
2484
- * ]
2485
- * ```
2486
- */
2487
- declare const DATE_PIPE_DEFAULT_OPTIONS: InjectionToken<DatePipeConfig>;
2488
- /**
2489
- * @ngModule CommonModule
2490
- * @description
2491
- *
2492
- * Formats a date value according to locale rules.
2493
- *
2494
- * `DatePipe` is executed only when it detects a pure change to the input value.
2495
- * A pure change is either a change to a primitive input value
2496
- * (such as `String`, `Number`, `Boolean`, or `Symbol`),
2497
- * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).
2498
- *
2499
- * Note that mutating a `Date` object does not cause the pipe to be rendered again.
2500
- * To ensure that the pipe is executed, you must create a new `Date` object.
2501
- *
2502
- * Only the `en-US` locale data comes with Angular. To localize dates
2503
- * in another language, you must import the corresponding locale data.
2504
- * See the [I18n guide](guide/i18n/format-data-locale) for more information.
2505
- *
2506
- * The time zone of the formatted value can be specified either by passing it in as the second
2507
- * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS`
2508
- * injection token. The value that is passed in as the second parameter takes precedence over
2509
- * the one defined using the injection token.
2510
- *
2511
- * @see {@link formatDate}
2512
- *
2513
- *
2514
- * @usageNotes
2515
- *
2516
- * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to
2517
- * reformat the date on every change-detection cycle, treat the date as an immutable object
2518
- * and change the reference when the pipe needs to run again.
2519
- *
2520
- * ### Pre-defined format options
2521
- *
2522
- * | Option | Equivalent to | Examples (given in `en-US` locale) |
2523
- * |---------------|-------------------------------------|-------------------------------------------------|
2524
- * | `'short'` | `'M/d/yy, h:mm a'` | `6/15/15, 9:03 AM` |
2525
- * | `'medium'` | `'MMM d, y, h:mm:ss a'` | `Jun 15, 2015, 9:03:01 AM` |
2526
- * | `'long'` | `'MMMM d, y, h:mm:ss a z'` | `June 15, 2015 at 9:03:01 AM GMT+1` |
2527
- * | `'full'` | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |
2528
- * | `'shortDate'` | `'M/d/yy'` | `6/15/15` |
2529
- * | `'mediumDate'`| `'MMM d, y'` | `Jun 15, 2015` |
2530
- * | `'longDate'` | `'MMMM d, y'` | `June 15, 2015` |
2531
- * | `'fullDate'` | `'EEEE, MMMM d, y'` | `Monday, June 15, 2015` |
2532
- * | `'shortTime'` | `'h:mm a'` | `9:03 AM` |
2533
- * | `'mediumTime'`| `'h:mm:ss a'` | `9:03:01 AM` |
2534
- * | `'longTime'` | `'h:mm:ss a z'` | `9:03:01 AM GMT+1` |
2535
- * | `'fullTime'` | `'h:mm:ss a zzzz'` | `9:03:01 AM GMT+01:00` |
2536
- *
2537
- * ### Custom format options
2538
- *
2539
- * You can construct a format string using symbols to specify the components
2540
- * of a date-time value, as described in the following table.
2541
- * Format details depend on the locale.
2542
- * Fields marked with (*) are only available in the extra data set for the given locale.
2543
- *
2544
- * | Field type | Format | Description | Example Value |
2545
- * |-------------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|
2546
- * | Era | G, GG & GGG | Abbreviated | AD |
2547
- * | | GGGG | Wide | Anno Domini |
2548
- * | | GGGGG | Narrow | A |
2549
- * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
2550
- * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
2551
- * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
2552
- * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
2553
- * | ISO Week-numbering year | Y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
2554
- * | | YY | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
2555
- * | | YYY | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
2556
- * | | YYYY | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
2557
- * | Month | M | Numeric: 1 digit | 9, 12 |
2558
- * | | MM | Numeric: 2 digits + zero padded | 09, 12 |
2559
- * | | MMM | Abbreviated | Sep |
2560
- * | | MMMM | Wide | September |
2561
- * | | MMMMM | Narrow | S |
2562
- * | Month standalone | L | Numeric: 1 digit | 9, 12 |
2563
- * | | LL | Numeric: 2 digits + zero padded | 09, 12 |
2564
- * | | LLL | Abbreviated | Sep |
2565
- * | | LLLL | Wide | September |
2566
- * | | LLLLL | Narrow | S |
2567
- * | ISO Week of year | w | Numeric: minimum digits | 1... 53 |
2568
- * | | ww | Numeric: 2 digits + zero padded | 01... 53 |
2569
- * | Week of month | W | Numeric: 1 digit | 1... 5 |
2570
- * | Day of month | d | Numeric: minimum digits | 1 |
2571
- * | | dd | Numeric: 2 digits + zero padded | 01 |
2572
- * | Week day | E, EE & EEE | Abbreviated | Tue |
2573
- * | | EEEE | Wide | Tuesday |
2574
- * | | EEEEE | Narrow | T |
2575
- * | | EEEEEE | Short | Tu |
2576
- * | Week day standalone | c, cc | Numeric: 1 digit | 2 |
2577
- * | | ccc | Abbreviated | Tue |
2578
- * | | cccc | Wide | Tuesday |
2579
- * | | ccccc | Narrow | T |
2580
- * | | cccccc | Short | Tu |
2581
- * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |
2582
- * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |
2583
- * | | aaaaa | Narrow | a/p |
2584
- * | Period* | B, BB & BBB | Abbreviated | mid. |
2585
- * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
2586
- * | | BBBBB | Narrow | md |
2587
- * | Period standalone* | b, bb & bbb | Abbreviated | mid. |
2588
- * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
2589
- * | | bbbbb | Narrow | md |
2590
- * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |
2591
- * | | hh | Numeric: 2 digits + zero padded | 01, 12 |
2592
- * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |
2593
- * | | HH | Numeric: 2 digits + zero padded | 00, 23 |
2594
- * | Minute | m | Numeric: minimum digits | 8, 59 |
2595
- * | | mm | Numeric: 2 digits + zero padded | 08, 59 |
2596
- * | Second | s | Numeric: minimum digits | 0... 59 |
2597
- * | | ss | Numeric: 2 digits + zero padded | 00... 59 |
2598
- * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |
2599
- * | | SS | Numeric: 2 digits + zero padded | 00... 99 |
2600
- * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |
2601
- * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |
2602
- * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |
2603
- * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |
2604
- * | | ZZZZ | Long localized GMT format | GMT-8:00 |
2605
- * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |
2606
- * | | O, OO & OOO | Short localized GMT format | GMT-8 |
2607
- * | | OOOO | Long localized GMT format | GMT-08:00 |
2608
- *
2609
- *
2610
- * ### Format examples
2611
- *
2612
- * These examples transform a date into various formats,
2613
- * assuming that `dateObj` is a JavaScript `Date` object for
2614
- * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,
2615
- * given in the local time for the `en-US` locale.
2616
- *
2617
- * ```
2618
- * {{ dateObj | date }} // output is 'Jun 15, 2015'
2619
- * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
2620
- * {{ dateObj | date:'shortTime' }} // output is '9:43 PM'
2621
- * {{ dateObj | date:'mm:ss' }} // output is '43:11'
2622
- * {{ dateObj | date:"MMM dd, yyyy 'at' hh:mm a" }} // output is 'Jun 15, 2015 at 09:43 PM'
2623
- * ```
2624
- *
2625
- * ### Usage example
2626
- *
2627
- * The following component uses a date pipe to display the current date in different formats.
2628
- *
2629
- * ```angular-ts
2630
- * @Component({
2631
- * selector: 'date-pipe',
2632
- * template: `<div>
2633
- * <p>Today is {{today | date}}</p>
2634
- * <p>Or if you prefer, {{today | date:'fullDate'}}</p>
2635
- * <p>The time is {{today | date:'h:mm a z'}}</p>
2636
- * </div>`
2637
- * })
2638
- * // Get the current date and time as a date-time value.
2639
- * export class DatePipeComponent {
2640
- * today: number = Date.now();
2641
- * }
2642
- * ```
2643
- *
2644
- * @publicApi
2645
- */
2646
- declare class DatePipe implements PipeTransform {
2647
- private locale;
2648
- private defaultTimezone?;
2649
- private defaultOptions?;
2650
- constructor(locale: string, defaultTimezone?: string | null | undefined, defaultOptions?: (DatePipeConfig | null) | undefined);
2651
- /**
2652
- * @param value The date expression: a `Date` object, a number
2653
- * (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).
2654
- * @param format The date/time components to include, using predefined options or a
2655
- * custom format string. When not provided, the `DatePipe` looks for the value using the
2656
- * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `dateFormat` property).
2657
- * If the token is not configured, the `mediumDate` is used as a value.
2658
- * @param timezone A timezone offset (such as `'+0430'`). When not provided, the `DatePipe`
2659
- * looks for the value using the `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads
2660
- * the `timezone` property). If the token is not configured, the end-user's local system
2661
- * timezone is used as a value.
2662
- * @param locale A locale code for the locale format rules to use.
2663
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
2664
- * See [Setting your app locale](guide/i18n/locale-id).
2665
- *
2666
- * @see {@link DATE_PIPE_DEFAULT_OPTIONS}
2667
- *
2668
- * @returns A date string in the desired format.
2669
- */
2670
- transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null;
2671
- transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
2672
- transform(value: Date | string | number | null | undefined, format?: string, timezone?: string, locale?: string): string | null;
2673
- static ɵfac: i0.ɵɵFactoryDeclaration<DatePipe, [null, { optional: true; }, { optional: true; }]>;
2674
- static ɵpipe: i0.ɵɵPipeDeclaration<DatePipe, "date", true>;
2675
- }
2676
-
2677
- /**
2678
- * @ngModule CommonModule
2679
- * @description
2680
- *
2681
- * Maps a value to a string that pluralizes the value according to locale rules.
2682
- *
2683
- * @usageNotes
2684
- *
2685
- * ### Example
2686
- *
2687
- * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
2688
- *
2689
- * @publicApi
2690
- */
2691
- declare class I18nPluralPipe implements PipeTransform {
2692
- private _localization;
2693
- constructor(_localization: NgLocalization);
2694
- /**
2695
- * @param value the number to be formatted
2696
- * @param pluralMap an object that mimics the ICU format, see
2697
- * https://unicode-org.github.io/icu/userguide/format_parse/messages/.
2698
- * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
2699
- * default).
2700
- */
2701
- transform(value: number | null | undefined, pluralMap: {
2702
- [count: string]: string;
2703
- }, locale?: string): string;
2704
- static ɵfac: i0.ɵɵFactoryDeclaration<I18nPluralPipe, never>;
2705
- static ɵpipe: i0.ɵɵPipeDeclaration<I18nPluralPipe, "i18nPlural", true>;
2706
- }
2707
-
2708
- /**
2709
- * @ngModule CommonModule
2710
- * @description
2711
- *
2712
- * Generic selector that displays the string that matches the current value.
2713
- *
2714
- * If none of the keys of the `mapping` match the `value`, then the content
2715
- * of the `other` key is returned when present, otherwise an empty string is returned.
2716
- *
2717
- * @usageNotes
2718
- *
2719
- * ### Example
2720
- *
2721
- * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
2722
- *
2723
- * @publicApi
2724
- */
2725
- declare class I18nSelectPipe implements PipeTransform {
2726
- /**
2727
- * @param value a string to be internationalized.
2728
- * @param mapping an object that indicates the text that should be displayed
2729
- * for different values of the provided `value`.
2730
- */
2731
- transform(value: string | null | undefined, mapping: {
2732
- [key: string]: string;
2733
- }): string;
2734
- static ɵfac: i0.ɵɵFactoryDeclaration<I18nSelectPipe, never>;
2735
- static ɵpipe: i0.ɵɵPipeDeclaration<I18nSelectPipe, "i18nSelect", true>;
2736
- }
2737
-
2738
- /**
2739
- * A key value pair.
2740
- * Usually used to represent the key value pairs from a Map or Object.
2741
- *
2742
- * @publicApi
2743
- */
2744
- interface KeyValue<K, V> {
2745
- key: K;
2746
- value: V;
2747
- }
2748
- /**
2749
- * @ngModule CommonModule
2750
- * @description
2751
- *
2752
- * Transforms Object or Map into an array of key value pairs.
2753
- *
2754
- * The output array will be ordered by keys.
2755
- * By default the comparator will be by Unicode point value.
2756
- * You can optionally pass a compareFn if your keys are complex types.
2757
- * Passing `null` as the compareFn will use natural ordering of the input.
2758
- *
2759
- * @usageNotes
2760
- * ### Examples
2761
- *
2762
- * This examples show how an Object or a Map can be iterated by ngFor with the use of this
2763
- * keyvalue pipe.
2764
- *
2765
- * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
2766
- *
2767
- * @publicApi
2768
- */
2769
- declare class KeyValuePipe implements PipeTransform {
2770
- private readonly differs;
2771
- constructor(differs: KeyValueDiffers);
2772
- private differ;
2773
- private keyValues;
2774
- private compareFn;
2775
- transform<K, V>(input: ReadonlyMap<K, V>, compareFn?: ((a: KeyValue<K, V>, b: KeyValue<K, V>) => number) | null): Array<KeyValue<K, V>>;
2776
- transform<K extends number, V>(input: Record<K, V>, compareFn?: ((a: KeyValue<string, V>, b: KeyValue<string, V>) => number) | null): Array<KeyValue<string, V>>;
2777
- 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>>;
2778
- transform(input: null | undefined, compareFn?: ((a: KeyValue<unknown, unknown>, b: KeyValue<unknown, unknown>) => number) | null): null;
2779
- 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;
2780
- 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;
2781
- 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;
2782
- static ɵfac: i0.ɵɵFactoryDeclaration<KeyValuePipe, never>;
2783
- static ɵpipe: i0.ɵɵPipeDeclaration<KeyValuePipe, "keyvalue", true>;
2784
- }
2785
-
2786
- /**
2787
- * Exports all the basic Angular directives and pipes,
2788
- * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.
2789
- * Re-exported by `BrowserModule`, which is included automatically in the root
2790
- * `AppModule` when you create a new app with the CLI `new` command.
2791
- *
2792
- * @publicApi
2793
- */
2794
- declare class CommonModule {
2795
- static ɵfac: i0.ɵɵFactoryDeclaration<CommonModule, never>;
2796
- static ɵmod: i0.ɵɵNgModuleDeclaration<CommonModule, never, [typeof NgClass, typeof NgComponentOutlet, typeof NgForOf, typeof NgIf, typeof NgTemplateOutlet, typeof NgStyle, typeof NgSwitch, typeof NgSwitchCase, typeof NgSwitchDefault, typeof NgPlural, typeof NgPluralCase, typeof AsyncPipe, typeof UpperCasePipe, typeof LowerCasePipe, typeof JsonPipe, typeof SlicePipe, typeof DecimalPipe, typeof PercentPipe, typeof TitleCasePipe, typeof CurrencyPipe, typeof DatePipe, typeof I18nPluralPipe, typeof I18nSelectPipe, typeof KeyValuePipe], [typeof NgClass, typeof NgComponentOutlet, typeof NgForOf, typeof NgIf, typeof NgTemplateOutlet, typeof NgStyle, typeof NgSwitch, typeof NgSwitchCase, typeof NgSwitchDefault, typeof NgPlural, typeof NgPluralCase, typeof AsyncPipe, typeof UpperCasePipe, typeof LowerCasePipe, typeof JsonPipe, typeof SlicePipe, typeof DecimalPipe, typeof PercentPipe, typeof TitleCasePipe, typeof CurrencyPipe, typeof DatePipe, typeof I18nPluralPipe, typeof I18nSelectPipe, typeof KeyValuePipe]>;
2797
- static ɵinj: i0.ɵɵInjectorDeclaration<CommonModule>;
2798
- }
2799
-
2800
- /**
2801
- * A DI Token representing the main rendering context.
2802
- * In a browser and SSR this is the DOM Document.
2803
- * When using SSR, that document is created by [Domino](https://github.com/angular/domino).
2804
- *
2805
- * @publicApi
2806
- */
2807
- declare const DOCUMENT: InjectionToken<Document>;
2808
-
2809
- declare const PLATFORM_BROWSER_ID = "browser";
2810
- declare const PLATFORM_SERVER_ID = "server";
2811
- /**
2812
- * Returns whether a platform id represents a browser platform.
2813
- * @publicApi
2814
- */
2815
- declare function isPlatformBrowser(platformId: Object): boolean;
2816
- /**
2817
- * Returns whether a platform id represents a server platform.
2818
- * @publicApi
2819
- */
2820
- declare function isPlatformServer(platformId: Object): boolean;
2821
-
2822
- /**
2823
- * @module
2824
- * @description
2825
- * Entry point for all public APIs of the common package.
2826
- */
2827
-
2828
- /**
2829
- * @publicApi
2830
- */
2831
- declare const VERSION: Version;
2832
-
2833
- /**
2834
- * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
2835
- *
2836
- * @publicApi
2837
- */
2838
- declare abstract class ViewportScroller {
2839
- /** @nocollapse */
2840
- static ɵprov: unknown;
2841
- /**
2842
- * Configures the top offset used when scrolling to an anchor.
2843
- * @param offset A position in screen coordinates (a tuple with x and y values)
2844
- * or a function that returns the top offset position.
2845
- *
2846
- */
2847
- abstract setOffset(offset: [number, number] | (() => [number, number])): void;
2848
- /**
2849
- * Retrieves the current scroll position.
2850
- * @returns A position in screen coordinates (a tuple with x and y values).
816
+ * Retrieves the current scroll position.
817
+ * @returns A position in screen coordinates (a tuple with x and y values).
2851
818
  */
2852
819
  abstract getScrollPosition(): [number, number];
2853
820
  /**
@@ -2893,15 +860,6 @@ declare class NullViewportScroller implements ViewportScroller {
2893
860
  setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
2894
861
  }
2895
862
 
2896
- /**
2897
- * A wrapper around the `XMLHttpRequest` constructor.
2898
- *
2899
- * @publicApi
2900
- */
2901
- declare abstract class XhrFactory {
2902
- abstract build(): XMLHttpRequest;
2903
- }
2904
-
2905
863
  /**
2906
864
  * Function that generates an ImageLoader for [Cloudflare Image
2907
865
  * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
@@ -3218,12 +1176,12 @@ declare class NgOptimizedImage implements OnInit, OnChanges {
3218
1176
  * * A base64 encoded image, which is wrapped and passed through.
3219
1177
  * * A boolean. If true, calls the image loader to generate a small placeholder url.
3220
1178
  */
3221
- private generatePlaceholder;
1179
+ protected generatePlaceholder(placeholderInput: string | boolean): string | boolean | null;
3222
1180
  /**
3223
1181
  * Determines if blur should be applied, based on an optional boolean
3224
1182
  * property `blur` within the optional configuration object `placeholderConfig`.
3225
1183
  */
3226
- private shouldBlurPlaceholder;
1184
+ protected shouldBlurPlaceholder(placeholderConfig?: ImagePlaceholderConfig): boolean;
3227
1185
  private removePlaceholderOnLoad;
3228
1186
  private setHostAttribute;
3229
1187
  static ɵfac: i0.ɵɵFactoryDeclaration<NgOptimizedImage, never>;
@@ -3266,4 +1224,5 @@ declare const PRECONNECT_CHECK_BLOCKLIST: InjectionToken<(string | string[])[]>;
3266
1224
  */
3267
1225
  declare function normalizeQueryParams(params: string): string;
3268
1226
 
3269
- export { APP_BASE_HREF, AsyncPipe, BrowserPlatformLocation, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DOCUMENT, DatePipe, type DatePipeConfig, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, IMAGE_LOADER, type ImageLoader, type ImageLoaderConfig, type ImagePlaceholderConfig, JsonPipe, type KeyValue, KeyValuePipe, LOCATION_INITIALIZED, Location, type LocationChangeEvent, type LocationChangeListener, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf as NgFor, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgOptimizedImage, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PRECONNECT_CHECK_BLOCKLIST, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, type PopStateEvent, SlicePipe, type Time, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, XhrFactory, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, provideNetlifyLoader, registerLocaleData, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PlatformNavigation as ɵPlatformNavigation, getDOM as ɵgetDOM, normalizeQueryParams as ɵnormalizeQueryParams, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
1227
+ export { FormStyle, FormatWidth, HashLocationStrategy, IMAGE_LOADER, LocationChangeListener, LocationStrategy, NgOptimizedImage, NumberFormatStyle, NumberSymbol, PRECONNECT_CHECK_BLOCKLIST, PlatformLocation, Plural, TranslationWidth, VERSION, ViewportScroller, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, provideNetlifyLoader, registerLocaleData, DomAdapter as ɵDomAdapter, NullViewportScroller as ɵNullViewportScroller, PLATFORM_BROWSER_ID as ɵPLATFORM_BROWSER_ID, PLATFORM_SERVER_ID as ɵPLATFORM_SERVER_ID, PlatformNavigation as ɵPlatformNavigation, getDOM as ɵgetDOM, normalizeQueryParams as ɵnormalizeQueryParams, parseCookieValue as ɵparseCookieValue, setRootDomAdapter as ɵsetRootDomAdapter };
1228
+ export type { ImageLoader, ImageLoaderConfig, ImagePlaceholderConfig, Time };