UNPKG

dbl-utils

Version:

Utilities for dbl, adba and others projects

112 lines (111 loc) 4.42 kB
export declare function trackingTexts(setTracking?: boolean): void; export declare function getTexts(): string[]; /** * Adds a dictionary to the configuration object. * @param {Object} dictionary - The dictionary to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addDictionary: (dictionary: object) => boolean; /** * Adds date formats to the configuration object. * @param {Object} formats - The date formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatDate: (formats: object) => boolean; /** * Adds time formats to the configuration object. * @param {Object} formats - The time formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatTime: (formats: object) => boolean; /** * Adds date-time formats to the configuration object. * @param {Object} formats - The date-time formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatDateTime: (formats: object) => boolean; /** * Adds number formats to the configuration object. * @param {Object} formats - The number formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatNumber: (formats: object) => boolean; /** * Adds compact number formats to the configuration object. * @param {Object} formats - The compact number formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatNumberCompact: (formats: object) => boolean; /** * Adds currency formats to the configuration object. * @param {Object} formats - The currency formats to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addFormatCurrency: (formats: object) => boolean; /** * Adds tasks to be executed on language change. * @param {Object} tasks - The tasks to add. * @returns {boolean} True if added correctly, false otherwise. */ export declare const addTasks: (tasks: Record<string, (lang: string) => void>) => boolean; /** * Removes a specific task. * @param {string} key - The key of the task to remove. * @returns {boolean} True if removed, false otherwise. */ export declare const removeTask: (key: string) => boolean; /** * Sets the current language. * @param {string} newLang - The new language to set. * @returns {boolean} True if set correctly, false otherwise. */ export declare const setLang: (newLang: string) => boolean; /** * Gets the current language. * @returns {string} The current language. */ export declare const getLang: () => string; /** * Function to translate texts. * @param {string} text - The text to translate. * @param {string} [context] - The context of the text. * @returns {string} The translated text. */ declare const t: (text: string, context?: string) => string; /** * Formats a date according to the current language and context. * @param {string} [context] - The context of the date. * @returns {string} The formatted date. */ export declare const formatDate: (context?: string) => string; /** * Formats a time according to the current language and context. * @param {string} [context] - The context of the time. * @returns {string} The formatted time. */ export declare const formatTime: (context?: string) => string; /** * Formats a date-time according to the current language and context. * @param {string} [context] - The context of the date-time. * @returns {string} The formatted date-time. */ export declare const formatDateTime: (context?: string) => string; /** * Formats a number according to the current language and context. * @param {string} [context] - The context of the number. * @returns {string} The formatted number. */ export declare const formatNumber: (context?: string) => string; /** * Formats a compact number according to the current language and context. * @param {string} [context] - The context of the compact number. * @returns {string} The formatted compact number. */ export declare const formatNumberCompact: (context?: string) => string; /** * Formats a currency according to the current language and context. * @param {string} [context] - The context of the currency. * @returns {string} The formatted currency. */ export declare const formatCurrency: (context?: string) => string; export default t;