@haiilo/ngx-intl
Version:
Standalone Angular pipes using the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting.
34 lines (33 loc) • 1.45 kB
TypeScript
import { InjectionToken, PipeTransform } from '@angular/core';
import * as i0 from "@angular/core";
/** A preconfigured option preset for the IntlPluralPipe. */
export interface IntlPluralOptions extends Intl.PluralRulesOptions {
}
/** Global options and presets for the IntlPluralPipe. */
export interface IntlPluralGlobalOptions {
presets?: {
[key: string]: IntlPluralOptions;
};
defaultPreset?: string;
}
/** Options for a transform call of the IntlPluralPipe. */
export interface IntlPluralLocalOptions extends IntlPluralOptions {
preset?: string;
}
export declare const INTL_PLURAL_OPTIONS: InjectionToken<IntlPluralGlobalOptions>;
export declare const INTL_PLURAL_PRESET_CARDINAL: IntlPluralOptions;
export declare const INTL_PLURAL_PRESET_ORDINAL: IntlPluralOptions;
/**
* A pipe that pluralizes a string using the Intl.PluralRules API.
*/
export declare class IntlPluralPipe implements PipeTransform {
private readonly locale;
private readonly options;
private static readonly DEFAULT_OPTIONS;
constructor(locale: string, options: IntlPluralGlobalOptions | null);
transform(value: number | null, options?: string | IntlPluralLocalOptions, ...locales: string[]): string | null;
private getLocales;
private getOptions;
static ɵfac: i0.ɵɵFactoryDeclaration<IntlPluralPipe, [null, { optional: true; }]>;
static ɵpipe: i0.ɵɵPipeDeclaration<IntlPluralPipe, "IntlPlural", true>;
}