@particular.cloud/i18n-js
Version:
The i18n javascript and typescript sdk of particular.cloud
18 lines (17 loc) • 738 B
TypeScript
import { RetrieveValue, Text, Key, LangCodeOrLocale, TextValue } from './types';
interface CacheItem {
value: TextValue;
expiresAt: Date | undefined;
}
declare const cache: {
records: Record<string, Record<string, CacheItem>>;
put(key: Key, language: LangCodeOrLocale, value: TextValue): void;
/**
* Note: Use function retrieveForLangCodeOrLocale to retrieve a value from cache for a langCodeOrLocale
* @return {TextValue | undefined, boolean} value undefined means not found, empty string means found (string value)
*/
retrieve(key: Key, language: LangCodeOrLocale): RetrieveValue;
keys(): [LangCodeOrLocale, Key][];
storeAll(texts: Text[]): void;
};
export default cache;