ms-types 0.4.0 → 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.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/node.d.ts CHANGED
@@ -56,6 +56,10 @@ declare interface NodeInfo {
56
56
  * 节点值
57
57
  */
58
58
  value: string;
59
+ /**
60
+ * 节点占位符值
61
+ */
62
+ placeholderValue: string;
59
63
  /**
60
64
  * 节点名称
61
65
  */
@@ -96,6 +100,32 @@ declare interface NodeInfo {
96
100
  * 点击节点随机位置
97
101
  */
98
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;
99
129
  /**
100
130
  * 获取父节点
101
131
  */
@@ -158,6 +188,12 @@ declare class NodeSelector {
158
188
  * 清除所有选择条件
159
189
  */
160
190
  clearSelector(): NodeSelector;
191
+ /**
192
+ * 获取节点id
193
+ * @param id 节点id
194
+ * @returns 节点选择器
195
+ */
196
+ id(id: string): NodeSelector;
161
197
  /**
162
198
  * 获取节点xpath
163
199
  * @param path xpath路径
@@ -224,6 +260,18 @@ declare class NodeSelector {
224
260
  * @returns 节点选择器
225
261
  */
226
262
  valueMatch(match: string): NodeSelector;
263
+ /**
264
+ * 获取节点占位符值
265
+ * @param placeholderValue 节点占位符值
266
+ * @returns 节点选择器
267
+ */
268
+ placeholderValue(placeholderValue: string): NodeSelector;
269
+ /**
270
+ * 获取节点占位符值匹配
271
+ * @param match 匹配字符串
272
+ * @returns 节点选择器
273
+ */
274
+ placeholderValueMatch(match: string): NodeSelector;
227
275
  /**
228
276
  * 获取节点是否启用
229
277
  * @param enabled 是否启用
@@ -254,30 +302,6 @@ declare class NodeSelector {
254
302
  * @returns 节点选择器
255
303
  */
256
304
  childCount(childCount: number | string): NodeSelector;
257
- /**
258
- * 获取节点x坐标
259
- * @param x x坐标
260
- * @returns 节点选择器
261
- */
262
- x(x: number | string): NodeSelector;
263
- /**
264
- * 获取节点y坐标
265
- * @param y y坐标
266
- * @returns 节点选择器
267
- */
268
- y(y: number | string): NodeSelector;
269
- /**
270
- * 获取节点宽度
271
- * @param width 宽度
272
- * @returns 节点选择器
273
- */
274
- width(width: number | string): NodeSelector;
275
- /**
276
- * 获取节点高度
277
- * @param height 高度
278
- * @returns 节点选择器
279
- */
280
- height(height: number | string): NodeSelector;
281
305
  /**
282
306
  * 获取节点位置
283
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
  */
@@ -94,6 +98,32 @@ declare interface $节点信息 {
94
98
  * 点击节点随机范围
95
99
  */
96
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
+ ): 布尔值;
97
127
  /**
98
128
  * 获取父节点
99
129
  */
@@ -156,6 +186,12 @@ declare class $节点选择器 {
156
186
  * 清除所有选择条件
157
187
  */
158
188
  清除所有选择条件(): $节点选择器;
189
+ /**
190
+ * 获取节点id
191
+ * @param id 节点id
192
+ * @returns 节点选择器
193
+ */
194
+ id(id: 字符串): $节点选择器;
159
195
  /**
160
196
  * 获取节点xpath
161
197
  * @param xpath 节点xpath路径
@@ -222,6 +258,18 @@ declare class $节点选择器 {
222
258
  * @returns 节点选择器
223
259
  */
224
260
  valueMatch(match: 字符串): $节点选择器;
261
+ /**
262
+ * 获取节点占位符值
263
+ * @param placeholderValue 节点占位符值
264
+ * @returns 节点选择器
265
+ */
266
+ placeholderValue(placeholderValue: 字符串): $节点选择器;
267
+ /**
268
+ * 获取节点占位符值匹配
269
+ * @param match 匹配字符串
270
+ * @returns 节点选择器
271
+ */
272
+ placeholderValueMatch(match: 字符串): $节点选择器;
225
273
  /**
226
274
  * 获取节点是否启用
227
275
  * @param enabled 是否启用
@@ -252,30 +300,6 @@ declare class $节点选择器 {
252
300
  * @returns 节点选择器
253
301
  */
254
302
  childCount(childCount: 数字 | 字符串): $节点选择器;
255
- /**
256
- * 获取节点x坐标
257
- * @param x x坐标
258
- * @returns 节点选择器
259
- */
260
- x(x: 数字 | 字符串): $节点选择器;
261
- /**
262
- * 获取节点y坐标
263
- * @param y y坐标
264
- * @returns 节点选择器
265
- */
266
- y(y: 数字 | 字符串): $节点选择器;
267
- /**
268
- * 获取节点宽度
269
- * @param width 宽度
270
- * @returns 节点选择器
271
- */
272
- width(width: 数字 | 字符串): $节点选择器;
273
- /**
274
- * 获取节点高度
275
- * @param height 高度
276
- * @returns 节点选择器
277
- */
278
- height(height: 数字 | 字符串): $节点选择器;
279
303
  /**
280
304
  * 获取节点位置
281
305
  * @param x x坐标