export { awaitedConfig, getConfigSource, isLocalConfigFound } from './config.mjs'; export { createCacheId } from './create-cache-id.mjs'; export { clearCache } from './data/clear-cache.mjs'; export { getCache } from './data/get-cache.mjs'; export { interpolateTemplate } from './interpolate-template.mjs'; export { stripComments } from './strip-comments.mjs'; export { GringowConfig } from './constants/default-config.mjs'; import 'zod'; import './schemas/config.shcema.mjs'; /** * Checks if a cache item exists for the given ID * * @param cacheId - The cache ID to check * @returns Promise that resolves to the cached item if found, or undefined otherwise * * @example * const item = await checkCache("gid_123abc") * if (item) { * console.log("Found in cache:", item.translation) * } */ declare function checkCache(cacheId: string): Promise; /** * Deletes a cache item. * * @param cacheId - The cache ID. * @returns The cache ID. */ declare function deleteCacheItem(cacheId: string): Promise; /** * Gets the existing cache or creates a new empty one if it doesn't exist * * @returns Promise that resolves to the cache object * @throws {GringowError} If there is an error reading/writing the cache file * * @example * const cache = await getOrCreateCache() * // Returns existing cache or creates new empty cache: {} */ declare function getOrCreateCache(): Promise; /** * Writes the cache to disk. * * @param cacheId - The cache ID. * @param cached - The cached item. * @returns The cached item. */ declare function writeCacheToDisk(cacheId: string, cached: GringowCacheItem): Promise; type GringowTranslation = { [key: string]: string; }; type GringowCacheItem = { original: string; translation: GringowTranslation; append?: string; prepend?: string; rebuild?: boolean; }; type GringowCache = { [key: string]: GringowCacheItem; }; type GringowResponse = { cacheId: string; translation: GringowCacheItem; }; type GringowError = Error & { code?: string; cause?: Error; }; declare function rebuild(cacheId: string): Promise; /** * Gringow is a function that translates a string or a template string into a * translated string. * * @param text - The string or template string to translate. * @param values - The values to interpolate into the string. * @returns The translated string. */ declare function Gringow(text: string, ...values: Array): Promise; export { type GringowCache, type GringowCacheItem, type GringowError, type GringowResponse, type GringowTranslation, checkCache, Gringow as default, deleteCacheItem, getOrCreateCache, rebuild, writeCacheToDisk };