@angular/common
Version:
Angular - commonly needed directives and services
36 lines (35 loc) • 1.14 kB
TypeScript
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { PipeTransform } from '@angular/core';
import { NgLocalization } from '../i18n/localization';
/**
* @ngModule CommonModule
* @whatItDoes Maps a value to a string that pluralizes the value according to locale rules.
* @howToUse `expression | i18nPlural:mapping[:locale]`
* @description
*
* Where:
* - `expression` is a number.
* - `mapping` is an object that mimics the ICU format, see
* http://userguide.icu-project.org/formatparse/messages
* - `locale` is a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
* default)
*
* ## Example
*
* {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
*
* @experimental
*/
export declare class I18nPluralPipe implements PipeTransform {
private _localization;
constructor(_localization: NgLocalization);
transform(value: number, pluralMap: {
[count: string]: string;
}, locale?: string): string;
}