generaltranslation 2.0.2 → 2.0.4

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/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ declare class GT {
36
36
  *
37
37
  * @returns {Promise<any>} - A promise that resolves to the translated content.
38
38
  */
39
- translateReactChildren({ content, targetLanguage, ...metadata }: {
39
+ translateReactChildren({ content, targetLanguage, metadata }: {
40
40
  content: any;
41
41
  targetLanguage: string;
42
42
  metadata: {
package/dist/index.js CHANGED
@@ -10,17 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  step((generator = generator.apply(thisArg, _arguments || [])).next());
11
11
  });
12
12
  };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
@@ -70,9 +59,8 @@ class GT {
70
59
  * @returns {Promise<any>} - A promise that resolves to the translated content.
71
60
  */
72
61
  translateReactChildren(_a) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- var { content, targetLanguage } = _a, metadata = __rest(_a, ["content", "targetLanguage"]);
75
- return yield _translateReactChildren_1.default.call(this, content, targetLanguage, metadata);
62
+ return __awaiter(this, arguments, void 0, function* ({ content, targetLanguage, metadata }) {
63
+ return yield _translateReactChildren_1.default.call(this, content, targetLanguage, Object.assign({ projectID: this.projectID, defaultLanguage: this.defaultLanguage }, metadata));
76
64
  });
77
65
  }
78
66
  }
@@ -6,7 +6,7 @@
6
6
  * @param {string} targetLanguage - The target language code (e.g., 'en', 'fr') for the translation.
7
7
  * @param {Object} metadata - Additional metadata to be sent with the translation request.
8
8
  *
9
- * @returns {Promise<Object | null>} - A promise that resolves to the translated content as an object, or null if an error occurs.
9
+ * @returns {Promise<JSON | null>} - A promise that resolves to the translated content as an object, or null if an error occurs.
10
10
  *
11
11
  * @throws {Error} - Throws an error if the response from the API is not ok (status code not in the range 200-299).
12
12
  *
@@ -16,4 +16,4 @@ export default function _translateReactChildren(this: {
16
16
  apiKey: string;
17
17
  }, content: any, targetLanguage: string, metadata: {
18
18
  [key: string]: any;
19
- }): Promise<Object | null>;
19
+ }): Promise<JSON | null>;
@@ -18,7 +18,7 @@ exports.default = _translateReactChildren;
18
18
  * @param {string} targetLanguage - The target language code (e.g., 'en', 'fr') for the translation.
19
19
  * @param {Object} metadata - Additional metadata to be sent with the translation request.
20
20
  *
21
- * @returns {Promise<Object | null>} - A promise that resolves to the translated content as an object, or null if an error occurs.
21
+ * @returns {Promise<JSON | null>} - A promise that resolves to the translated content as an object, or null if an error occurs.
22
22
  *
23
23
  * @throws {Error} - Throws an error if the response from the API is not ok (status code not in the range 200-299).
24
24
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "A language toolkit for AI developers",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {