@lsby/net-core 0.3.1 → 0.3.3
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/bin/gen-list/bin.cjs +0 -9
- package/dist/bin/gen-list/index.cjs +0 -9
- package/dist/cjs/bin/gen-list/bin.cjs +0 -9
- package/dist/cjs/bin/gen-list/index.cjs +0 -9
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/interface/interface-abstract.cjs +53 -0
- package/dist/cjs/interface/interface-abstract.d.cts +23 -0
- package/dist/cjs/interface/interface.d.cts +1 -0
- package/dist/esm/bin/gen-list/bin.js +1 -1
- package/dist/esm/bin/gen-list/index.js +1 -1
- package/dist/esm/chunk-JNJOQH5L.js +17 -0
- package/dist/esm/{chunk-G3SHYW4Z.js → chunk-YYOST4AX.js} +0 -9
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +7 -3
- package/dist/esm/interface/interface-abstract.d.ts +23 -0
- package/dist/esm/interface/interface-abstract.js +7 -0
- package/dist/esm/interface/interface.d.ts +1 -0
- package/package.json +1 -1
|
@@ -70,15 +70,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
|
|
|
70
70
|
const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
|
|
71
71
|
const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
|
|
72
72
|
await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
|
|
73
|
-
for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
|
|
74
|
-
if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
|
|
75
|
-
const expression = node.expression;
|
|
76
|
-
if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
73
|
\u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
|
|
83
74
|
\u4EE3\u7801\u533A.push(`${importName}.default`);
|
|
84
75
|
}
|
|
@@ -75,15 +75,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
|
|
|
75
75
|
const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
|
|
76
76
|
const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
|
|
77
77
|
await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
|
|
78
|
-
for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
|
|
79
|
-
if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
|
|
80
|
-
const expression = node.expression;
|
|
81
|
-
if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
78
|
\u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
|
|
88
79
|
\u4EE3\u7801\u533A.push(`${importName}.default`);
|
|
89
80
|
}
|
|
@@ -70,15 +70,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
|
|
|
70
70
|
const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
|
|
71
71
|
const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
|
|
72
72
|
await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
|
|
73
|
-
for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
|
|
74
|
-
if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
|
|
75
|
-
const expression = node.expression;
|
|
76
|
-
if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
73
|
\u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
|
|
83
74
|
\u4EE3\u7801\u533A.push(`${importName}.default`);
|
|
84
75
|
}
|
|
@@ -75,15 +75,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
|
|
|
75
75
|
const outputFolderRelativeToProjectRoot = import_node_path.default.relative(import_node_path.default.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
|
|
76
76
|
const importPath = import_node_path.default.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
|
|
77
77
|
await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
|
|
78
|
-
for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
|
|
79
|
-
if (import_typescript.default.isExportAssignment(node) && node.isExportEquals === void 0) {
|
|
80
|
-
const expression = node.expression;
|
|
81
|
-
if (import_typescript.default.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
78
|
\u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
|
|
88
79
|
\u4EE3\u7801\u533A.push(`${importName}.default`);
|
|
89
80
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
\u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C: () => \u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
|
|
37
37
|
\u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C: () => \u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
|
|
38
38
|
\u63A5\u53E3: () => \u63A5\u53E3,
|
|
39
|
+
\u63A5\u53E3\u62BD\u8C61\u7C7B: () => \u63A5\u53E3\u62BD\u8C61\u7C7B,
|
|
39
40
|
\u63A5\u53E3\u7C7B\u578B: () => \u63A5\u53E3\u7C7B\u578B,
|
|
40
41
|
\u63D2\u4EF6: () => \u63D2\u4EF6,
|
|
41
42
|
\u670D\u52A1\u5668: () => \u670D\u52A1\u5668,
|
|
@@ -175,6 +176,16 @@ var \u63A5\u53E3 = class {
|
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
178
|
|
|
179
|
+
// src/interface/interface-abstract.ts
|
|
180
|
+
var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
|
|
181
|
+
constructor() {
|
|
182
|
+
super(null, null);
|
|
183
|
+
}
|
|
184
|
+
\u83B7\u5F97\u5B9E\u73B0() {
|
|
185
|
+
return this.\u8C03\u7528;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
178
189
|
// src/interface/plug.ts
|
|
179
190
|
var \u63D2\u4EF6 = class {
|
|
180
191
|
constructor(\u7C7B\u578B, \u5B9E\u73B0) {
|
|
@@ -350,6 +361,7 @@ var \u6D4B\u8BD5 = class {
|
|
|
350
361
|
\u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
|
|
351
362
|
\u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
|
|
352
363
|
\u63A5\u53E3,
|
|
364
|
+
\u63A5\u53E3\u62BD\u8C61\u7C7B,
|
|
353
365
|
\u63A5\u53E3\u7C7B\u578B,
|
|
354
366
|
\u63D2\u4EF6,
|
|
355
367
|
\u670D\u52A1\u5668,
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { 包装的接口类型, 包装的正确JSON结果, 包装的错误JSON结果 } from './extend/wrap-json.cjs';
|
|
2
2
|
export { 任意接口, 接口 } from './interface/interface.cjs';
|
|
3
3
|
export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.cjs';
|
|
4
|
+
export { 接口抽象类, 计算实现参数, 计算实现结果 } from './interface/interface-abstract.cjs';
|
|
4
5
|
export { 任意插件, 包装插件项, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.cjs';
|
|
5
6
|
export { 中文路径支持插件 } from './plugin/chinese-path.cjs';
|
|
6
7
|
export { 自定义数据插件 } from './plugin/custom-data.cjs';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/interface/interface-abstract.ts
|
|
21
|
+
var interface_abstract_exports = {};
|
|
22
|
+
__export(interface_abstract_exports, {
|
|
23
|
+
\u63A5\u53E3\u62BD\u8C61\u7C7B: () => \u63A5\u53E3\u62BD\u8C61\u7C7B
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(interface_abstract_exports);
|
|
26
|
+
|
|
27
|
+
// src/interface/interface.ts
|
|
28
|
+
var \u63A5\u53E3 = class {
|
|
29
|
+
constructor(\u63A5\u53E3\u7C7B\u578B, \u5B9E\u73B0) {
|
|
30
|
+
this.\u63A5\u53E3\u7C7B\u578B = \u63A5\u53E3\u7C7B\u578B;
|
|
31
|
+
this.\u5B9E\u73B0 = \u5B9E\u73B0;
|
|
32
|
+
}
|
|
33
|
+
\u83B7\u5F97\u7C7B\u578B() {
|
|
34
|
+
return this.\u63A5\u53E3\u7C7B\u578B;
|
|
35
|
+
}
|
|
36
|
+
\u83B7\u5F97\u5B9E\u73B0() {
|
|
37
|
+
return this.\u5B9E\u73B0;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/interface/interface-abstract.ts
|
|
42
|
+
var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(null, null);
|
|
45
|
+
}
|
|
46
|
+
\u83B7\u5F97\u5B9E\u73B0() {
|
|
47
|
+
return this.\u8C03\u7528;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
\u63A5\u53E3\u62BD\u8C61\u7C7B
|
|
53
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 正确结果 as ____, 错误结果 as ____$1 } from '../result/result.cjs';
|
|
3
|
+
import { 接口 as __ } from './interface.cjs';
|
|
4
|
+
import { 接口类型 as ____$2 } from './interface-type.cjs';
|
|
5
|
+
import { 合并插件结果 as ______ } from './plug.cjs';
|
|
6
|
+
import 'express';
|
|
7
|
+
import '@lsby/ts-fp-data';
|
|
8
|
+
|
|
9
|
+
type F1<A> = A extends ____$2<infer A1, infer _A2, infer _A3, infer _A4, infer _A5> ? A1 : never;
|
|
10
|
+
type F2<A> = A extends ____$2<infer _A1, infer A2, infer _A3, infer _A4, infer _A5> ? A2 : never;
|
|
11
|
+
type F3<A> = A extends ____$2<infer _A1, infer _A2, infer A3, infer _A4, infer _A5> ? A3 : never;
|
|
12
|
+
type F4<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer A4, infer _A5> ? A4 : never;
|
|
13
|
+
type F5<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer _A4, infer A5> ? A5 : never;
|
|
14
|
+
type 计算实现参数<接口类型定义> = ______<F3<接口类型定义>>;
|
|
15
|
+
type 计算实现结果<接口类型定义> = Promise<____<z.infer<F4<接口类型定义>>> | ____$1<z.infer<F5<接口类型定义>>>>;
|
|
16
|
+
declare abstract class 接口抽象类<接口类型描述 extends ____$2<any, any, any, any, any>> extends __<F1<接口类型描述>, F2<接口类型描述>, F3<接口类型描述>, F4<接口类型描述>, F5<接口类型描述>> {
|
|
17
|
+
constructor();
|
|
18
|
+
abstract 获得类型(): 接口类型描述;
|
|
19
|
+
获得实现(): (ctx: object) => Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
|
|
20
|
+
abstract 调用(ctx: ______<F3<接口类型描述>>): Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { 接口抽象类, type 计算实现参数, type 计算实现结果 };
|
|
@@ -8,6 +8,7 @@ import '@lsby/ts-fp-data';
|
|
|
8
8
|
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
9
9
|
private 接口类型;
|
|
10
10
|
private 实现;
|
|
11
|
+
protected readonly __类型保持符号?: [路径, 方法, 插件们, 正确返回类型, 错误返回类型];
|
|
11
12
|
constructor(接口类型: ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>);
|
|
12
13
|
获得类型(): ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>;
|
|
13
14
|
获得实现(): (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
接口
|
|
3
|
+
} from "./chunk-KRIDSMPV.js";
|
|
4
|
+
|
|
5
|
+
// src/interface/interface-abstract.ts
|
|
6
|
+
var \u63A5\u53E3\u62BD\u8C61\u7C7B = class extends \u63A5\u53E3 {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(null, null);
|
|
9
|
+
}
|
|
10
|
+
\u83B7\u5F97\u5B9E\u73B0() {
|
|
11
|
+
return this.\u8C03\u7528;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
接口抽象类
|
|
17
|
+
};
|
|
@@ -41,15 +41,6 @@ async function main(tsconfigPath, interfaceFolderPath, outFilePath) {
|
|
|
41
41
|
const outputFolderRelativeToProjectRoot = path.relative(path.dirname(outFilePath), \u9879\u76EE\u6839\u8DEF\u5F84).replaceAll("\\", "/");
|
|
42
42
|
const importPath = path.join(outputFolderRelativeToProjectRoot, filenameRelativeToProjectRoot).replaceAll("\\", "/");
|
|
43
43
|
await log.info(`\u5904\u7406\uFF08${i + 1} / ${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6\u4EEC.length}\uFF09\uFF1A${filenameRelativeToApiFolder}`);
|
|
44
|
-
for (const node of \u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.statements) {
|
|
45
|
-
if (ts.isExportAssignment(node) && node.isExportEquals === void 0) {
|
|
46
|
-
const expression = node.expression;
|
|
47
|
-
if (ts.isNewExpression(expression) && expression.expression.getText() === "\u63A5\u53E3") {
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
throw new Error(`${\u63A5\u53E3\u5B9E\u73B0\u6587\u4EF6.fileName}\uFF1A\u9ED8\u8BA4\u5BFC\u51FA\u4E0D\u662F \u63A5\u53E3`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
44
|
\u5F15\u5165\u533A.push(`import * as ${importName} from '${importPath}'`);
|
|
54
45
|
\u4EE3\u7801\u533A.push(`${importName}.default`);
|
|
55
46
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { 包装的接口类型, 包装的正确JSON结果, 包装的错误JSON结果 } from './extend/wrap-json.js';
|
|
2
2
|
export { 任意接口, 接口 } from './interface/interface.js';
|
|
3
3
|
export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.js';
|
|
4
|
+
export { 接口抽象类, 计算实现参数, 计算实现结果 } from './interface/interface-abstract.js';
|
|
4
5
|
export { 任意插件, 包装插件项, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.js';
|
|
5
6
|
export { 中文路径支持插件 } from './plugin/chinese-path.js';
|
|
6
7
|
export { 自定义数据插件 } from './plugin/custom-data.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
自定义数据插件
|
|
3
|
+
} from "./chunk-P6PGPAMW.js";
|
|
1
4
|
import {
|
|
2
5
|
JSON解析插件
|
|
3
6
|
} from "./chunk-VJ4ORZR3.js";
|
|
@@ -24,6 +27,9 @@ import {
|
|
|
24
27
|
错误结果
|
|
25
28
|
} from "./chunk-IPDMEQ3O.js";
|
|
26
29
|
import "./chunk-AHCV3LQ7.js";
|
|
30
|
+
import {
|
|
31
|
+
接口抽象类
|
|
32
|
+
} from "./chunk-JNJOQH5L.js";
|
|
27
33
|
import {
|
|
28
34
|
接口类型
|
|
29
35
|
} from "./chunk-SF5Z34AP.js";
|
|
@@ -33,9 +39,6 @@ import {
|
|
|
33
39
|
import {
|
|
34
40
|
中文路径支持插件
|
|
35
41
|
} from "./chunk-XG4VZZOX.js";
|
|
36
|
-
import {
|
|
37
|
-
自定义数据插件
|
|
38
|
-
} from "./chunk-P6PGPAMW.js";
|
|
39
42
|
import {
|
|
40
43
|
插件
|
|
41
44
|
} from "./chunk-KSZE2DTR.js";
|
|
@@ -46,6 +49,7 @@ export {
|
|
|
46
49
|
\u5305\u88C5\u7684\u6B63\u786EJSON\u7ED3\u679C,
|
|
47
50
|
\u5305\u88C5\u7684\u9519\u8BEFJSON\u7ED3\u679C,
|
|
48
51
|
\u63A5\u53E3,
|
|
52
|
+
\u63A5\u53E3\u62BD\u8C61\u7C7B,
|
|
49
53
|
\u63A5\u53E3\u7C7B\u578B,
|
|
50
54
|
\u63D2\u4EF6,
|
|
51
55
|
\u670D\u52A1\u5668,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 正确结果 as ____, 错误结果 as ____$1 } from '../result/result.js';
|
|
3
|
+
import { 接口 as __ } from './interface.js';
|
|
4
|
+
import { 接口类型 as ____$2 } from './interface-type.js';
|
|
5
|
+
import { 合并插件结果 as ______ } from './plug.js';
|
|
6
|
+
import 'express';
|
|
7
|
+
import '@lsby/ts-fp-data';
|
|
8
|
+
|
|
9
|
+
type F1<A> = A extends ____$2<infer A1, infer _A2, infer _A3, infer _A4, infer _A5> ? A1 : never;
|
|
10
|
+
type F2<A> = A extends ____$2<infer _A1, infer A2, infer _A3, infer _A4, infer _A5> ? A2 : never;
|
|
11
|
+
type F3<A> = A extends ____$2<infer _A1, infer _A2, infer A3, infer _A4, infer _A5> ? A3 : never;
|
|
12
|
+
type F4<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer A4, infer _A5> ? A4 : never;
|
|
13
|
+
type F5<A> = A extends ____$2<infer _A1, infer _A2, infer _A3, infer _A4, infer A5> ? A5 : never;
|
|
14
|
+
type 计算实现参数<接口类型定义> = ______<F3<接口类型定义>>;
|
|
15
|
+
type 计算实现结果<接口类型定义> = Promise<____<z.infer<F4<接口类型定义>>> | ____$1<z.infer<F5<接口类型定义>>>>;
|
|
16
|
+
declare abstract class 接口抽象类<接口类型描述 extends ____$2<any, any, any, any, any>> extends __<F1<接口类型描述>, F2<接口类型描述>, F3<接口类型描述>, F4<接口类型描述>, F5<接口类型描述>> {
|
|
17
|
+
constructor();
|
|
18
|
+
abstract 获得类型(): 接口类型描述;
|
|
19
|
+
获得实现(): (ctx: object) => Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
|
|
20
|
+
abstract 调用(ctx: ______<F3<接口类型描述>>): Promise<____<z.infer<F4<接口类型描述>>> | ____$1<z.infer<F5<接口类型描述>>>>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { 接口抽象类, type 计算实现参数, type 计算实现结果 };
|
|
@@ -8,6 +8,7 @@ import '@lsby/ts-fp-data';
|
|
|
8
8
|
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
9
9
|
private 接口类型;
|
|
10
10
|
private 实现;
|
|
11
|
+
protected readonly __类型保持符号?: [路径, 方法, 插件们, 正确返回类型, 错误返回类型];
|
|
11
12
|
constructor(接口类型: ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>);
|
|
12
13
|
获得类型(): ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>;
|
|
13
14
|
获得实现(): (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>;
|