gt-react 10.6.5 → 10.6.6-alpha.0

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 (157) hide show
  1. package/dist/client.cjs.min.cjs +16 -16
  2. package/dist/client.d.ts +6 -740
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.esm.min.mjs +16 -16
  5. package/dist/errors-dir/constants.d.ts +2 -0
  6. package/dist/errors-dir/constants.d.ts.map +1 -0
  7. package/dist/index.cjs.min.cjs +20 -3
  8. package/dist/index.d.ts +3 -22
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.esm.min.mjs +20 -3
  11. package/dist/internal.cjs.min.cjs +16 -16
  12. package/dist/internal.d.ts +12 -30
  13. package/dist/internal.d.ts.map +1 -1
  14. package/dist/internal.esm.min.mjs +16 -16
  15. package/dist/provider/ClientProvider.d.ts.map +1 -1
  16. package/dist/provider/GTProvider.d.ts +4 -24
  17. package/dist/provider/GTProvider.d.ts.map +1 -1
  18. package/dist/provider/helpers/isSSREnabled.d.ts.map +1 -1
  19. package/dist/provider/hooks/locales/useDetermineLocale.d.ts +2 -9
  20. package/dist/provider/hooks/locales/useDetermineLocale.d.ts.map +1 -1
  21. package/dist/types/config.d.ts +1 -47
  22. package/dist/types/config.d.ts.map +1 -1
  23. package/dist/utils/utils.d.ts +2 -6
  24. package/dist/utils/utils.d.ts.map +1 -1
  25. package/package.json +3 -2
  26. package/dist/branches/Branch.d.ts +0 -34
  27. package/dist/branches/Branch.d.ts.map +0 -1
  28. package/dist/branches/plurals/Plural.d.ts +0 -38
  29. package/dist/branches/plurals/Plural.d.ts.map +0 -1
  30. package/dist/branches/plurals/getPluralBranch.d.ts +0 -9
  31. package/dist/branches/plurals/getPluralBranch.d.ts.map +0 -1
  32. package/dist/dictionaries/collectUntranslatedEntries.d.ts +0 -17
  33. package/dist/dictionaries/collectUntranslatedEntries.d.ts.map +0 -1
  34. package/dist/dictionaries/getDictionaryEntry.d.ts +0 -4
  35. package/dist/dictionaries/getDictionaryEntry.d.ts.map +0 -1
  36. package/dist/dictionaries/getEntryAndMetadata.d.ts +0 -6
  37. package/dist/dictionaries/getEntryAndMetadata.d.ts.map +0 -1
  38. package/dist/dictionaries/getSubtree.d.ts +0 -18
  39. package/dist/dictionaries/getSubtree.d.ts.map +0 -1
  40. package/dist/dictionaries/indexDict.d.ts +0 -15
  41. package/dist/dictionaries/indexDict.d.ts.map +0 -1
  42. package/dist/dictionaries/injectAndMerge.d.ts +0 -9
  43. package/dist/dictionaries/injectAndMerge.d.ts.map +0 -1
  44. package/dist/dictionaries/injectEntry.d.ts +0 -18
  45. package/dist/dictionaries/injectEntry.d.ts.map +0 -1
  46. package/dist/dictionaries/injectFallbacks.d.ts +0 -17
  47. package/dist/dictionaries/injectFallbacks.d.ts.map +0 -1
  48. package/dist/dictionaries/injectHashes.d.ts +0 -11
  49. package/dist/dictionaries/injectHashes.d.ts.map +0 -1
  50. package/dist/dictionaries/injectTranslations.d.ts +0 -20
  51. package/dist/dictionaries/injectTranslations.d.ts.map +0 -1
  52. package/dist/dictionaries/isDictionaryEntry.d.ts +0 -8
  53. package/dist/dictionaries/isDictionaryEntry.d.ts.map +0 -1
  54. package/dist/dictionaries/loadDictionaryHelper.d.ts +0 -3
  55. package/dist/dictionaries/loadDictionaryHelper.d.ts.map +0 -1
  56. package/dist/dictionaries/mergeDictionaries.d.ts +0 -3
  57. package/dist/dictionaries/mergeDictionaries.d.ts.map +0 -1
  58. package/dist/dictionaries/stripMetadataFromEntries.d.ts +0 -6
  59. package/dist/dictionaries/stripMetadataFromEntries.d.ts.map +0 -1
  60. package/dist/errors/createErrors.d.ts +0 -33
  61. package/dist/errors/createErrors.d.ts.map +0 -1
  62. package/dist/hooks/useDefaultLocale.d.ts +0 -13
  63. package/dist/hooks/useDefaultLocale.d.ts.map +0 -1
  64. package/dist/hooks/useGTClass.d.ts +0 -23
  65. package/dist/hooks/useGTClass.d.ts.map +0 -1
  66. package/dist/hooks/useLocale.d.ts +0 -11
  67. package/dist/hooks/useLocale.d.ts.map +0 -1
  68. package/dist/hooks/useLocaleDirection.d.ts +0 -14
  69. package/dist/hooks/useLocaleDirection.d.ts.map +0 -1
  70. package/dist/hooks/useLocaleSelector.d.ts +0 -42
  71. package/dist/hooks/useLocaleSelector.d.ts.map +0 -1
  72. package/dist/hooks/useLocales.d.ts +0 -11
  73. package/dist/hooks/useLocales.d.ts.map +0 -1
  74. package/dist/hooks/useRegion.d.ts +0 -20
  75. package/dist/hooks/useRegion.d.ts.map +0 -1
  76. package/dist/hooks/useRegionSelector.d.ts +0 -82
  77. package/dist/hooks/useRegionSelector.d.ts.map +0 -1
  78. package/dist/hooks/useSetLocale.d.ts +0 -12
  79. package/dist/hooks/useSetLocale.d.ts.map +0 -1
  80. package/dist/internal/addGTIdentifier.d.ts +0 -4
  81. package/dist/internal/addGTIdentifier.d.ts.map +0 -1
  82. package/dist/internal/flattenDictionary.d.ts +0 -11
  83. package/dist/internal/flattenDictionary.d.ts.map +0 -1
  84. package/dist/internal/writeChildrenAsObjects.d.ts +0 -10
  85. package/dist/internal/writeChildrenAsObjects.d.ts.map +0 -1
  86. package/dist/messages/messages.d.ts +0 -43
  87. package/dist/messages/messages.d.ts.map +0 -1
  88. package/dist/promises/dangerouslyUsable.d.ts +0 -37
  89. package/dist/promises/dangerouslyUsable.d.ts.map +0 -1
  90. package/dist/promises/reactHasUse.d.ts +0 -2
  91. package/dist/promises/reactHasUse.d.ts.map +0 -1
  92. package/dist/provider/GTContext.d.ts +0 -4
  93. package/dist/provider/GTContext.d.ts.map +0 -1
  94. package/dist/provider/config/defaultProps.d.ts +0 -4
  95. package/dist/provider/config/defaultProps.d.ts.map +0 -1
  96. package/dist/provider/helpers/validateString.d.ts +0 -6
  97. package/dist/provider/helpers/validateString.d.ts.map +0 -1
  98. package/dist/provider/hooks/locales/useLocaleState.d.ts +0 -16
  99. package/dist/provider/hooks/locales/useLocaleState.d.ts.map +0 -1
  100. package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts +0 -18
  101. package/dist/provider/hooks/translation/useCreateInternalUseGTFunction.d.ts.map +0 -1
  102. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts +0 -4
  103. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsFunction.d.ts.map +0 -1
  104. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts +0 -4
  105. package/dist/provider/hooks/translation/useCreateInternalUseTranslationsObjFunction.d.ts.map +0 -1
  106. package/dist/provider/hooks/useErrorChecks.d.ts +0 -9
  107. package/dist/provider/hooks/useErrorChecks.d.ts.map +0 -1
  108. package/dist/provider/hooks/useLoadDictionary.d.ts +0 -15
  109. package/dist/provider/hooks/useLoadDictionary.d.ts.map +0 -1
  110. package/dist/provider/hooks/useLoadTranslations.d.ts +0 -17
  111. package/dist/provider/hooks/useLoadTranslations.d.ts.map +0 -1
  112. package/dist/provider/hooks/useRuntimeTranslation.d.ts +0 -23
  113. package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +0 -1
  114. package/dist/rendering/defaultRenderSettings.d.ts +0 -6
  115. package/dist/rendering/defaultRenderSettings.d.ts.map +0 -1
  116. package/dist/rendering/getGTTag.d.ts +0 -3
  117. package/dist/rendering/getGTTag.d.ts.map +0 -1
  118. package/dist/rendering/isVariableObject.d.ts +0 -3
  119. package/dist/rendering/isVariableObject.d.ts.map +0 -1
  120. package/dist/rendering/renderDefaultChildren.d.ts +0 -8
  121. package/dist/rendering/renderDefaultChildren.d.ts.map +0 -1
  122. package/dist/rendering/renderSkeleton.d.ts +0 -8
  123. package/dist/rendering/renderSkeleton.d.ts.map +0 -1
  124. package/dist/rendering/renderTranslatedChildren.d.ts +0 -9
  125. package/dist/rendering/renderTranslatedChildren.d.ts.map +0 -1
  126. package/dist/rendering/renderVariable.d.ts +0 -4
  127. package/dist/rendering/renderVariable.d.ts.map +0 -1
  128. package/dist/translation/hooks/useGT.d.ts +0 -20
  129. package/dist/translation/hooks/useGT.d.ts.map +0 -1
  130. package/dist/translation/hooks/useMessages.d.ts +0 -19
  131. package/dist/translation/hooks/useMessages.d.ts.map +0 -1
  132. package/dist/translation/hooks/useTranslations.d.ts +0 -17
  133. package/dist/translation/hooks/useTranslations.d.ts.map +0 -1
  134. package/dist/translation/inline/T.d.ts +0 -42
  135. package/dist/translation/inline/T.d.ts.map +0 -1
  136. package/dist/types/context.d.ts +0 -30
  137. package/dist/types/context.d.ts.map +0 -1
  138. package/dist/types/runtime.d.ts +0 -20
  139. package/dist/types/runtime.d.ts.map +0 -1
  140. package/dist/types/types.d.ts +0 -90
  141. package/dist/types/types.d.ts.map +0 -1
  142. package/dist/utils/cookies.d.ts +0 -9
  143. package/dist/utils/cookies.d.ts.map +0 -1
  144. package/dist/utils/fetchTranslations.d.ts +0 -9
  145. package/dist/utils/fetchTranslations.d.ts.map +0 -1
  146. package/dist/variables/Currency.d.ts +0 -30
  147. package/dist/variables/Currency.d.ts.map +0 -1
  148. package/dist/variables/DateTime.d.ts +0 -29
  149. package/dist/variables/DateTime.d.ts.map +0 -1
  150. package/dist/variables/Num.d.ts +0 -31
  151. package/dist/variables/Num.d.ts.map +0 -1
  152. package/dist/variables/Var.d.ts +0 -32
  153. package/dist/variables/Var.d.ts.map +0 -1
  154. package/dist/variables/_getVariableProps.d.ts +0 -11
  155. package/dist/variables/_getVariableProps.d.ts.map +0 -1
  156. package/dist/variables/getVariableName.d.ts +0 -10
  157. package/dist/variables/getVariableName.d.ts.map +0 -1
