@stacksjs/stx
Version:
A Bun plugin that allows for using Laravel Blade-like syntax.
22 lines (21 loc) • 1.36 kB
TypeScript
import type { I18nConfig, StxOptions } from './types';
export declare const defaultI18nConfig: I18nConfig;
declare const translationsCache: Record<string, Record<string, any>>;
export declare function loadTranslation(locale: string, options: StxOptions): Promise<Record<string, any>>;
declare function parseYaml(content: string): Promise<Record<string, any>>;
declare function getFileExtension(format: string): string;
export declare function getTranslation(key: string,
translations: Record<string, any>,
fallbackToKey: boolean = true,
params: Record<string, any> = {},): string;
export declare function processTranslateDirective(template: string, context: Record<string, any>, filePath: string, options: StxOptions): Promise<string>;
declare const i18nConfig: {};
declare const translations: unknown;
declare const approaches: Array<(() => unknown) | (() => unknown) | (() => unknown)>;
declare const translation: unknown;
declare const matches: Array<((...args: any[]) => unknown)>;
declare const approaches: Array<(() => unknown) | (() => unknown) | (() => unknown)>;
declare function replaceAsync(str: string, regex: RegExp, asyncFn: (
match, ...groups?: any[]
)): Promise<string>;
export declare function createTranslateFilter(translations: Record<string, any>, fallbackToKey?: boolean): (value: string, params?: Record<string, any>) => string;