@intlayer/core 9.0.0-canary.0 → 9.0.0-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/cjs/dictionaryManipulator/index.cjs +1 -0
  2. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +1 -5
  3. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -1
  4. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +48 -74
  5. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -1
  6. package/dist/cjs/index.cjs +4 -0
  7. package/dist/cjs/interpreter/getContent/plugins.cjs +8 -8
  8. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  9. package/dist/cjs/interpreter/getDictionary.cjs +5 -5
  10. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  11. package/dist/cjs/interpreter/getIntlayer.cjs +8 -3
  12. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  13. package/dist/cjs/localization/comparePaths.cjs +75 -0
  14. package/dist/cjs/localization/comparePaths.cjs.map +1 -0
  15. package/dist/cjs/localization/getLocalizedUrl.cjs +4 -4
  16. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  17. package/dist/cjs/localization/getPathWithoutLocale.cjs +2 -2
  18. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  19. package/dist/cjs/localization/getPrefix.cjs +2 -2
  20. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  21. package/dist/cjs/localization/index.cjs +3 -0
  22. package/dist/cjs/localization/rewriteUtils.cjs +1 -1
  23. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  24. package/dist/cjs/localization/validatePrefix.cjs +2 -2
  25. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  26. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +6 -6
  27. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
  28. package/dist/cjs/utils/localeStorage.cjs +4 -4
  29. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  30. package/dist/esm/dictionaryManipulator/index.mjs +2 -2
  31. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +1 -5
  32. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -1
  33. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +48 -75
  34. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -1
  35. package/dist/esm/index.mjs +3 -2
  36. package/dist/esm/interpreter/getContent/plugins.mjs +8 -8
  37. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  38. package/dist/esm/interpreter/getDictionary.mjs +5 -5
  39. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  40. package/dist/esm/interpreter/getIntlayer.mjs +8 -3
  41. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  42. package/dist/esm/localization/comparePaths.mjs +73 -0
  43. package/dist/esm/localization/comparePaths.mjs.map +1 -0
  44. package/dist/esm/localization/getLocalizedUrl.mjs +4 -4
  45. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  46. package/dist/esm/localization/getPathWithoutLocale.mjs +2 -2
  47. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  48. package/dist/esm/localization/getPrefix.mjs +2 -2
  49. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  50. package/dist/esm/localization/index.mjs +2 -1
  51. package/dist/esm/localization/rewriteUtils.mjs +1 -1
  52. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  53. package/dist/esm/localization/validatePrefix.mjs +2 -2
  54. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  55. package/dist/esm/transpiler/markdown/validateMarkdown.mjs +6 -6
  56. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  57. package/dist/esm/utils/localeStorage.mjs +4 -4
  58. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  59. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +1 -2
  60. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +1 -2
  61. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +1 -2
  62. package/dist/types/dictionaryManipulator/index.d.ts +2 -2
  63. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts +1 -1
  64. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
  65. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +33 -20
  66. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
  67. package/dist/types/index.d.ts +3 -2
  68. package/dist/types/interpreter/getDictionary.d.ts +5 -5
  69. package/dist/types/interpreter/getIntlayer.d.ts +1 -1
  70. package/dist/types/interpreter/getPlural.d.ts +1 -1
  71. package/dist/types/localization/comparePaths.d.ts +66 -0
  72. package/dist/types/localization/comparePaths.d.ts.map +1 -0
  73. package/dist/types/localization/getPrefix.d.ts +4 -18
  74. package/dist/types/localization/getPrefix.d.ts.map +1 -1
  75. package/dist/types/localization/index.d.ts +2 -1
  76. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -1
  77. package/package.json +8 -8
  78. package/dist/cjs/interpreter/getCollection.cjs +0 -25
  79. package/dist/cjs/interpreter/getCollection.cjs.map +0 -1
  80. package/dist/cjs/interpreter/getVariant.cjs +0 -30
  81. package/dist/cjs/interpreter/getVariant.cjs.map +0 -1
  82. package/dist/cjs/transpiler/collection/collection.cjs +0 -32
  83. package/dist/cjs/transpiler/collection/collection.cjs.map +0 -1
  84. package/dist/cjs/transpiler/collection/index.cjs +0 -4
  85. package/dist/cjs/transpiler/variant/index.cjs +0 -4
  86. package/dist/cjs/transpiler/variant/variant.cjs +0 -35
  87. package/dist/cjs/transpiler/variant/variant.cjs.map +0 -1
  88. package/dist/esm/interpreter/getCollection.mjs +0 -23
  89. package/dist/esm/interpreter/getCollection.mjs.map +0 -1
  90. package/dist/esm/interpreter/getVariant.mjs +0 -28
  91. package/dist/esm/interpreter/getVariant.mjs.map +0 -1
  92. package/dist/esm/transpiler/collection/collection.mjs +0 -30
  93. package/dist/esm/transpiler/collection/collection.mjs.map +0 -1
  94. package/dist/esm/transpiler/collection/index.mjs +0 -3
  95. package/dist/esm/transpiler/variant/index.mjs +0 -3
  96. package/dist/esm/transpiler/variant/variant.mjs +0 -33
  97. package/dist/esm/transpiler/variant/variant.mjs.map +0 -1
  98. package/dist/types/@intlayer/core/dist/types/formatters/compact.d.ts +0 -1
  99. package/dist/types/@intlayer/core/dist/types/formatters/currency.d.ts +0 -1
  100. package/dist/types/@intlayer/core/dist/types/formatters/date.d.ts +0 -1
  101. package/dist/types/@intlayer/core/dist/types/formatters/index.d.ts +0 -1
  102. package/dist/types/@intlayer/core/dist/types/formatters/list.d.ts +0 -1
  103. package/dist/types/@intlayer/core/dist/types/formatters/number.d.ts +0 -1
  104. package/dist/types/@intlayer/core/dist/types/formatters/percentage.d.ts +0 -1
  105. package/dist/types/@intlayer/core/dist/types/formatters/relativeTime.d.ts +0 -1
  106. package/dist/types/@intlayer/core/dist/types/formatters/units.d.ts +0 -1
  107. package/dist/types/@intlayer/core/dist/types/interpreter/getCondition.d.ts +0 -1
  108. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/deepTransform.d.ts +0 -1
  109. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/getContent.d.ts +0 -2
  110. package/dist/types/@intlayer/core/dist/types/interpreter/getContent/plugins.d.ts +0 -4
  111. package/dist/types/@intlayer/core/dist/types/interpreter/getDictionary.d.ts +0 -2
  112. package/dist/types/@intlayer/core/dist/types/interpreter/getEnumeration.d.ts +0 -1
  113. package/dist/types/@intlayer/core/dist/types/interpreter/getIntlayer.d.ts +0 -2
  114. package/dist/types/@intlayer/core/dist/types/interpreter/getNesting.d.ts +0 -2
  115. package/dist/types/@intlayer/core/dist/types/interpreter/getPlural.d.ts +0 -1
  116. package/dist/types/@intlayer/core/dist/types/interpreter/getTranslation.d.ts +0 -1
  117. package/dist/types/@intlayer/core/dist/types/interpreter/getVariant.d.ts +0 -1
  118. package/dist/types/@intlayer/core/dist/types/interpreter/index.d.ts +0 -1
  119. package/dist/types/@intlayer/core/dist/types/intlayer/dist/types/index.d.ts +0 -1
  120. package/dist/types/@intlayer/core/dist/types/localization/generateSitemap.d.ts +0 -2
  121. package/dist/types/@intlayer/core/dist/types/localization/getBrowserLocale.d.ts +0 -1
  122. package/dist/types/@intlayer/core/dist/types/localization/getHTMLTextDir.d.ts +0 -1
  123. package/dist/types/@intlayer/core/dist/types/localization/getLocale.d.ts +0 -1
  124. package/dist/types/@intlayer/core/dist/types/localization/getLocaleFromPath.d.ts +0 -1
  125. package/dist/types/@intlayer/core/dist/types/localization/getLocaleLang.d.ts +0 -1
  126. package/dist/types/@intlayer/core/dist/types/localization/getLocaleName.d.ts +0 -1
  127. package/dist/types/@intlayer/core/dist/types/localization/getLocalizedUrl.d.ts +0 -1
  128. package/dist/types/@intlayer/core/dist/types/localization/getMultilingualUrls.d.ts +0 -1
  129. package/dist/types/@intlayer/core/dist/types/localization/getPathWithoutLocale.d.ts +0 -1
  130. package/dist/types/@intlayer/core/dist/types/localization/getPrefix.d.ts +0 -3
  131. package/dist/types/@intlayer/core/dist/types/localization/index.d.ts +0 -1
  132. package/dist/types/@intlayer/core/dist/types/localization/localeDetector.d.ts +0 -1
  133. package/dist/types/@intlayer/core/dist/types/localization/localeMapper.d.ts +0 -2
  134. package/dist/types/@intlayer/core/dist/types/localization/localeResolver.d.ts +0 -2
  135. package/dist/types/@intlayer/core/dist/types/localization/rewriteUtils.d.ts +0 -3
  136. package/dist/types/@intlayer/core/dist/types/localization/validatePrefix.d.ts +0 -1
  137. package/dist/types/@intlayer/core/dist/types/markdown/index.d.ts +0 -1
  138. package/dist/types/@intlayer/core/dist/types/transpiler/collection/collection.d.ts +0 -1
  139. package/dist/types/@intlayer/core/dist/types/transpiler/condition/condition.d.ts +0 -1
  140. package/dist/types/@intlayer/core/dist/types/transpiler/enumeration/enumeration.d.ts +0 -1
  141. package/dist/types/@intlayer/core/dist/types/transpiler/file/file.d.ts +0 -1
  142. package/dist/types/@intlayer/core/dist/types/transpiler/gender/gender.d.ts +0 -1
  143. package/dist/types/@intlayer/core/dist/types/transpiler/html/html.d.ts +0 -1
  144. package/dist/types/@intlayer/core/dist/types/transpiler/index.d.ts +0 -1
  145. package/dist/types/@intlayer/core/dist/types/transpiler/insertion/insertion.d.ts +0 -1
  146. package/dist/types/@intlayer/core/dist/types/transpiler/markdown/markdown.d.ts +0 -1
  147. package/dist/types/@intlayer/core/dist/types/transpiler/nesting/nesting.d.ts +0 -2
  148. package/dist/types/@intlayer/core/dist/types/transpiler/plural/plural.d.ts +0 -1
  149. package/dist/types/@intlayer/core/dist/types/transpiler/translation/translation.d.ts +0 -2
  150. package/dist/types/@intlayer/core/dist/types/transpiler/variant/variant.d.ts +0 -1
  151. package/dist/types/@intlayer/core/dist/types/utils/index.d.ts +0 -1
  152. package/dist/types/@intlayer/core/dist/types/utils/intl.d.ts +0 -1
  153. package/dist/types/@intlayer/core/dist/types/utils/isSameKeyPath.d.ts +0 -1
  154. package/dist/types/@intlayer/core/dist/types/utils/localeStorage.d.ts +0 -2
  155. package/dist/types/interpreter/getCollection.d.ts +0 -19
  156. package/dist/types/interpreter/getCollection.d.ts.map +0 -1
  157. package/dist/types/interpreter/getVariant.d.ts +0 -26
  158. package/dist/types/interpreter/getVariant.d.ts.map +0 -1
  159. package/dist/types/intlayer/dist/types/index.d.ts +0 -4
  160. package/dist/types/transpiler/collection/collection.d.ts +0 -34
  161. package/dist/types/transpiler/collection/collection.d.ts.map +0 -1
  162. package/dist/types/transpiler/collection/index.d.ts +0 -2
  163. package/dist/types/transpiler/variant/index.d.ts +0 -2
  164. package/dist/types/transpiler/variant/variant.d.ts +0 -43
  165. package/dist/types/transpiler/variant/variant.d.ts.map +0 -1
