@syncfusion/ej2-base
Version:
A common package of Essential JS 2 base libraries, methods and class definitions
275 lines (274 loc) • 8.47 kB
TypeScript
import { NumberFormatOptions, DateFormatOptions } from '../internationalization';
import { FormatParts, CommonOptions } from './number-formatter';
/**
* Specifies default currency code to be considered
*
* @private
*/
export declare let defaultCurrencyCode: string;
export declare function setDefaultCurrencyCode(value: string): void;
export declare function setNumberFormat(value: typeof import('./number-formatter').NumberFormat): void;
export declare function setDateFormat(value: typeof import('./date-formatter').DateFormat): void;
export declare const blazorCultureFormats: Object;
/**
* Date base common constants and function for date parser and formatter.
*/
export declare namespace IntlBase {
const negativeDataRegex: RegExp;
const customRegex: RegExp;
const latnParseRegex: RegExp;
const defaultCurrency: string;
const dateConverterMapper: RegExp;
const islamicRegex: RegExp;
interface NumericSkeleton {
type?: string;
isAccount?: boolean;
fractionDigits?: number;
}
interface GenericFormatOptions {
nData?: NegativeData;
pData?: NegativeData;
zeroData?: NegativeData;
}
interface GroupSize {
primary?: number;
secondary?: number;
}
interface NegativeData extends FormatParts {
nlead?: string;
nend?: string;
groupPattern?: string;
minimumFraction?: number;
maximumFraction?: number;
}
const formatRegex: RegExp;
const currencyFormatRegex: RegExp;
const curWithoutNumberRegex: RegExp;
const dateParseRegex: RegExp;
const basicPatterns: string[];
interface Dependables {
parserObject?: Object;
dateObject?: Object;
numericObject?: Object;
}
interface TimeZoneOptions {
hourFormat?: string;
gmtFormat?: string;
gmtZeroFormat?: string;
}
const defaultObject: Object;
const blazorDefaultObject: Object;
const monthIndex: Object;
/**
*
*/
const month: string;
const days: string;
/**
* Default numerber Object
*/
const patternMatcher: {
[key: string]: Object;
};
/**
* Returns the resultant pattern based on the skeleton, dateObject and the type provided
*
* @private
* @param {string} skeleton ?
* @param {Object} dateObject ?
* @param {string} type ?
* @param {boolean} isIslamic ?
* @param {string} blazorCulture ?
* @returns {string} ?
*/
function getResultantPattern(skeleton: string, dateObject: Object, type: string, isIslamic?: boolean, blazorCulture?: string): string;
interface DateObject {
year?: number;
month?: number;
date?: number;
}
/**
* Returns the dependable object for provided cldr data and culture
*
* @private
* @param {Object} cldr ?
* @param {string} culture ?
* @param {string} mode ?
* @param {boolean} isNumber ?
* @returns {any} ?
*/
function getDependables(cldr: Object, culture: string, mode: string, isNumber?: boolean): Dependables;
/**
* Returns the symbol pattern for provided parameters
*
* @private
* @param {string} type ?
* @param {string} numSystem ?
* @param {Object} obj ?
* @param {boolean} isAccount ?
* @returns {string} ?
*/
function getSymbolPattern(type: string, numSystem: string, obj: Object, isAccount: boolean): string;
/**
*
* @param {string} format ?
* @returns {string} ?
*/
function ConvertDateToWeekFormat(format: string): string;
/**
*
* @param {DateFormatOptions} formatOptions ?
* @param {string} culture ?
* @returns {DateFormatOptions} ?
*/
function compareBlazorDateFormats(formatOptions: DateFormatOptions, culture?: string): DateFormatOptions;
/**
* Returns proper numeric skeleton
*
* @private
* @param {string} skeleton ?
* @returns {any} ?
*/
function getProperNumericSkeleton(skeleton: string): NumericSkeleton;
/**
* Returns format data for number formatting like minimum fraction, maximum fraction, etc..,
*
* @private
* @param {string} pattern ?
* @param {boolean} needFraction ?
* @param {string} cSymbol ?
* @param {boolean} fractionOnly ?
* @returns {any} ?
*/
function getFormatData(pattern: string, needFraction: boolean, cSymbol: string, fractionOnly?: boolean): NegativeData;
/**
* Changes currency symbol
*
* @private
* @param {string} val ?
* @param {string} sym ?
* @returns {string} ?
*/
function changeCurrencySymbol(val: string, sym: string): string;
/**
* Returns currency symbol based on currency code ?
*
* @private
* @param {Object} numericObject ?
* @param {string} currencyCode ?
* @param {string} altSymbol ?
* @param {string} ignoreCurrency ?
* @returns {string} ?
*/
function getCurrencySymbol(numericObject: Object, currencyCode: string, altSymbol?: string, ignoreCurrency?: boolean): string;
/**
* Returns formatting options for custom number format
*
* @private
* @param {string} format ?
* @param {CommonOptions} dOptions ?
* @param {any} obj ?
* @returns {any} ?
*/
function customFormat(format: string, dOptions: CommonOptions, obj: Dependables): GenericFormatOptions;
/**
* Returns custom formatting options
*
* @private
* @param {string} format ?
* @param {CommonOptions} dOptions ?
* @param {Object} numObject ?
* @returns {any} ?
*/
function customNumberFormat(format: string, dOptions?: CommonOptions, numObject?: Object): NegativeData;
/**
* Returns formatting options for currency or percent type
*
* @private
* @param {string[]} parts ?
* @param {string} actual ?
* @param {string} symbol ?
* @returns {any} ?
*/
function isCurrencyPercent(parts: string[], actual: string, symbol: string): NegativeData;
/**
* Returns culture based date separator
*
* @private
* @param {Object} dateObj ?
* @returns {string} ?
*/
function getDateSeparator(dateObj: Object): string;
/**
* Returns Native Date Time pattern
*
* @private
* @param {string} culture ?
* @param {DateFormatOptions} options ?
* @param {Object} cldr ?
* @param {boolean} isExcelFormat ?
* @returns {string} ?
*/
function getActualDateTimeFormat(culture: string, options: DateFormatOptions, cldr?: Object, isExcelFormat?: boolean): string;
/**
*
* @param {string} actual ?
* @param {any} option ?
* @returns {any} ?
*/
function processSymbol(actual: string, option: any): any;
/**
* Returns Native Number pattern
*
* @private
* @param {string} culture ?
* @param {NumberFormatOptions} options ?
* @param {Object} cldr ?
* @param {boolean} isExcel ?
* @returns {string} ?
*/
function getActualNumberFormat(culture: string, options: NumberFormatOptions, cldr?: Object, isExcel?: boolean): string;
/**
*
* @param {string} pattern ?
* @param {number} minDigits ?
* @param {number} maxDigits ?
* @returns {string} ?
*/
function fractionDigitsPattern(pattern: string, minDigits: number, maxDigits?: number): string;
/**
*
* @param {string} pattern ?
* @param {number} digits ?
* @returns {string} ?
*/
function minimumIntegerPattern(pattern: string, digits: number): string;
/**
*
* @param {string} pattern ?
* @returns {string} ?
*/
function groupingPattern(pattern: string): string;
/**
*
* @param {string} culture ?
* @param {Object} cldr ?
* @returns {number} ?
*/
function getWeekData(culture: string, cldr?: Object): number;
/**
* @private
* @param {any} pData ?
* @param {string} aCurrency ?
* @param {string} rCurrency ?
* @returns {void} ?
*/
function replaceBlazorCurrency(pData: NegativeData[], aCurrency: string, rCurrency: string): void;
/**
* @private
* @param {Date} date ?
* @param {number} firstDayOfWeek ?
* @returns {number} ?
*/
function getWeekOfYear(date: Date, firstDayOfWeek: number): number;
}