assistsx-js 0.0.2019 → 0.0.2021

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.
@@ -64,7 +64,7 @@ export declare class AccessibilityEventFilter {
64
64
  /**
65
65
  * 事件类型过滤
66
66
  */
67
- readonly eventTypes: number[] | null;
67
+ readonly eventTypes?: number[] | null;
68
68
  /**
69
69
  * 是否启用事件去重
70
70
  */
@@ -4,13 +4,13 @@
4
4
  */
5
5
  export class AccessibilityEventFilter {
6
6
  constructor(config = {}) {
7
- var _a, _b, _c, _d, _e, _f;
7
+ var _a, _b, _c, _d, _e;
8
8
  this.packageName = (_a = config.packageName) !== null && _a !== void 0 ? _a : null;
9
9
  this.processInBackground = (_b = config.processInBackground) !== null && _b !== void 0 ? _b : true;
10
10
  this.fetchNodeInfo = (_c = config.fetchNodeInfo) !== null && _c !== void 0 ? _c : true;
11
11
  this.enableLogging = (_d = config.enableLogging) !== null && _d !== void 0 ? _d : false;
12
- this.eventTypes = (_e = config.eventTypes) !== null && _e !== void 0 ? _e : null;
13
- this.enableDeduplication = (_f = config.enableDeduplication) !== null && _f !== void 0 ? _f : false;
12
+ this.eventTypes = config.eventTypes;
13
+ this.enableDeduplication = (_e = config.enableDeduplication) !== null && _e !== void 0 ? _e : false;
14
14
  }
15
15
  /**
16
16
  * 检查是否应该处理指定包的事件
@@ -26,7 +26,9 @@ export class AccessibilityEventFilter {
26
26
  * @returns true表示应该处理,false表示应该过滤
27
27
  */
28
28
  shouldProcessEventType(eventType) {
29
- return this.eventTypes === null || this.eventTypes.includes(eventType);
29
+ var _a, _b;
30
+ return (this.eventTypes === null ||
31
+ ((_b = (_a = this.eventTypes) === null || _a === void 0 ? void 0 : _a.includes(eventType)) !== null && _b !== void 0 ? _b : false));
30
32
  }
31
33
  /**
32
34
  * 创建默认的过滤配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2019",
3
+ "version": "0.0.2021",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -74,7 +74,7 @@ export class AccessibilityEventFilter {
74
74
  /**
75
75
  * 事件类型过滤
76
76
  */
77
- public readonly eventTypes: number[] | null;
77
+ public readonly eventTypes?: number[] | null;
78
78
 
79
79
  /**
80
80
  * 是否启用事件去重
@@ -86,7 +86,7 @@ export class AccessibilityEventFilter {
86
86
  this.processInBackground = config.processInBackground ?? true;
87
87
  this.fetchNodeInfo = config.fetchNodeInfo ?? true;
88
88
  this.enableLogging = config.enableLogging ?? false;
89
- this.eventTypes = config.eventTypes ?? null;
89
+ this.eventTypes = config.eventTypes;
90
90
  this.enableDeduplication = config.enableDeduplication ?? false;
91
91
  }
92
92
 
@@ -105,7 +105,10 @@ export class AccessibilityEventFilter {
105
105
  * @returns true表示应该处理,false表示应该过滤
106
106
  */
107
107
  public shouldProcessEventType(eventType: number): boolean {
108
- return this.eventTypes === null || this.eventTypes.includes(eventType);
108
+ return (
109
+ this.eventTypes === null ||
110
+ (this.eventTypes?.includes(eventType) ?? false)
111
+ );
109
112
  }
110
113
 
111
114
  /**