UNPKG

@particular.cloud/i18n-js

Version:

The i18n javascript and typescript sdk of particular.cloud

29 lines (28 loc) 1.4 kB
import { Key, Language, ProjectLanguage, LangCodeOrLocale, TextValue } from './types'; import Text, { TextQuery } from './types/Text'; /** * fetchTexts: fetch all texts (for one language or all languages) of your Particular.Cloud project */ export declare const fetchTexts: (language?: string | undefined) => Promise<Text[]>; /** * fetchText: fetch one text from your Particular.Cloud project */ export declare const fetchText: (key: Key, language: LangCodeOrLocale) => Promise<TextValue | undefined>; /** * queryTexts: fetch texts from your Particular.Cloud project based on a query */ export declare const queryTexts: (query: TextQuery[]) => Promise<Text[]>; /** * addTextKey: create a new key in your Particular.Cloud project. * Optional: initialize the key with a text value in one of the supported lanuages of your project */ export declare const addTextKey: (key: Key, locale?: string | undefined, value?: TextValue | undefined) => Promise<void>; export declare type ProjectLanguagesFilter = 'all' | 'active' | 'default'; /** * fetchLanguages: fetch languages of your Particular.Cloud project */ export declare const fetchProjectLanguages: (filter?: ProjectLanguagesFilter) => Promise<ProjectLanguage[]>; /** * fetchAllLanguages: fetch all languages supported by Particular.Cloud */ export declare const fetchAllLanguages: () => Promise<Language[]>;