@@ -1,7 +1,3 @@
1
- import { TaggedElement } from '../types/types';
2
- export declare function isValidTaggedElement(target: unknown): target is TaggedElement;
3
- export declare function readAuthFromEnv(projectId?: string, devApiKey?: string): {
4
- projectId: string;
5
- devApiKey?: string;
6
- };
1
+ import { AuthFromEnvParams, AuthFromEnvReturn } from '@generaltranslation/react-core/types';
2
+ export declare function readAuthFromEnv({ projectId, devApiKey, }: AuthFromEnvParams): AuthFromEnvReturn;
7
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAE7E;AAED,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CA2CA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAE9C,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,SAAS,GACV,EAAE,iBAAiB,GAAG,iBAAiB,CA6CvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react",
3
- "version": "10.6.5",
3
+ "version": "10.6.6-alpha.0",
4
4
  "description": "A React library for automatic internationalization.",
5
5
  "main": "./dist/index.cjs.min.cjs",
6
6
  "module": "./dist/index.esm.min.mjs",
@@ -14,8 +14,9 @@
14
14
  "react-dom": ">=16.8.0"
15
15
  },
16
16
  "dependencies": {
17
+ "generaltranslation": "7.6.5",
17
18
  "@generaltranslation/supported-locales": "2.0.15",
18
- "generaltranslation": "7.6.5"
19
+ "@generaltranslation/react-core": "0.0.1-alpha.0"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",
@@ -1,34 +0,0 @@
1
- /**
2
- * The `<Branch>` component dynamically renders a specified branch of content or a fallback child component.
3
- * It allows for flexible content switching based on the `branch` prop and an object of possible branches (`...branches`).
4
- * If the specified `branch` is present in the `branches` object, it renders the content of that branch.
5
- * If the `branch` is not found, it renders the provided `children` as fallback content.
6
- *
7
- * @example
8
- * ```jsx
9
- * <Branch
10
- * branch="summary"
11
- * summary={<p>This is a summary</p>}
12
- * details={<p>Details here</p>}
13
- * >
14
- * <p>Fallback content</p>
15
- * </Branch>
16
- * ```
17
- * If the `branch` prop is set to `"summary"`, it will render `<p>This is a summary</p>`. If the `branch` is not set or does not match any keys in the branches object, it renders the fallback content `<p>Fallback content</p>`.
18
- *
19
- * @param {any} [children] - Fallback content to render if no matching branch is found.
20
- * @param {any} [name="branch"] - Optional name for the component, used for metadata or tracking purposes.
21
- * @param {string} [branch] - The name of the branch to render. The component looks for this key in the `...branches` object.
22
- * @param {...{[key: string]: any}} [branches] - A spread object containing possible branches as keys and their corresponding content as values.
23
- * @returns {React.JSX.Element} The rendered branch or fallback content.
24
- */
25
- declare function Branch({ children, branch, ...branches }: {
26
- children?: any;
27
- branch?: string | number | boolean;
28
- [key: string]: any;
29
- }): React.JSX.Element;
30
- declare namespace Branch {
31
- var _gtt: string;
32
- }
33
- export default Branch;
34
- //# sourceMappingURL=Branch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Branch.d.ts","sourceRoot":"","sources":["../../src/branches/Branch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,MAAM,EACN,GAAG,QAAQ,EACZ,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAOpB;kBAfQ,MAAM;;;AAkBf,eAAe,MAAM,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * The `<Plural>` component dynamically renders content based on the plural form of the given number (`n`).
3
- * It determines which content to display by matching the value of `n` to the appropriate pluralization branch,
4
- * based on the current locale or a default locale. If no matching plural branch is found, the component renders
5
- * the fallback `children` content.
6
- *
7
- * @example
8
- * ```jsx
9
- * <Plural
10
- * n={1}
11
- * one="There is 1 item"
12
- * other="There are {n} items"
13
- * />
14
- * ```
15
- * In this example, if `n` is 1, it renders `"There is 1 item"`. If `n` is a different number, it renders
16
- * `"There are {n} items"`.
17
- *
18
- * @param {any} [children] - Fallback content to render if no matching plural branch is found.
19
- * @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
20
- * @param {string} [locales] - Optional parameter, the locale to use for pluralization format. If not provided and wrapped
21
- * in <GTProvider> will automatically populate this value as user's current locale. If not provided and not wrapped in
22
- * <GTProvider>, will use the library default locale (en-US).
23
- * @param {...{[key: string]: any}} [branches] - A spread object containing possible plural branches, typically including `one` for singular
24
- * and `other` for plural forms, but it may vary depending on the locale.
25
- * @returns {React.JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.
26
- * @throws {Error} If `n` is not provided or not a valid number.
27
- */
28
- declare function Plural({ children, n, locales, ...branches }: {
29
- children?: React.ReactNode;
30
- n?: number;
31
- locales?: string;
32
- [key: string]: any;
33
- }): React.JSX.Element;
34
- declare namespace Plural {
35
- var _gtt: string;
36
- }
37
- export default Plural;
38
- //# sourceMappingURL=Plural.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plural.d.ts","sourceRoot":"","sources":["../../../src/branches/plurals/Plural.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,CAAC,EACD,OAAO,EACP,GAAG,QAAQ,EACZ,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAcpB;kBAxBQ,MAAM;;;AA4Bf,eAAe,MAAM,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Main function to get the appropriate branch based on the provided number and branches.
3
- *
4
- * @param {number} n - The number to determine the branch for.
5
- * @param {any} branches - The object containing possible branches.
6
- * @returns {any} The determined branch.
7
- */
8
- export default function getPluralBranch(n: number, locales: string[], branches: Record<string, any>): any;
9
- //# sourceMappingURL=getPluralBranch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPluralBranch.d.ts","sourceRoot":"","sources":["../../../src/branches/plurals/getPluralBranch.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAQ9B"}
@@ -1,17 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- /**
3
- * @description Collects all untranslated entries from a dictionary
4
- * @param dictionary - The dictionary to collect untranslated entries from
5
- * @param translationsDictionary - The translated dictionary to compare against
6
- * @param id - The id of the dictionary to collect untranslated entries from
7
- * @returns An array of untranslated entries
8
- */
9
- export declare function collectUntranslatedEntries(dictionary: Dictionary, translationsDictionary: Dictionary, id?: string): {
10
- source: string;
11
- metadata: {
12
- $id: string;
13
- $context?: string;
14
- $_hash: string;
15
- };
16
- }[];
17
- //# sourceMappingURL=collectUntranslatedEntries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectUntranslatedEntries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/collectUntranslatedEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,EAAE,GAAE,MAAW,GACd;IACD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,CAgCF"}
@@ -1,4 +0,0 @@
1
- import { Dictionary, DictionaryEntry } from '../types/types';
2
- export declare function isValidDictionaryEntry(value: unknown): value is DictionaryEntry;
3
- export declare function getDictionaryEntry<T extends Dictionary>(dictionary: T, id: string): Dictionary | DictionaryEntry | undefined;
4
- //# sourceMappingURL=getDictionaryEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,eAAe,CAgB1B;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EACrD,UAAU,EAAE,CAAC,EACb,EAAE,EAAE,MAAM,GACT,UAAU,GAAG,eAAe,GAAG,SAAS,CAU1C"}
@@ -1,6 +0,0 @@
1
- import { DictionaryEntry, MetaEntry } from '../types/types';
2
- export default function getEntryAndMetadata(value: DictionaryEntry): {
3
- entry: string;
4
- metadata?: MetaEntry;
5
- };
6
- //# sourceMappingURL=getEntryAndMetadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEntryAndMetadata.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getEntryAndMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAUA"}
@@ -1,18 +0,0 @@
1
- import { Dictionary, DictionaryEntry } from '../types/types';
2
- export declare function getSubtree<T extends Dictionary>({ dictionary, id, }: {
3
- dictionary: T;
4
- id: string;
5
- }): Dictionary | DictionaryEntry | undefined;
6
- /**
7
- * @description A function that gets a subtree from a dictionary
8
- * @param dictionary - new dictionary to get the subtree from
9
- * @param id - id of the subtree to get
10
- * @param sourceDictionary - source dictionary to model off of
11
- * @returns
12
- */
13
- export declare function getSubtreeWithCreation<T extends Dictionary>({ dictionary, id, sourceDictionary, }: {
14
- dictionary: T;
15
- id: string;
16
- sourceDictionary: T;
17
- }): Dictionary | DictionaryEntry | undefined;
18
- //# sourceMappingURL=getSubtree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSubtree.d.ts","sourceRoot":"","sources":["../../src/dictionaries/getSubtree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,EAC/C,UAAU,EACV,EAAE,GACH,EAAE;IACD,UAAU,EAAE,CAAC,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAW3C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,UAAU,EAAE,EAC3D,UAAU,EACV,EAAE,EACF,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,CAAC,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,CAAC,CAAC;CACrB,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAoB3C"}
@@ -1,15 +0,0 @@
1
- import { Dictionary, DictionaryEntry } from '../types/types';
2
- /**
3
- * @description A function that gets a value from a dictionary, only one level
4
- * @param dictionary - dictionary to get the value from
5
- * @param id - id of the value to get
6
- */
7
- export declare function get(dictionary: Dictionary, id: string | number): DictionaryEntry | Dictionary;
8
- /**
9
- * @description A function that sets a value in a dictionary
10
- * @param dictionary - dictionary to set the value in
11
- * @param id - id of the value to set
12
- * @param value - value to set
13
- */
14
- export declare function set(dictionary: Dictionary, id: string | number, value: Dictionary | DictionaryEntry): void;
15
- //# sourceMappingURL=indexDict.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexDict.d.ts","sourceRoot":"","sources":["../../src/dictionaries/indexDict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7D;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,gCAQ9D;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CACjB,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,KAAK,EAAE,UAAU,GAAG,eAAe,QAOpC"}
@@ -1,9 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- /**
3
- * @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id
4
- * @param dictionary - The dictionary to inject the subtree into
5
- * @param subtree - The subtree to inject into the dictionary
6
- * @param id - The id of the subtree to inject into the dictionary
7
- */
8
- export declare function injectAndMerge(dictionary: Dictionary, subtree: Dictionary, id: string): Dictionary;
9
- //# sourceMappingURL=injectAndMerge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectAndMerge.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectAndMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAY7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,EACnB,EAAE,EAAE,MAAM,cAeX"}
@@ -1,18 +0,0 @@
1
- import { Dictionary, DictionaryEntry, TranslatedChildren } from '../types/types';
2
- /**
3
- * @description Injects an entry into a translations object
4
- * @param translations - The translations object to inject the entry into
5
- * @param entry - The entry to inject
6
- * @param hash - The hash of the entry
7
- * @param sourceDictionary - The source dictionary to model the new dictionary after
8
- */
9
- export declare function injectEntry(dictionaryEntry: DictionaryEntry, dictionary: Dictionary | DictionaryEntry, id: string, sourceDictionary: Dictionary | DictionaryEntry): DictionaryEntry | undefined;
10
- /**
11
- * @description Merge results into a dictionary
12
- * @param dictionary - The dictionary to merge the results into
13
- * @param results - The results to merge into the dictionary
14
- * @param sourceDictionary - The source dictionary to model the new dictionary after
15
- * @returns The merged dictionary
16
- */
17
- export declare function mergeResultsIntoDictionary(dictionary: Dictionary, results: [string, TranslatedChildren][], sourceDictionary: Dictionary): Dictionary;
18
- //# sourceMappingURL=injectEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AAYxB;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,GAAG,eAAe,EACxC,EAAE,EAAE,MAAM,EACV,gBAAgB,EAAE,UAAU,GAAG,eAAe,+BAiC/C;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,EACvC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAKZ"}
@@ -1,17 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- /**
3
- * @description Injects fallbacks into a dictionary
4
- * @param dictionary - The dictionary to inject translations into
5
- * @param translationsDictionary - The translations to inject into the dictionary
6
- * @param translations - The translations to inject into the dictionary
7
- * @param id - The id of the dictionary to inject translations into
8
- */
9
- export declare function injectFallbacks(dictionary: Dictionary, translationsDictionary: Dictionary, missingTranslations: {
10
- source: string;
11
- metadata: {
12
- $id: string;
13
- $context?: string;
14
- $_hash: string;
15
- };
16
- }[], prefixToRemove?: string): Dictionary;
17
- //# sourceMappingURL=injectFallbacks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectFallbacks.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectFallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,cAuB5B"}
@@ -1,11 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- /**
3
- * @description Given a dictionary, adds hashes to all dictionary entries
4
- * @param dictionary - The dictionary to add hashes to
5
- * @param id - The starting point of dictionary (if subtree)
6
- */
7
- export declare function injectHashes(dictionary: Dictionary, id?: string): {
8
- dictionary: Dictionary;
9
- updateDictionary: boolean;
10
- };
11
- //# sourceMappingURL=injectHashes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectHashes.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectHashes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,EAAE,GAAE,MAAW,GACd;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAwBvD"}
@@ -1,20 +0,0 @@
1
- import { Dictionary, Translations } from '../types/types';
2
- /**
3
- * @description Injects translations into a dictionary
4
- * @param dictionary - The dictionary to inject translations into
5
- * @param translationsDictionary - The translations to inject into the dictionary
6
- * @param translations - The translations to inject into the dictionary
7
- * @param id - The id of the dictionary to inject translations into
8
- */
9
- export declare function injectTranslations(dictionary: Dictionary, translationsDictionary: Dictionary, translations: Translations, missingTranslations: {
10
- source: string;
11
- metadata: {
12
- $id: string;
13
- $context?: string;
14
- $_hash: string;
15
- };
16
- }[], prefixToRemove?: string): {
17
- dictionary: Dictionary;
18
- updateDictionary: boolean;
19
- };
20
- //# sourceMappingURL=injectTranslations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectTranslations.d.ts","sourceRoot":"","sources":["../../src/dictionaries/injectTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,UAAU,EAClC,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D,EAAE,EACH,cAAc,GAAE,MAAW,GAC1B;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CA8BvD"}
@@ -1,8 +0,0 @@
1
- import { Dictionary, DictionaryEntry } from '../types/types';
2
- /**
3
- * Type guard function that checks if a value is a DictionaryEntry
4
- * @param value - The value to check
5
- * @returns true if the value is a DictionaryEntry, false otherwise
6
- */
7
- export declare function isDictionaryEntry(value: Dictionary | DictionaryEntry | undefined): value is DictionaryEntry;
8
- //# sourceMappingURL=isDictionaryEntry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isDictionaryEntry.d.ts","sourceRoot":"","sources":["../../src/dictionaries/isDictionaryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,GAC9C,KAAK,IAAI,eAAe,CAoC1B"}
@@ -1,3 +0,0 @@
1
- import { CustomLoader, Dictionary } from '../types/types';
2
- export default function loadDictionaryHelper(locale: string, loadDictionary: CustomLoader): Promise<Dictionary | undefined>;
3
- //# sourceMappingURL=loadDictionaryHelper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadDictionaryHelper.d.ts","sourceRoot":"","sources":["../../src/dictionaries/loadDictionaryHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1D,wBAA8B,oBAAoB,CAChD,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,YAAY,GAC3B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAkBjC"}
@@ -1,3 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- export default function mergeDictionaries(defaultLocaleDictionary: Dictionary, localeDictionary: Dictionary): Dictionary;
3
- //# sourceMappingURL=mergeDictionaries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/mergeDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAU7D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,uBAAuB,EAAE,UAAU,EACnC,gBAAgB,EAAE,UAAU,GAC3B,UAAU,CAiDZ"}
@@ -1,6 +0,0 @@
1
- import { Dictionary } from '../types/types';
2
- /**
3
- * @description Iterate over tree and remove metadata leaving just the entry
4
- */
5
- export declare function stripMetadataFromEntries(dictionary: Dictionary): Dictionary;
6
- //# sourceMappingURL=stripMetadataFromEntries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stripMetadataFromEntries.d.ts","sourceRoot":"","sources":["../../src/dictionaries/stripMetadataFromEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAc3E"}
@@ -1,33 +0,0 @@
1
- export declare const projectIdMissingError = "gt-react Error: General Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.";
2
- export declare const devApiKeyProductionError = "gt-react Error: Production environments cannot include a development api key.";
3
- export declare const apiKeyInProductionError = "gt-react Error: Production environments cannot include an api key.";
4
- export declare const createNoAuthError = "gt-react Error: Configuration is missing a projectId and/or devApiKey. Please add these values to your environment or pass them to the <GTProvider> directly.";
5
- export declare const createPluralMissingError: (children: any) => string;
6
- export declare const createClientSideTDictionaryCollisionError: (id: string) => string;
7
- export declare const createClientSideTHydrationError: (id: string) => string;
8
- export declare const renderingError = "General Translation: Rendering error.";
9
- export declare const dynamicTranslationError = "Error fetching batched translations:";
10
- export declare const createGenericRuntimeTranslationError: (id: string | undefined, hash: string) => string;
11
- export declare const runtimeTranslationError = "gt-react Error: Runtime translation failed: ";
12
- export declare const customLoadTranslationsError: (locale?: string) => string;
13
- export declare const customLoadDictionaryWarning: (locale?: string) => string;
14
- export declare const missingVariablesError: (variables: string[], message: string) => string;
15
- export declare const createStringRenderError: (message: string, id: string | undefined) => string;
16
- export declare const createStringTranslationError: (string: string, id?: string, functionName?: string) => string;
17
- export declare const invalidLocalesError: (locales: string[]) => string;
18
- export declare const invalidCanonicalLocalesError: (locales: string[]) => string;
19
- export declare const createEmptyIdError: () => string;
20
- export declare const createSubtreeNotFoundError: (id: string) => string;
21
- export declare const createDictionaryEntryError: () => string;
22
- export declare const createCannotInjectDictionaryEntryError: () => string;
23
- export declare const projectIdMissingWarning = "gt-react: Translation cloud services require a project ID! Find yours at generaltranslation.com/dashboard.";
24
- export declare const createNoEntryFoundWarning: (id: string) => string;
25
- export declare const createInvalidDictionaryEntryWarning: (id: string) => string;
26
- export declare const createNoEntryTranslationWarning: (id: string, prefixedId: string) => string;
27
- export declare const createMismatchingHashWarning: (expectedHash: string, receivedHash: string) => string;
28
- export declare const APIKeyMissingWarn: string;
29
- export declare const createUnsupportedLocalesWarning: (locales: string[]) => string;
30
- export declare const runtimeTranslationTimeoutWarning = "gt-react: Runtime translation timed out.";
31
- export declare const createUnsupportedLocaleWarning: (validatedLocale: string, newLocale: string) => string;
32
- export declare const dictionaryMissingWarning = "gt-react Warning: No dictionary was found. Ensure you are either passing your dictionary to the <GTProvider>.";
33
- //# sourceMappingURL=createErrors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createErrors.d.ts","sourceRoot":"","sources":["../../src/errors/createErrors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,6HAC0F,CAAC;AAE7H,eAAO,MAAM,wBAAwB,kFAC4C,CAAC;AAElF,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE,eAAO,MAAM,iBAAiB,kKACmI,CAAC;AAElK,eAAO,MAAM,wBAAwB,GAAI,UAAU,GAAG,WACiB,CAAC;AAExE,eAAO,MAAM,yCAAyC,GAAI,IAAI,MAAM,WAC6D,CAAC;AAElI,eAAO,MAAM,+BAA+B,GAAI,IAAI,MAAM,WAEmE,CAAC;AAE9H,eAAO,MAAM,cAAc,0CAA0C,CAAC;AAEtE,eAAO,MAAM,uBAAuB,yCAAyC,CAAC;AAE9E,eAAO,MAAM,oCAAoC,GAC/C,IAAI,MAAM,GAAG,SAAS,EACtB,MAAM,MAAM,WAOb,CAAC;AAEF,eAAO,MAAM,uBAAuB,iDAAiD,CAAC;AAEtF,eAAO,MAAM,2BAA2B,GAAI,SAAQ,MAAW,WACwF,CAAC;AAExJ,eAAO,MAAM,2BAA2B,GAAI,SAAQ,MAAW,WACoF,CAAC;AAEpJ,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,EAAE,SAAS,MAAM,WACiB,CAAC;AAE5F,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,IAAI,MAAM,GAAG,SAAS,WAEgF,CAAC;AAEzG,eAAO,MAAM,4BAA4B,GACvC,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,qBAAmB,WAIa,CAAC;AAEnC,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,WAGwB,CAAC;AAE9E,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,EAAE,WACgD,CAAC;AAE/G,eAAO,MAAM,kBAAkB,cAC8B,CAAC;AAE9D,eAAO,MAAM,0BAA0B,GAAI,IAAI,MAAM,WACW,CAAC;AAEjE,eAAO,MAAM,0BAA0B,cACuB,CAAC;AAE/D,eAAO,MAAM,sCAAsC,cACW,CAAC;AAI/D,eAAO,MAAM,uBAAuB,+GAC0E,CAAC;AAE/G,eAAO,MAAM,yBAAyB,GAAI,IAAI,MAAM,WACD,CAAC;AAEpD,eAAO,MAAM,mCAAmC,GAAI,IAAI,MAAM,WACZ,CAAC;AAEnD,eAAO,MAAM,+BAA+B,GAC1C,IAAI,MAAM,EACV,YAAY,MAAM,WACwD,CAAC;AAE7E,eAAO,MAAM,4BAA4B,GACvC,cAAc,MAAM,EACpB,cAAc,MAAM,WAEkL,CAAC;AAEzM,eAAO,MAAM,iBAAiB,QAGqF,CAAC;AAEpH,eAAO,MAAM,+BAA+B,GAAI,SAAS,MAAM,EAAE,WAMhD,CAAC;AAElB,eAAO,MAAM,gCAAgC,6CAA6C,CAAC;AAE3F,eAAO,MAAM,8BAA8B,GACzC,iBAAiB,MAAM,EACvB,WAAW,MAAM,WAOlB,CAAC;AAEF,eAAO,MAAM,wBAAwB,kHAAkH,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Retrieves the application's default locale from the `<GTProvider>` context.
3
- *
4
- * If no default locale is passed to the `<GTProvider>`, it defaults to providing 'en'.
5
- *
6
- * @returns {string} The application's default locale, e.g., 'en-US'.
7
- *
8
- * @example
9
- * const locale = useDefaultLocale();
10
- * console.log(locale); // 'en-US'
11
- */
12
- export default function useDefaultLocale(): string;
13
- //# sourceMappingURL=useDefaultLocale.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDefaultLocale.d.ts","sourceRoot":"","sources":["../../src/hooks/useDefaultLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,IAAI,MAAM,CAIjD"}
@@ -1,23 +0,0 @@
1
- import { LocaleProperties } from 'generaltranslation/types';
2
- /**
3
- * Returns the configured GT class instance.
4
- *
5
- * @returns {GT} The configured GT class instance.
6
- *
7
- * @example
8
- * const gt = useGTClass();
9
- * console.log(gt.getLocaleProperties('en-US'));
10
- */
11
- export declare function useGTClass(): import("generaltranslation").GT;
12
- /**
13
- * Returns the locale properties for the given locale.
14
- *
15
- * @param {string} locale - The locale to get the properties for.
16
- * @returns {LocaleProperties} The locale properties for the given locale.
17
- *
18
- * @example
19
- * const localeProperties = useLocaleProperties('en-US');
20
- * console.log(localeProperties);
21
- */
22
- export declare function useLocaleProperties(locale: string): LocaleProperties;
23
- //# sourceMappingURL=useGTClass.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGTClass.d.ts","sourceRoot":"","sources":["../../src/hooks/useGTClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;GAQG;AACH,wBAAgB,UAAU,oCAIzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAGpE"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Retrieves the user's locale from the `<GTProvider>` context.
3
- *
4
- * @returns {string} The user's locale, e.g., 'en-US'.
5
- *
6
- * @example
7
- * const locale = useLocale();
8
- * console.log(locale); // 'en-US'
9
- */
10
- export default function useLocale(): string;
11
- //# sourceMappingURL=useLocale.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,MAAM,CAI1C"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Retrieves the text direction ('ltr' or 'rtl') for the current or specified locale from the `<GTProvider>` context.
3
- *
4
- * If no locale is provided, the direction for the current user's locale is returned.
5
- *
6
- * @param {string} [locale] - Optional locale code (e.g., 'ar', 'en-US'). If omitted, uses the current locale from context.
7
- * @returns {'ltr' | 'rtl'} The text direction for the locale: 'rtl' for right-to-left languages, otherwise 'ltr'.
8
- *
9
- * @example
10
- * const dir = useLocaleDirection(); // e.g., 'ltr'
11
- * const arabicDir = useLocaleDirection('ar'); // 'rtl'
12
- */
13
- export declare function useLocaleDirection(locale?: string): 'ltr' | 'rtl';
14
- //# sourceMappingURL=useLocaleDirection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocaleDirection.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocaleDirection.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAKjE"}
@@ -1,42 +0,0 @@
1
- /**
2
- *
3
- * Gets the list of properties for using a locale selector.
4
- * Provides locale management utilities for the application.
5
- * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.
6
- * Provides locale management utilities for the application.
7
- *
8
- * @returns {Object} An object containing locale-related utilities:
9
- * @returns {string} return.locale - The currently selected locale.
10
- * @returns {string[]} return.locales - The list of all available locales.
11
- * @returns {(locale: string) => void} return.setLocale - Function to update the current locale.
12
- * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.
13
- */
14
- export default function useLocaleSelector(locales?: string[]): {
15
- locale: string;
16
- locales: string[];
17
- setLocale: (locale: string) => void;
18
- getLocaleProperties: (locale: string) => {
19
- code: string;
20
- name: string;
21
- nativeName: string;
22
- languageCode: string;
23
- languageName: string;
24
- nativeLanguageName: string;
25
- nameWithRegionCode: string;
26
- nativeNameWithRegionCode: string;
27
- regionCode: string;
28
- regionName: string;
29
- nativeRegionName: string;
30
- scriptCode: string;
31
- scriptName: string;
32
- nativeScriptName: string;
33
- maximizedCode: string;
34
- maximizedName: string;
35
- nativeMaximizedName: string;
36
- minimizedCode: string;
37
- minimizedName: string;
38
- nativeMinimizedName: string;
39
- emoji: string;
40
- };
41
- };
42
- //# sourceMappingURL=useLocaleSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocaleSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocaleSelector.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE;;;;kCAoB/C,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAYlB"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Retrieves the user's list of supported locales from the `<GTProvider>` context.
3
- *
4
- * @returns {string[]} The user's locales, e.g., ['en-US', 'fr', 'jp'].
5
- *
6
- * @example
7
- * const locales = useLocales();
8
- * console.log(locale); // ['en-US', 'fr', 'jp]
9
- */
10
- export default function useLocales(): string[];
11
- //# sourceMappingURL=useLocales.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocales.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocales.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,IAAI,MAAM,EAAE,CAI7C"}
@@ -1,20 +0,0 @@
1
- /**
2
- * A React hook that retrieves the user's currently selected region from the `<GTProvider>` context.
3
- *
4
- * Returns the `region` value as a string (e.g., `"US"`, `"CA"`) or `undefined` if no region has been set.
5
- *
6
- * @returns {string | undefined} The currently active region code, or `undefined` if not set.
7
- *
8
- * @example
9
- * ```tsx
10
- * const region = useRegion();
11
- *
12
- * if (!region) {
13
- * console.log("No region set yet");
14
- * } else {
15
- * console.log(`Current region: ${region}`);
16
- * }
17
- * ```
18
- */
19
- export default function useRegion(): string | undefined;
20
- //# sourceMappingURL=useRegion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRegion.d.ts","sourceRoot":"","sources":["../../src/hooks/useRegion.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,MAAM,GAAG,SAAS,CAItD"}