@vue-js-cron/core
Version:
A renderless Vue.js cron editor.
31 lines • 1.52 kB
TypeScript
import type { FieldPattern, TextPosition } from '../types';
import type { Localization } from './types';
declare class L10nEngine {
dict: Localization;
constructor(dict: Localization);
/**
* Gets a localization template by traversing the dictionary using provided keys.
* @param keys - Array of keys to traverse through the localization dictionary
* @returns The found template string or empty string if not found
*/
getTemplate(...keys: string[]): any;
/**
* Renders a localization template with the provided parameters using Mustache.
* @param periodId - The period identifier (e.g. 'year', 'month')
* @param fieldId - The field identifier (e.g. 'hour', 'minute')
* @param fieldPattern - The pattern type of the field
* @param position - The text position
* @param params - Parameters to be interpolated into the template
* @returns The rendered localization string
*/
render(periodId: string, fieldId: string, fieldPattern: FieldPattern, position: TextPosition, params: any): string;
}
/**
* Creates a localization engine for the specified locale.
* @param localeCode - Locale code (e.g. 'en', 'en-GB', 'de-DE')
* @param mixin - Optional dictionary to override default locale strings
* @returns A new L10nEngine instance for the specified locale with English as fallback
*/
declare function createL10n(localeCode: string, mixin?: Localization): L10nEngine;
export { createL10n, L10nEngine };
//# sourceMappingURL=index.d.ts.map