Skip to content

Commit ac9e8f1

Browse files
committed
优化:类型定义
1 parent e8b7667 commit ac9e8f1

1 file changed

Lines changed: 13 additions & 23 deletions

File tree

sdk/config.schema.json

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
"items": {
106106
"anyOf": [
107107
{
108-
"type": "string"
108+
"type": "string",
109+
"description": "简单字符串匹配"
109110
},
110111
{
111112
"type": "object",
@@ -131,6 +132,7 @@
131132
"description": "匹配名称"
132133
}
133134
},
135+
"additionalProperties": false,
134136
"oneOf": [
135137
{
136138
"if": {
@@ -141,10 +143,10 @@
141143
}
142144
},
143145
"then": {
146+
"required": [
147+
"text"
148+
],
144149
"properties": {
145-
"type": {
146-
"const": "text"
147-
},
148150
"text": {
149151
"type": "string",
150152
"description": "匹配文本"
@@ -172,10 +174,10 @@
172174
}
173175
},
174176
"then": {
177+
"required": [
178+
"key"
179+
],
175180
"properties": {
176-
"type": {
177-
"const": "key"
178-
},
179181
"key": {
180182
"type": "string",
181183
"description": "匹配键值"
@@ -192,10 +194,10 @@
192194
}
193195
},
194196
"then": {
197+
"required": [
198+
"regex"
199+
],
195200
"properties": {
196-
"type": {
197-
"const": "regex"
198-
},
199201
"regex": {
200202
"type": "string",
201203
"description": "匹配正则"
@@ -228,9 +230,6 @@
228230
},
229231
"then": {
230232
"properties": {
231-
"type": {
232-
"const": "file"
233-
},
234233
"title": {
235234
"type": "string",
236235
"description": "匹配标题"
@@ -274,9 +273,6 @@
274273
},
275274
"then": {
276275
"properties": {
277-
"type": {
278-
"const": "image"
279-
},
280276
"title": {
281277
"type": "string",
282278
"description": "匹配标题"
@@ -294,9 +290,6 @@
294290
},
295291
"then": {
296292
"properties": {
297-
"type": {
298-
"const": "window"
299-
},
300293
"title": {
301294
"type": "string",
302295
"description": "匹配标题"
@@ -318,9 +311,6 @@
318311
},
319312
"then": {
320313
"properties": {
321-
"type": {
322-
"const": "editor"
323-
},
324314
"extensions": {
325315
"type": "array",
326316
"description": "文件扩展名",
@@ -428,7 +418,7 @@
428418
"description": "窗口宽度,支持 数字 或 百分比,设置后窗口大小将默认为分离模式"
429419
},
430420
"heightFastPanel": {
431-
"type": "string",
421+
"type": "integer",
432422
"description": "快速面板高度,单位为像素,默认为 100"
433423
},
434424
"singleton": {

0 commit comments

Comments
 (0)