ms-types 0.3.33 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.3.33",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -12,10 +12,12 @@
12
12
  "scripts": {
13
13
  "docs:dev": "vitepress dev docs",
14
14
  "docs:build": "vitepress build docs",
15
- "docs:preview": "vitepress preview docs"
15
+ "docs:preview": "vitepress preview docs",
16
+ "deploy": "wrangler deploy"
16
17
  },
17
18
  "devDependencies": {
18
19
  "vitepress": "^1.6.4",
19
- "vitepress-theme-teek": "^1.5.4"
20
+ "vitepress-theme-teek": "^1.5.4",
21
+ "wrangler": "^4.54.0"
20
22
  }
21
23
  }
package/types/node.d.ts CHANGED
@@ -36,6 +36,9 @@ declare interface NodeBoundsInfo {
36
36
  }
37
37
 
38
38
  declare interface NodeInfo {
39
+ /**
40
+ * 节点id
41
+ */
39
42
  id: string;
40
43
  /**
41
44
  * 节点标识符
@@ -53,6 +56,10 @@ declare interface NodeInfo {
53
56
  * 节点值
54
57
  */
55
58
  value: string;
59
+ /**
60
+ * 节点占位符值
61
+ */
62
+ placeholderValue: string;
56
63
  /**
57
64
  * 节点名称
58
65
  */
@@ -65,10 +72,6 @@ declare interface NodeInfo {
65
72
  * 节点是否启用
66
73
  */
67
74
  enabled: boolean;
68
- /**
69
- * 节点是否可访问
70
- */
71
- accessible: boolean;
72
75
  /**
73
76
  * 节点位置
74
77
  */
@@ -97,6 +100,32 @@ declare interface NodeInfo {
97
100
  * 点击节点随机位置
98
101
  */
99
102
  clickRandom(): boolean;
103
+ /**
104
+ * 节点是否可接收事件 用于判断是否显示在屏幕上
105
+ */
106
+ hittable(): boolean;
107
+ /**
108
+ * 无障碍点击
109
+ */
110
+ tap(): boolean;
111
+ /**
112
+ * 无障碍双击
113
+ */
114
+ doubleTap(): boolean;
115
+ /**
116
+ * 无障碍长按
117
+ * @param duration 长按持续时间
118
+ */
119
+ press(duration: number): boolean;
120
+ /**
121
+ * 无障碍滑动
122
+ * @param direction 滑动方向
123
+ * @param velocity 滑动速度 默认为 default
124
+ */
125
+ swipe(
126
+ direction: "up" | "down" | "left" | "right",
127
+ velocity?: "default" | "fast" | "slow"
128
+ ): boolean;
100
129
  /**
101
130
  * 获取父节点
102
131
  */
@@ -159,6 +188,12 @@ declare class NodeSelector {
159
188
  * 清除所有选择条件
160
189
  */
161
190
  clearSelector(): NodeSelector;
191
+ /**
192
+ * 获取节点id
193
+ * @param id 节点id
194
+ * @returns 节点选择器
195
+ */
196
+ id(id: string): NodeSelector;
162
197
  /**
163
198
  * 获取节点xpath
164
199
  * @param path xpath路径
@@ -226,17 +261,23 @@ declare class NodeSelector {
226
261
  */
227
262
  valueMatch(match: string): NodeSelector;
228
263
  /**
229
- * 获取节点是否启用
230
- * @param enabled 是否启用
264
+ * 获取节点占位符值
265
+ * @param placeholderValue 节点占位符值
231
266
  * @returns 节点选择器
232
267
  */
233
- enabled(enabled: boolean): NodeSelector;
268
+ placeholderValue(placeholderValue: string): NodeSelector;
269
+ /**
270
+ * 获取节点占位符值匹配
271
+ * @param match 匹配字符串
272
+ * @returns 节点选择器
273
+ */
274
+ placeholderValueMatch(match: string): NodeSelector;
234
275
  /**
235
- * 获取节点是否可访问
236
- * @param accessible 是否可访问
276
+ * 获取节点是否启用
277
+ * @param enabled 是否启用
237
278
  * @returns 节点选择器
238
279
  */
239
- accessible(accessible: boolean): NodeSelector;
280
+ enabled(enabled: boolean): NodeSelector;
240
281
  /**
241
282
  * 获取节点是否可见
242
283
  * @param visible 是否可见
@@ -255,42 +296,12 @@ declare class NodeSelector {
255
296
  * @returns 节点选择器
256
297
  */
257
298
  depth(depth: number): NodeSelector;
258
- /**
259
- * 获取节点是否选中
260
- * @param selected 是否选中
261
- * @returns 节点选择器
262
- */
263
- selected(selected: boolean): NodeSelector;
264
299
  /**
265
300
  * 获取节点子节点数量
266
301
  * @param childCount 子节点数量
267
302
  * @returns 节点选择器
268
303
  */
269
304
  childCount(childCount: number | string): NodeSelector;
270
- /**
271
- * 获取节点x坐标
272
- * @param x x坐标
273
- * @returns 节点选择器
274
- */
275
- x(x: number | string): NodeSelector;
276
- /**
277
- * 获取节点y坐标
278
- * @param y y坐标
279
- * @returns 节点选择器
280
- */
281
- y(y: number | string): NodeSelector;
282
- /**
283
- * 获取节点宽度
284
- * @param width 宽度
285
- * @returns 节点选择器
286
- */
287
- width(width: number | string): NodeSelector;
288
- /**
289
- * 获取节点高度
290
- * @param height 高度
291
- * @returns 节点选择器
292
- */
293
- height(height: number | string): NodeSelector;
294
305
  /**
295
306
  * 获取节点位置
296
307
  * @param x x坐标
@@ -54,6 +54,10 @@ declare interface $节点信息 {
54
54
  * 节点值
55
55
  */
56
56
  value: 字符串;
57
+ /**
58
+ * 节点占位符值
59
+ */
60
+ placeholderValue: 字符串;
57
61
  /**
58
62
  * 节点名称
59
63
  */
@@ -66,10 +70,6 @@ declare interface $节点信息 {
66
70
  * 节点是否启用
67
71
  */
68
72
  enabled: 布尔值;
69
- /**
70
- * 节点是否可访问
71
- */
72
- accessible: 布尔值;
73
73
  /**
74
74
  * 节点位置
75
75
  */
@@ -98,6 +98,32 @@ declare interface $节点信息 {
98
98
  * 点击节点随机范围
99
99
  */
100
100
  点击随机范围(): 布尔值;
101
+ /**
102
+ * 节点是否可接收事件 用于判断是否显示在屏幕上
103
+ */
104
+ hittable(): 布尔值;
105
+ /**
106
+ * 无障碍点击
107
+ */
108
+ tap(): 布尔值;
109
+ /**
110
+ * 无障碍双击
111
+ */
112
+ doubleTap(): 布尔值;
113
+ /**
114
+ * 无障碍长按
115
+ * @param duration 长按持续时间
116
+ */
117
+ press(duration: 数字): 布尔值;
118
+ /**
119
+ * 无障碍滑动
120
+ * @param direction 滑动方向
121
+ * @param velocity 滑动速度 默认为 default
122
+ */
123
+ swipe(
124
+ direction: "up" | "down" | "left" | "right",
125
+ velocity?: "default" | "fast" | "slow"
126
+ ): 布尔值;
101
127
  /**
102
128
  * 获取父节点
103
129
  */
@@ -160,6 +186,12 @@ declare class $节点选择器 {
160
186
  * 清除所有选择条件
161
187
  */
162
188
  清除所有选择条件(): $节点选择器;
189
+ /**
190
+ * 获取节点id
191
+ * @param id 节点id
192
+ * @returns 节点选择器
193
+ */
194
+ id(id: 字符串): $节点选择器;
163
195
  /**
164
196
  * 获取节点xpath
165
197
  * @param xpath 节点xpath路径
@@ -227,17 +259,23 @@ declare class $节点选择器 {
227
259
  */
228
260
  valueMatch(match: 字符串): $节点选择器;
229
261
  /**
230
- * 获取节点是否启用
231
- * @param enabled 是否启用
262
+ * 获取节点占位符值
263
+ * @param placeholderValue 节点占位符值
232
264
  * @returns 节点选择器
233
265
  */
234
- enabled(enabled: 布尔值): $节点选择器;
266
+ placeholderValue(placeholderValue: 字符串): $节点选择器;
267
+ /**
268
+ * 获取节点占位符值匹配
269
+ * @param match 匹配字符串
270
+ * @returns 节点选择器
271
+ */
272
+ placeholderValueMatch(match: 字符串): $节点选择器;
235
273
  /**
236
- * 获取节点是否可访问
237
- * @param accessible 是否可访问
274
+ * 获取节点是否启用
275
+ * @param enabled 是否启用
238
276
  * @returns 节点选择器
239
277
  */
240
- accessible(accessible: 布尔值): $节点选择器;
278
+ enabled(enabled: 布尔值): $节点选择器;
241
279
  /**
242
280
  * 获取节点是否可见
243
281
  * @param visible 是否可见
@@ -256,42 +294,12 @@ declare class $节点选择器 {
256
294
  * @returns 节点选择器
257
295
  */
258
296
  depth(depth: 数字): $节点选择器;
259
- /**
260
- * 获取节点是否选中
261
- * @param selected 是否选中
262
- * @returns 节点选择器
263
- */
264
- selected(selected: 布尔值): $节点选择器;
265
297
  /**
266
298
  * 获取节点子节点数量
267
299
  * @param childCount 子节点数量
268
300
  * @returns 节点选择器
269
301
  */
270
302
  childCount(childCount: 数字 | 字符串): $节点选择器;
271
- /**
272
- * 获取节点x坐标
273
- * @param x x坐标
274
- * @returns 节点选择器
275
- */
276
- x(x: 数字 | 字符串): $节点选择器;
277
- /**
278
- * 获取节点y坐标
279
- * @param y y坐标
280
- * @returns 节点选择器
281
- */
282
- y(y: 数字 | 字符串): $节点选择器;
283
- /**
284
- * 获取节点宽度
285
- * @param width 宽度
286
- * @returns 节点选择器
287
- */
288
- width(width: 数字 | 字符串): $节点选择器;
289
- /**
290
- * 获取节点高度
291
- * @param height 高度
292
- * @returns 节点选择器
293
- */
294
- height(height: 数字 | 字符串): $节点选择器;
295
303
  /**
296
304
  * 获取节点位置
297
305
  * @param x x坐标