@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.42 kB
TypeScript
import { InjectionToken, PipeTransform } from '@angular/core';
import * as i0 from "@angular/core";
/** A preconfigured option preset for the IntlSortPipe. */
export interface IntlSortOptions extends Intl.CollatorOptions {
}
/** Global options and presets for the IntlSortPipe. */
export interface IntlSortGlobalOptions {
presets?: {
[key: string]: IntlSortOptions;
};
defaultPreset?: string;
}
/** Options for a transform call of the IntlSortPipe. */
export interface IntlSortLocalOptions extends IntlSortOptions {
preset?: string;
}
export declare const INTL_SORT_OPTIONS: InjectionToken<IntlSortGlobalOptions>;
export declare const INTL_SORT_PRESET_LOWER_FIRST: IntlSortOptions;
export declare const INTL_SORT_PRESET_UPPER_FIRST: IntlSortOptions;
/**
* A pipe that sorts an array of strings using the Intl.Collator API.
*/
export declare class IntlSortPipe implements PipeTransform {
private readonly locale;
private readonly options;
private static readonly DEFAULT_OPTIONS;
constructor(locale: string, options: IntlSortGlobalOptions | null);
transform(value: string[] | null, options?: string | IntlSortLocalOptions, ...locales: string[]): string[] | null;
private getLocales;
private getOptions;
static ɵfac: i0.ɵɵFactoryDeclaration<IntlSortPipe, [null, { optional: true; }]>;
static ɵpipe: i0.ɵɵPipeDeclaration<IntlSortPipe, "IntlSort", true>;
}