UNPKG

intlayer

Version:

Manage internationalization i18n in a simple way, through TypeScript, declaration file, declare your multilingual content every where in your code.

65 lines 4.67 kB
import { CustomIntlayerConfig, IntlayerConfig } from "@intlayer/types/config"; import { ContentNode, Dictionary as Dictionary$1 } from "@intlayer/types/dictionary"; import { DeclaredLocales, LocalesValues, RequiredLocales, SchemaKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation"; import { ALL_LOCALES, Locale } from "@intlayer/types/allLocales"; import * as Locales from "@intlayer/types/locales"; import { editor } from "@intlayer/config/built"; import { file } from "@intlayer/core/file"; import { Intl, compact, currency, date, number, percentage, relativeTime, units } from "@intlayer/core/formatters"; import { getDictionary, getEnumeration, getEnumeration as getEnumerationContent, getIntlayer, getNesting, getTranslation, getTranslation as getTranslationContent } from "@intlayer/core/interpreter"; import { GenerateSitemapOptions, SitemapUrlEntry, comparePaths, generateSitemap, generateSitemapUrl, getBrowserLocale, getCanonicalPath, getHTMLTextDir, getLocale, getLocaleFromPath, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMultilingualUrls, getPathWithoutLocale, getPrefix, getRewriteRules, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, normalizePath, validatePrefix } from "@intlayer/core/localization"; import { getMarkdownMetadata } from "@intlayer/core/markdown"; import { cond, enu, gender, html, insert, md, nest, plural, select, t } from "@intlayer/core/transpiler"; import { LocaleStorageClient, LocaleStorageServer, getCookie, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer } from "@intlayer/core/utils"; //#region src/index.d.ts /** * The dictionary type used to define the structure of a dictionary. * It is used to provide type safety and autocompletion when defining a dictionary. * * @example * ```ts * import { Dictionary } from 'intlayer'; * * const dictionary: Dictionary = { ... }; * ``` */ type Dictionary<T = undefined, SchemaKey extends SchemaKeys | undefined = undefined> = Dictionary$1<T, SchemaKey, true>; /** * The content of a dictionary. * * @deprecated Use `Dictionary<T>` instead. */ type DeclarationContent<T = undefined, SchemaKey extends SchemaKeys | undefined = undefined> = Dictionary<T, SchemaKey>; /** * The locales defined in the configuration. */ declare const locales: any; /** * The required locales defined in the configuration. */ declare const requiredLocales: any; /** * The default locale defined in the configuration. */ declare const defaultLocale: any; /** * @deprecated Use `defaultLocale`, `locales`, `requiredLocales` or `editor` instead. * * Configuration of Intlayer. * */ declare const configuration: Pick<IntlayerConfig, 'editor' | 'internationalization' | 'log' | 'routing'>; /** * Returns the configuration of Intlayer. */ declare const getConfiguration: () => Pick<IntlayerConfig, "editor" | "internationalization" | "log" | "routing">; interface __DictionaryRegistry {} interface __DeclaredLocalesRegistry {} interface __RequiredLocalesRegistry {} interface __SchemaRegistry {} interface __StrictModeRegistry {} interface __EditorRegistry {} interface __RoutingRegistry {} //#endregion export { ALL_LOCALES, type ContentNode, type DeclarationContent, type DeclaredLocales, type Dictionary, type GenerateSitemapOptions, Intl, type CustomIntlayerConfig as IntlayerConfig, type Locale, LocaleStorageClient, LocaleStorageServer, Locales, type LocalesValues, type RequiredLocales, type SitemapUrlEntry, type StrictModeLocaleMap, __DeclaredLocalesRegistry, __DictionaryRegistry, __EditorRegistry, __RequiredLocalesRegistry, __RoutingRegistry, __SchemaRegistry, __StrictModeRegistry, compact, comparePaths, cond, configuration, currency, date, defaultLocale, editor, enu, file, gender, generateSitemap, generateSitemapUrl, getBrowserLocale, getCanonicalPath, getConfiguration, getCookie, getDictionary, getEnumeration, getEnumerationContent, getHTMLTextDir, getIntlayer, getLocale, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMultilingualUrls, getNesting, getPathWithoutLocale, getPrefix, getRewriteRules, getTranslation, getTranslationContent, html, insert, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, locales, md, nest, normalizePath, number, percentage, plural, relativeTime, requiredLocales, select, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, t, units, validatePrefix }; //# sourceMappingURL=index.d.ts.map