gt-i18n 0.7.6 → 0.7.7

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # gt-i18n
2
2
 
3
+ ## 0.7.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1154](https://github.com/generaltranslation/gt/pull/1154) [`10a0f2e`](https://github.com/generaltranslation/gt/commit/10a0f2ef28003c2767129ba8ba88a61f8d6c3f04) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Restore `GTFunctionType` return type to `string`
8
+
3
9
  ## 0.7.6
4
10
 
5
11
  ### Patch Changes
@@ -21,13 +21,13 @@ type InlineTranslationOptions = BaseTranslationOptions & {
21
21
  * Synchronous resolution function type
22
22
  * @param {string} message - The message to translate.
23
23
  * @param {InlineTranslationOptions} options - The options for the translation.
24
- * @returns {string | undefined} The translated message or undefined if the message is not found.
24
+ * @returns {string} The translated message.
25
25
  *
26
26
  * @important This is base type for user API
27
27
  *
28
28
  * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
29
29
  */
30
- type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
30
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
31
31
  /**
32
32
  * Type for the gt() function
33
33
  * @param {string} message - The message to translate
@@ -35,7 +35,7 @@ type SyncResolutionFunction = (message: string, options?: InlineTranslationOptio
35
35
  * @returns {string} The translated message
36
36
  * TODO: next major version, remove the "...type" suffix, it's redundant
37
37
  */
38
- type GTFunctionType = SyncResolutionFunction;
38
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
39
39
  /**
40
40
  * Type for the m() function
41
41
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
package/dist/index.d.ts CHANGED
@@ -18,17 +18,6 @@ type InlineTranslationOptions = BaseTranslationOptions & {
18
18
  $_source?: string;
19
19
  };
20
20
 
21
- /**
22
- * Synchronous resolution function type
23
- * @param {string} message - The message to translate.
24
- * @param {InlineTranslationOptions} options - The options for the translation.
25
- * @returns {string | undefined} The translated message or undefined if the message is not found.
26
- *
27
- * @important This is base type for user API
28
- *
29
- * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
30
- */
31
- type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
32
21
  /**
33
22
  * Synchronous resolution function type
34
23
  * @param {string} message - The message to translate.
@@ -47,7 +36,7 @@ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTran
47
36
  * @returns {string} The translated message
48
37
  * TODO: next major version, remove the "...type" suffix, it's redundant
49
38
  */
50
- type GTFunctionType = SyncResolutionFunction;
39
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
51
40
  /**
52
41
  * Type for the m() function
53
42
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
@@ -55,7 +55,7 @@ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTran
55
55
  * @returns {string} The translated message
56
56
  * TODO: next major version, remove the "...type" suffix, it's redundant
57
57
  */
58
- type GTFunctionType = SyncResolutionFunction;
58
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
59
59
  /**
60
60
  * Type for the m() function
61
61
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
@@ -28,7 +28,7 @@ export type SyncResolutionFunctionWithFallback = (message: string, options?: Inl
28
28
  * @returns {string} The translated message
29
29
  * TODO: next major version, remove the "...type" suffix, it's redundant
30
30
  */
31
- export type GTFunctionType = SyncResolutionFunction;
31
+ export type GTFunctionType = SyncResolutionFunctionWithFallback;
32
32
  /**
33
33
  * Type for the m() function
34
34
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
package/dist/types.d.ts CHANGED
@@ -70,7 +70,7 @@ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTran
70
70
  * @returns {string} The translated message
71
71
  * TODO: next major version, remove the "...type" suffix, it's redundant
72
72
  */
73
- type GTFunctionType = SyncResolutionFunction;
73
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
74
74
  /**
75
75
  * Type for the m() function
76
76
  * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-i18n",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "Pure JS i18n library for General Translation",
5
5
  "main": "dist/index.cjs.min.cjs",
6
6
  "module": "dist/index.esm.min.mjs",