@domain.js/main 0.3.0 → 0.3.1
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/types/index.d.ts +21 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
+
/** 将 readonly string[] 转换成联合类型 */
|
|
1
2
|
export declare type ReadonlyArray2union<T extends ReadonlyArray<any>> = T extends ReadonlyArray<infer A> ? A : never;
|
|
3
|
+
/** 接口参数 schema 定义的类型 */
|
|
4
|
+
export interface ParamsSchema<Params extends {}, Keys extends string | number | symbol = keyof Params> {
|
|
5
|
+
/** 接口整体描述信息 */
|
|
6
|
+
description: string;
|
|
7
|
+
/** 固定为 object params 必然是一个对象, 可以是一个空对象 */
|
|
8
|
+
type: "object";
|
|
9
|
+
/** 必填选项 */
|
|
10
|
+
required?: (keyof Params)[];
|
|
11
|
+
/** 多选1的设定 */
|
|
12
|
+
oneOf?: any[];
|
|
13
|
+
/** 是否允许添加额外的属性 */
|
|
14
|
+
additionalProperties?: boolean;
|
|
15
|
+
/** params 参数每一个属性的描述 */
|
|
16
|
+
properties: Record<Keys, Record<string, any> & {
|
|
17
|
+
/** 当前参数的描述信息 */
|
|
18
|
+
description: string;
|
|
19
|
+
/** 当前参数的类型 */
|
|
20
|
+
type: "string" | "number" | "integer" | "object" | "array";
|
|
21
|
+
}>;
|
|
22
|
+
}
|