UNPKG

intlayer

Version:

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

1 lines 3.09 kB
{"version":3,"file":"index.cjs","names":["Locales","configuration"],"sources":["../../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noEmptyInterface: Intlayer module augmentation registries */\nimport {\n type Dictionary as DictionaryCore,\n type CustomIntlayerConfig as IntlayerConfig,\n Locales,\n} from '@intlayer/types';\n\ntype Dictionary<T = undefined> = DictionaryCore<T, true>;\n/**\n * @deprecated Use `Dictionary<T>` instead.\n */\ntype DeclarationContent<T = undefined> = Dictionary<T>;\n\n/**\n * @deprecated\n *\n * Use Locales.All_LOCALES instead\n */\nconst localeList = Locales.ALL_LOCALES;\n\nexport {\n type ContentNode,\n type Locale,\n Locales,\n type LocalesValues,\n type StrictModeLocaleMap,\n} from '@intlayer/types';\nexport type { DeclarationContent, Dictionary, IntlayerConfig, localeList };\n\n/**\n * Rexport using named import because πof Tsup bug in CJS\n */\nimport configuration from '@intlayer/config/built';\n\n/**\n * @deprecated Use `import { configuration } from 'intlayer'` instead.\n */\nconst getConfiguration = () => configuration;\n\nconst locales = configuration.internationalization.locales;\nconst requiredLocales = configuration.internationalization.requiredLocales;\nconst defaultLocale = configuration.internationalization.defaultLocale;\n\n// Reexport here for CJS compatibility\n// Fix ReferenceError: Cannot access 'xxx' before initialization\nexport {\n configuration,\n getConfiguration,\n locales,\n requiredLocales,\n defaultLocale,\n};\n\nexport {\n compact,\n cond,\n currency,\n date,\n enu,\n gender,\n getBrowserLocale,\n getCookie,\n getDictionary,\n getEnumeration,\n /**\n * @deprecated Use `getEnumeration` instead.\n */\n getEnumeration as getEnumerationContent,\n getHTMLTextDir,\n getIntlayer,\n getLocale,\n getLocaleFromPath,\n getLocaleFromStorage,\n getLocaleLang,\n getLocaleName,\n getLocalizedUrl,\n getMarkdownMetadata,\n getMultilingualUrls,\n getNesting,\n getPathWithoutLocale,\n getPrefix,\n getTranslation,\n /**\n * @deprecated Use `getTranslation` instead.\n */\n getTranslation as getTranslationContent,\n Intl,\n insert,\n localeDetector,\n localeFlatMap,\n localeMap,\n localeRecord,\n localeResolver,\n md,\n nest,\n number,\n percentage,\n relativeTime,\n setLocaleInStorage,\n t,\n units,\n validatePrefix,\n} from '@intlayer/core';\nexport { file } from '@intlayer/core/file'; // Include specific export for browser because of node js function that can't be used in browser\n\n// --- Registries to be augmented by the generator ---\nexport interface __DictionaryRegistry {} // id -> interfaceof ictionary\nexport interface __DeclaredLocalesRegistry {} // 'fr': 1, 'en': 1, ...\nexport interface __RequiredLocalesRegistry {} // 'en': 1, ...\nexport interface __StrictModeRegistry {} // one of: { strict: true } | { inclusive: true } | { loose: true }\n"],"mappings":";;;;;;;;;;;;AAkBmBA,wBAAQ;;;;AAmB3B,MAAM,yBAAyBC;AAE/B,MAAM,UAAUA,+BAAc,qBAAqB;AACnD,MAAM,kBAAkBA,+BAAc,qBAAqB;AAC3D,MAAM,gBAAgBA,+BAAc,qBAAqB"}