-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.ts
78 lines (74 loc) · 1.29 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* 基类
*/
interface Base {
/** 插件包名 */
name: string
/**
* 插件类型
* - npm: npm 插件
* - git: git 插件
* - app: 单应用插件
*/
type: 'npm' | 'git' | 'app'
/** 插件描述 限制 50 长度 */
description: string
/** 插件提交到仓库时间 */
time: string
/** 插件主页 */
home: string
/** 插件许可证 */
license: {
/** 许可证名称 */
name: string
/** 许可证地址 */
url: string
}
/** 插件作者 */
author: {
/** 名字 */
name: string
/** 主页 */
home: string
}[]
/** 插件仓库 */
repo: {
/** 仓库类型 */
type: 'github' | 'gitee' | 'gitcode' | 'gitlab' | 'npm'
/** 仓库地址 */
url: string
/** 默认分支 npm类型为空字符串 */
branch: string
}[]
}
/**
* npm 插件类型
*/
interface Npm extends Base {
type: 'npm'
}
/**
* git 插件类型
*/
interface Git extends Base {
type: 'git'
}
/**
* 单应用插件类型
*/
interface App extends Base {
type: 'app'
/** app文件直链 */
files: {
/** app插件名称 */
name: string
/** 文件直链 */
url: string
/** 描述 */
description?: string
}[]
}
/**
* 插件市场类型每个插件的类型
*/
export type MarketType = Npm | Git | App