@ywfe/fe-tools 1.2.1-beta.26 → 1.2.1-beta.28

Sign up to get free protection for your applications and to get access to all the features.
package/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as request } from './request'
2
+ export { default as userInputToJson } from './userInputToJson'
2
3
  export { default as JSON2String } from './JSON2String'
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as request } from './request';
2
+ export { default as userInputToJson } from './userInputToJson';
2
3
  export { default as JSON2String } from './JSON2String';
@@ -0,0 +1,8 @@
1
+ interface userInput {
2
+ userInput?: string;
3
+ rules?: string;
4
+ }
5
+ declare function userInputToJson({ input }: {
6
+ input: userInput;
7
+ }): Promise<any>;
8
+ export default userInputToJson;
@@ -8762,6 +8762,35 @@ function request(_a) {
8762
8762
  });
8763
8763
  }
8764
8764
 
8765
+ function userInputToJson(_a) {
8766
+ return __awaiter(this, arguments, void 0, function (_b) {
8767
+ var res, result;
8768
+ var input = _b.input;
8769
+ return __generator(this, function (_c) {
8770
+ switch (_c.label) {
8771
+ case 0:
8772
+ console.log("input", input);
8773
+ return [4 /*yield*/, request({
8774
+ input: {
8775
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
8776
+ method: "GET",
8777
+ params: input,
8778
+ },
8779
+ })];
8780
+ case 1:
8781
+ res = _c.sent();
8782
+ if (res.success) {
8783
+ result = res.data;
8784
+ return [2 /*return*/, result.success ? result.data : result];
8785
+ }
8786
+ else {
8787
+ return [2 /*return*/, res.success ? res.data : res];
8788
+ }
8789
+ }
8790
+ });
8791
+ });
8792
+ }
8793
+
8765
8794
  // Ctrl-S保存代码
8766
8795
  function JSON2String(_a) {
8767
8796
  var input = _a.input;
@@ -8780,4 +8809,5 @@ function JSON2String(_a) {
8780
8809
 
8781
8810
  exports.JSON2String = JSON2String;
8782
8811
  exports.request = request;
8812
+ exports.userInputToJson = userInputToJson;
8783
8813
  //# sourceMappingURL=ywfe-tools.cjs.map