angular-l10n
Version:
An Angular library to translate messages, dates and numbers
111 lines (110 loc) • 2.63 kB
TypeScript
export declare type Type<T> = new (...args: any[]) => T;
export interface DateTimeOptions {
weekday?: string;
era?: string;
year?: string;
month?: string;
day?: string;
hour?: string;
minute?: string;
second?: string;
timeZoneName?: string;
hour12?: boolean;
}
export interface DigitsOptions {
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
maximumSignificantDigits?: number;
useGrouping?: boolean;
}
export interface RelativeTimeOptions {
numeric?: string;
style?: string;
}
export declare type Unit = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
export interface Locale {
/**
* ISO 639 two-letter or three-letter code.
*/
languageCode: string;
/**
* ISO 3166 two-letter, uppercase code.
*/
countryCode?: string;
/**
* ISO 15924 four-letter script code.
*/
scriptCode?: string;
}
export interface DefaultLocale extends Locale {
numberingSystem?: string;
calendar?: string;
}
export interface Language {
/**
* ISO 639 two-letter or three-letter code.
*/
code: string;
/**
* 'ltr' or 'rtl'.
*/
dir: string;
}
export interface Decimal {
minusSign: string;
decimalSeparator: string;
thousandSeparator: string;
}
export interface Schema extends DefaultLocale {
currency?: string;
timezone?: string;
text?: string;
}
export interface Log {
name: string;
message: string;
}
export declare enum StorageStrategy {
Session = 0,
Local = 1,
Cookie = 2,
Disabled = 3
}
export declare enum ProviderType {
Fallback = 0,
Static = 1,
WebAPI = 2
}
export declare enum ISOCode {
Language = "languageCode",
Country = "countryCode",
Script = "scriptCode"
}
export declare enum ExtraCode {
NumberingSystem = "numberingSystem",
Calendar = "calendar",
Currency = "currency",
Timezone = "timezone"
}
export declare enum LogLevel {
Error = "error",
Warn = "warn",
Info = "info",
Log = "log",
Off = "off"
}
export declare enum NumberFormatStyle {
Decimal = 0,
Percent = 1,
Currency = 2
}
export declare const NUMBER_FORMAT_REGEXP: RegExp;
export declare const ISO8601_DATE_REGEX: RegExp;
export declare const FORMAT_ALIASES: {
[format: string]: DateTimeOptions;
};
export declare const LOG_MESSAGES: {
[message: string]: string;
};