UNPKG

react-intlayer

Version:

Easily internationalize i18n your React applications with type-safe multilingual content management.

1 lines 1.06 kB
{"version":3,"file":"getIntlayer.cjs","names":["intlayerNodePlugins","reactNodePlugins","markdownPlugin"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore, type Plugins } from '@intlayer/core';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types';\nimport {\n type DeepTransformContent,\n intlayerNodePlugins,\n markdownPlugin,\n reactNodePlugins,\n} from './plugins';\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n): DeepTransformContent<DictionaryRegistryContent<T>, L> => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n reactNodePlugins,\n markdownPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n return getIntlayerCore(key, locale, plugins) as any;\n};\n"],"mappings":";;;;;AAcA,MAAa,eAIX,KACA,QACA,sBAC0D;AAQ1D,wCAAuB,KAAK,QAPD;EACzBA;EACAC;EACAC;EACA,GAAI,qBAAqB,EAAE;EAC5B,CAE2C"}