@@ -1,30 +0,0 @@
1
- import { COLLECTION } from "@intlayer/types/nodeType";
2
-
3
- //#region src/transpiler/collection/collection.ts
4
- /**
5
- * Declares an ordered list of content items inside a dictionary.
6
- *
7
- * At runtime, `useIntlayer('my-key')` returns all items as an array.
8
- * `useIntlayer('my-key', { item: 2 })` returns only the item at index 2.
9
- *
10
- * @example
11
- * ```ts
12
- * import { t, collection } from 'intlayer';
13
- *
14
- * export default {
15
- * key: 'faq',
16
- * content: collection([
17
- * { question: t({ en: 'What is Intlayer?' }), answer: t({ en: '...' }) },
18
- * { question: t({ en: 'Is it free?' }), answer: t({ en: '...' }) },
19
- * ]),
20
- * } satisfies Dictionary;
21
- * ```
22
- */
23
- const collection = (items) => ({
24
- nodeType: COLLECTION,
25
- collection: items
26
- });
27
-
28
- //#endregion
29
- export { collection };
30
- //# sourceMappingURL=collection.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.mjs","names":[],"sources":["../../../../src/transpiler/collection/collection.ts"],"sourcesContent":["import { COLLECTION } from '@intlayer/types/nodeType';\n\n/**\n * Shape of a collection node stored in the dictionary JSON.\n * Items may contain any other node type (translations, conditions, etc.).\n */\nexport type CollectionContent<T = unknown> = {\n nodeType: typeof COLLECTION;\n collection: T[];\n};\n\n/**\n * Declares an ordered list of content items inside a dictionary.\n *\n * At runtime, `useIntlayer('my-key')` returns all items as an array.\n * `useIntlayer('my-key', { item: 2 })` returns only the item at index 2.\n *\n * @example\n * ```ts\n * import { t, collection } from 'intlayer';\n *\n * export default {\n * key: 'faq',\n * content: collection([\n * { question: t({ en: 'What is Intlayer?' }), answer: t({ en: '...' }) },\n * { question: t({ en: 'Is it free?' }), answer: t({ en: '...' }) },\n * ]),\n * } satisfies Dictionary;\n * ```\n */\nexport const collection = <T>(items: T[]): CollectionContent<T> => ({\n nodeType: COLLECTION,\n collection: items,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,cAAiB,WAAsC;CAClE,UAAU;CACV,YAAY;CACb"}
@@ -1,3 +0,0 @@
1
- import { collection } from "./collection.mjs";
2
-
3
- export { collection };
@@ -1,3 +0,0 @@
1
- import { variant } from "./variant.mjs";
2
-
3
- export { variant };
@@ -1,33 +0,0 @@
1
- import { VARIANT } from "@intlayer/types/nodeType";
2
-
3
- //#region src/transpiler/variant/variant.ts
4
- /**
5
- * Declares a set of named content alternatives for A/B testing or feature flags.
6
- *
7
- * The `control` key is mandatory and acts as the default when no variant is
8
- * selected. At runtime, `useIntlayer('my-key')` returns the `control` variant.
9
- * `useIntlayer('my-key', { variant: 'black_friday' })` returns that variant.
10
- *
11
- * @example
12
- * ```ts
13
- * import { t, variant } from 'intlayer';
14
- *
15
- * export default {
16
- * key: 'hero-banner',
17
- * content: {
18
- * headline: variant({
19
- * control: t({ en: 'Welcome', fr: 'Bienvenue' }),
20
- * black_friday: t({ en: 'Up to 50% off', fr: 'Jusqu\'à -50 %' }),
21
- * }),
22
- * },
23
- * } satisfies Dictionary;
24
- * ```
25
- */
26
- const variant = (variants) => ({
27
- nodeType: VARIANT,
28
- variant: variants
29
- });
30
-
31
- //#endregion
32
- export { variant };
33
- //# sourceMappingURL=variant.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variant.mjs","names":[],"sources":["../../../../src/transpiler/variant/variant.ts"],"sourcesContent":["import { VARIANT } from '@intlayer/types/nodeType';\n\n/**\n * Shape of a variant node stored in the dictionary JSON.\n * `control` is the mandatory default/fallback key; all other keys are\n * optional named experiment branches.\n */\nexport type VariantContentState<T = unknown> = { control: T } & Record<\n string,\n T\n>;\n\nexport type VariantContent<T = unknown> = {\n nodeType: typeof VARIANT;\n variant: VariantContentState<T>;\n};\n\n/**\n * Declares a set of named content alternatives for A/B testing or feature flags.\n *\n * The `control` key is mandatory and acts as the default when no variant is\n * selected. At runtime, `useIntlayer('my-key')` returns the `control` variant.\n * `useIntlayer('my-key', { variant: 'black_friday' })` returns that variant.\n *\n * @example\n * ```ts\n * import { t, variant } from 'intlayer';\n *\n * export default {\n * key: 'hero-banner',\n * content: {\n * headline: variant({\n * control: t({ en: 'Welcome', fr: 'Bienvenue' }),\n * black_friday: t({ en: 'Up to 50% off', fr: 'Jusqu\\'à -50 %' }),\n * }),\n * },\n * } satisfies Dictionary;\n * ```\n */\nexport const variant = <T>(\n variants: { control: T } & Partial<Record<string, T>>\n): VariantContent<T> => ({\n nodeType: VARIANT,\n variant: variants as VariantContentState<T>,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,WACX,cACuB;CACvB,UAAU;CACV,SAAS;CACV"}
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1,2 +0,0 @@
1
- import { ContentNode } from "@intlayer/types/dictionary";
2
- import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1,4 +0,0 @@
1
- import { DeclaredLocales, DictionaryKeys, LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { NodeType } from "@intlayer/types/nodeType";
3
- import { Locale } from "@intlayer/types/allLocales";
4
- import { KeyPath } from "@intlayer/types/keyPath";
@@ -1,2 +0,0 @@
1
- import { Dictionary, DictionarySelector, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
2
- import { DeclaredLocales, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1,2 +0,0 @@
1
- import { DictionarySelector } from "@intlayer/types/dictionary";
2
- import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1,2 +0,0 @@
1
- import { GetSubPath } from "@intlayer/types/dictionary";
2
- import { DictionaryKeys, DictionaryRegistryContent } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { DeclaredLocales } from "@intlayer/types";
@@ -1 +0,0 @@
1
- import { LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
@@ -1,2 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { RoutingConfig } from "@intlayer/types/config";
@@ -1 +0,0 @@
1
- import { Locale } from "@intlayer/types/allLocales";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { Locale } from "@intlayer/types/allLocales";
@@ -1 +0,0 @@
1
- import { Locale } from "@intlayer/types/allLocales";
@@ -1 +0,0 @@
1
- import { GetLocaleLang, LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { LocalesValues, LocalizedUrl, ResolvedDefaultLocale } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { DeclaredLocales, LocalesValues, PathWithoutLocale } from "@intlayer/types/module_augmentation";
@@ -1,3 +0,0 @@
1
- import { DeclaredLocales, LocalesValues, ResolvedDefaultLocale, ResolvedRoutingMode } from "@intlayer/types/module_augmentation";
2
- import { Locale } from "@intlayer/types/allLocales";
3
- import { RoutingConfig } from "@intlayer/types/config";
@@ -1 +0,0 @@
1
- import { Locale } from "@intlayer/types/allLocales";
@@ -1,2 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { Locale } from "@intlayer/types/allLocales";
@@ -1,2 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { Locale } from "@intlayer/types/allLocales";
@@ -1,3 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { Locale } from "@intlayer/types/allLocales";
3
- import { RewriteObject, RewriteRules, RoutingConfig } from "@intlayer/types/config";
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { CONDITION, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { ENUMERATION, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { FILE, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { GENDER, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { HTML, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { INSERTION, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { MARKDOWN, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1,2 +0,0 @@
1
- import { DictionaryKeys, DictionaryRegistryContent } from "@intlayer/types/module_augmentation";
2
- import { NESTED, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- import { PLURAL, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1,2 +0,0 @@
1
- import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
2
- import { TRANSLATION, TypedNodeModel } from "@intlayer/types/nodeType";
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
@@ -1 +0,0 @@
1
- import { KeyPath } from "@intlayer/types/keyPath";
@@ -1,2 +0,0 @@
1
- import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import { Locale } from "@intlayer/types/allLocales";
@@ -1,19 +0,0 @@
1
- //#region src/interpreter/getCollection.d.ts
2
- /**
3
- * Picks a single item from a resolved collection array, or returns the full
4
- * array when no index is requested.
5
- *
6
- * @param items - The already-resolved collection items.
7
- * @param itemIndex - Optional 0-based index of the item to retrieve.
8
- * @returns The item at `itemIndex`, or the full array when no index is given.
9
- *
10
- * @example
11
- * ```ts
12
- * const all = getCollection(['a', 'b', 'c']); // ['a', 'b', 'c']
13
- * const one = getCollection(['a', 'b', 'c'], 1); // 'b'
14
- * ```
15
- */
16
- declare const getCollection: <T>(items: T[], itemIndex?: number) => T | T[];
17
- //#endregion
18
- export { getCollection };
19
- //# sourceMappingURL=getCollection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCollection.d.ts","names":[],"sources":["../../../src/interpreter/getCollection.ts"],"mappings":";;AAcA;;;;;;;;;;;;;cAAa,aAAA,MAAoB,KAAA,EAAO,CAAA,IAAK,SAAA,cAAqB,CAAA,GAAI,CAAA"}
@@ -1,26 +0,0 @@
1
- import { VariantContentState } from "../transpiler/variant/variant.js";
2
-
3
- //#region src/interpreter/getVariant.d.ts
4
- /**
5
- * Resolves a variant node to its selected alternative.
6
- *
7
- * Falls back to `control` when the requested `variantKey` does not exist in
8
- * the node or when no key is specified.
9
- *
10
- * @param variantContent - The map of variant alternatives.
11
- * @param variantKey - Optional name of the alternative to select.
12
- * @returns The resolved content for the requested variant.
13
- *
14
- * @example
15
- * ```ts
16
- * const node = { control: 'Welcome', black_friday: 'Up to 50% off' };
17
- *
18
- * getVariant(node); // 'Welcome'
19
- * getVariant(node, 'black_friday'); // 'Up to 50% off'
20
- * getVariant(node, 'nonexistent'); // 'Welcome' (fallback to control)
21
- * ```
22
- */
23
- declare const getVariant: <T>(variantContent: VariantContentState<T>, variantKey?: string) => T;
24
- //#endregion
25
- export { getVariant };
26
- //# sourceMappingURL=getVariant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getVariant.d.ts","names":[],"sources":["../../../src/interpreter/getVariant.ts"],"mappings":";;;;;AAqBA;;;;;;;;;;;;;;;;;cAAa,UAAA,MACX,cAAA,EAAgB,mBAAA,CAAoB,CAAA,GACpC,UAAA,cACC,CAAA"}
@@ -1,4 +0,0 @@
1
- import { Dictionary } from "@intlayer/types/dictionary";
2
- import { LocalesValues as LocalesValues$1 } from "@intlayer/types/module_augmentation";
3
- import { IntlayerConfig } from "@intlayer/types/config";
4
- export { type LocalesValues$1 as LocalesValues };
@@ -1,34 +0,0 @@
1
- import { COLLECTION } from "@intlayer/types/nodeType";
2
-
3
- //#region src/transpiler/collection/collection.d.ts
4
- /**
5
- * Shape of a collection node stored in the dictionary JSON.
6
- * Items may contain any other node type (translations, conditions, etc.).
7
- */
8
- type CollectionContent<T = unknown> = {
9
- nodeType: typeof COLLECTION;
10
- collection: T[];
11
- };
12
- /**
13
- * Declares an ordered list of content items inside a dictionary.
14
- *
15
- * At runtime, `useIntlayer('my-key')` returns all items as an array.
16
- * `useIntlayer('my-key', { item: 2 })` returns only the item at index 2.
17
- *
18
- * @example
19
- * ```ts
20
- * import { t, collection } from 'intlayer';
21
- *
22
- * export default {
23
- * key: 'faq',
24
- * content: collection([
25
- * { question: t({ en: 'What is Intlayer?' }), answer: t({ en: '...' }) },
26
- * { question: t({ en: 'Is it free?' }), answer: t({ en: '...' }) },
27
- * ]),
28
- * } satisfies Dictionary;
29
- * ```
30
- */
31
- declare const collection: <T>(items: T[]) => CollectionContent<T>;
32
- //#endregion
33
- export { CollectionContent, collection };
34
- //# sourceMappingURL=collection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.d.ts","names":[],"sources":["../../../../src/transpiler/collection/collection.ts"],"mappings":";;;;;AAMA;;KAAY,iBAAA;EACV,QAAA,SAAiB,UAAA;EACjB,UAAA,EAAY,CAAA;AAAA;;;;;;AAsBd;;;;;;;;;;;;;;cAAa,UAAA,MAAiB,KAAA,EAAO,CAAA,OAAM,iBAAA,CAAkB,CAAA"}
@@ -1,2 +0,0 @@
1
- import { CollectionContent, collection } from "./collection.js";
2
- export { CollectionContent, collection };
@@ -1,2 +0,0 @@
1
- import { VariantContent, VariantContentState, variant } from "./variant.js";
2
- export { VariantContent, VariantContentState, variant };
@@ -1,43 +0,0 @@
1
- import { VARIANT } from "@intlayer/types/nodeType";
2
-
3
- //#region src/transpiler/variant/variant.d.ts
4
- /**
5
- * Shape of a variant node stored in the dictionary JSON.
6
- * `control` is the mandatory default/fallback key; all other keys are
7
- * optional named experiment branches.
8
- */
9
- type VariantContentState<T = unknown> = {
10
- control: T;
11
- } & Record<string, T>;
12
- type VariantContent<T = unknown> = {
13
- nodeType: typeof VARIANT;
14
- variant: VariantContentState<T>;
15
- };
16
- /**
17
- * Declares a set of named content alternatives for A/B testing or feature flags.
18
- *
19
- * The `control` key is mandatory and acts as the default when no variant is
20
- * selected. At runtime, `useIntlayer('my-key')` returns the `control` variant.
21
- * `useIntlayer('my-key', { variant: 'black_friday' })` returns that variant.
22
- *
23
- * @example
24
- * ```ts
25
- * import { t, variant } from 'intlayer';
26
- *
27
- * export default {
28
- * key: 'hero-banner',
29
- * content: {
30
- * headline: variant({
31
- * control: t({ en: 'Welcome', fr: 'Bienvenue' }),
32
- * black_friday: t({ en: 'Up to 50% off', fr: 'Jusqu\'à -50 %' }),
33
- * }),
34
- * },
35
- * } satisfies Dictionary;
36
- * ```
37
- */
38
- declare const variant: <T>(variants: {
39
- control: T;
40
- } & Partial<Record<string, T>>) => VariantContent<T>;
41
- //#endregion
42
- export { VariantContent, VariantContentState, variant };
43
- //# sourceMappingURL=variant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variant.d.ts","names":[],"sources":["../../../../src/transpiler/variant/variant.ts"],"mappings":";;;;;AAOA;;;KAAY,mBAAA;EAAqC,OAAA,EAAS,CAAA;AAAA,IAAM,MAAA,SAE9D,CAAA;AAAA,KAGU,cAAA;EACV,QAAA,SAAiB,OAAA;EACjB,OAAA,EAAS,mBAAA,CAAoB,CAAA;AAAA;;;;;;AAF/B;;;;;;;;;;;;;;;;AA2BA;cAAa,OAAA,MACX,QAAA;EAAY,OAAA,EAAS,CAAA;AAAA,IAAM,OAAA,CAAQ,MAAA,SAAe,CAAA,OACjD,cAAA,CAAe,CAAA"}