generaltranslation 6.3.0 → 6.3.2-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.
@@ -17,6 +17,30 @@ declare function isAcceptedPluralForm(form: string): form is PluralType;
17
17
  */
18
18
  declare function _getPluralForm(n: number, forms?: PluralType[], locales?: string[]): PluralType | '';
19
19
 
20
+ type LocaleProperties = {
21
+ code: string;
22
+ name: string;
23
+ nativeName: string;
24
+ languageCode: string;
25
+ languageName: string;
26
+ nativeLanguageName: string;
27
+ nameWithRegionCode: string;
28
+ nativeNameWithRegionCode: string;
29
+ regionCode: string;
30
+ regionName: string;
31
+ nativeRegionName: string;
32
+ scriptCode: string;
33
+ scriptName: string;
34
+ nativeScriptName: string;
35
+ maximizedCode: string;
36
+ maximizedName: string;
37
+ nativeMaximizedName: string;
38
+ minimizedCode: string;
39
+ minimizedName: string;
40
+ nativeMinimizedName: string;
41
+ emoji: string;
42
+ };
43
+
20
44
  type Variable = {
21
45
  variable?: string;
22
46
  id?: string | number;
@@ -38,4 +62,4 @@ type JsxChild = string | JsxElement | Variable;
38
62
  type JsxChildren = JsxChild | JsxChild[];
39
63
 
40
64
  export { defaultBaseUrl, defaultCacheUrl, defaultRuntimeApiUrl, _getPluralForm as getPluralForm, isAcceptedPluralForm, libraryDefaultLocale, pluralForms };
41
- export type { Content, JsxChild, JsxChildren, JsxElement };
65
+ export type { Content, JsxChild, JsxChildren, JsxElement, LocaleProperties };
@@ -1,3 +1,4 @@
1
1
  import { LocaleProperties } from './getLocaleProperties';
2
- export type CustomMapping = Record<string, string | LocaleProperties>;
2
+ export type FullCustomMapping = Record<string, LocaleProperties>;
3
+ export type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
3
4
  export declare const getCustomProperty: (customMapping: CustomMapping, locale: string, property: keyof LocaleProperties) => string | undefined;
package/dist/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { LocaleProperties } from './locales/getLocaleProperties';
2
+ export { LocaleProperties };
1
3
  export type Variable = {
2
4
  variable?: string;
3
5
  id?: string | number;
@@ -84,3 +86,4 @@ export type TranslationError = {
84
86
  key: string;
85
87
  };
86
88
  };
89
+ export type { CustomMapping } from './locales/customLocaleMapping';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "6.3.0",
3
+ "version": "6.3.2-alpha.0",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "dist/index.cjs.min.cjs",
6
6
  "module": "dist/index.esm.min.mjs",
@@ -74,6 +74,11 @@
74
74
  "types": "./dist/internal.d.ts",
75
75
  "require": "./dist/internal.cjs.min.cjs",
76
76
  "import": "./dist/internal.esm.min.mjs"
77
+ },
78
+ "./types": {
79
+ "types": "./dist/types.d.ts",
80
+ "require": "./dist/types.cjs.min.cjs",
81
+ "import": "./dist/types.esm.min.mjs"
77
82
  }
78
83
  },
79
84
  "typesVersions": {
@@ -83,6 +88,9 @@
83
88
  ],
84
89
  "id": [
85
90
  "./dist/id.d.ts"
91
+ ],
92
+ "types": [
93
+ "./dist/types.d.ts"
86
94
  ]
87
95
  }
88
96
  },
@@ -94,6 +102,9 @@
94
102
  ],
95
103
  "generaltranslation/id": [
96
104
  "/dist/id"
105
+ ],
106
+ "generaltranslation/types": [
107
+ "/dist/types"
97
108
  ]
98
109
  }
99
110
  }