assistsx-js 0.0.2018 → 0.0.2020
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.
|
@@ -32,7 +32,7 @@ export interface AccessibilityEventFilterConfig {
|
|
|
32
32
|
* 如果为空,则处理所有类型的事件
|
|
33
33
|
* 如果指定类型,则只处理指定类型的事件
|
|
34
34
|
*/
|
|
35
|
-
eventTypes?: number
|
|
35
|
+
eventTypes?: Set<number> | null;
|
|
36
36
|
/**
|
|
37
37
|
* 是否启用事件去重
|
|
38
38
|
* true: 启用去重,避免重复处理相同事件
|
|
@@ -64,7 +64,7 @@ export declare class AccessibilityEventFilter {
|
|
|
64
64
|
/**
|
|
65
65
|
* 事件类型过滤
|
|
66
66
|
*/
|
|
67
|
-
readonly eventTypes: number
|
|
67
|
+
readonly eventTypes: Set<number> | null;
|
|
68
68
|
/**
|
|
69
69
|
* 是否启用事件去重
|
|
70
70
|
*/
|
|
@@ -26,7 +26,7 @@ export class AccessibilityEventFilter {
|
|
|
26
26
|
* @returns true表示应该处理,false表示应该过滤
|
|
27
27
|
*/
|
|
28
28
|
shouldProcessEventType(eventType) {
|
|
29
|
-
return this.eventTypes === null || this.eventTypes.
|
|
29
|
+
return this.eventTypes === null || this.eventTypes.has(eventType);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* 创建默认的过滤配置
|
package/dist/AssistsX.js
CHANGED
|
@@ -568,13 +568,13 @@ export class AssistsX {
|
|
|
568
568
|
}
|
|
569
569
|
static async setAccessibilityEventFilters(value) {
|
|
570
570
|
const response = this.call(CallMethod.setAccessibilityEventFilters, {
|
|
571
|
-
args: value,
|
|
571
|
+
args: { value },
|
|
572
572
|
});
|
|
573
573
|
return response.getDataOrDefault({});
|
|
574
574
|
}
|
|
575
575
|
static async addAccessibilityEventFilter(value) {
|
|
576
576
|
const response = this.call(CallMethod.addAccessibilityEventFilter, {
|
|
577
|
-
args: value,
|
|
577
|
+
args: { value },
|
|
578
578
|
});
|
|
579
579
|
return response.getDataOrDefault({});
|
|
580
580
|
}
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ export interface AccessibilityEventFilterConfig {
|
|
|
36
36
|
* 如果为空,则处理所有类型的事件
|
|
37
37
|
* 如果指定类型,则只处理指定类型的事件
|
|
38
38
|
*/
|
|
39
|
-
eventTypes?: number
|
|
39
|
+
eventTypes?: Set<number> | null;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* 是否启用事件去重
|
|
@@ -74,7 +74,7 @@ export class AccessibilityEventFilter {
|
|
|
74
74
|
/**
|
|
75
75
|
* 事件类型过滤
|
|
76
76
|
*/
|
|
77
|
-
public readonly eventTypes: number
|
|
77
|
+
public readonly eventTypes: Set<number> | null;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* 是否启用事件去重
|
|
@@ -105,7 +105,7 @@ export class AccessibilityEventFilter {
|
|
|
105
105
|
* @returns true表示应该处理,false表示应该过滤
|
|
106
106
|
*/
|
|
107
107
|
public shouldProcessEventType(eventType: number): boolean {
|
|
108
|
-
return this.eventTypes === null || this.eventTypes.
|
|
108
|
+
return this.eventTypes === null || this.eventTypes.has(eventType);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
package/src/AssistsX.ts
CHANGED
|
@@ -803,7 +803,7 @@ export class AssistsX {
|
|
|
803
803
|
value: AccessibilityEventFilter[]
|
|
804
804
|
): Promise<any> {
|
|
805
805
|
const response = this.call(CallMethod.setAccessibilityEventFilters, {
|
|
806
|
-
args: value,
|
|
806
|
+
args: { value },
|
|
807
807
|
});
|
|
808
808
|
return response.getDataOrDefault({});
|
|
809
809
|
}
|
|
@@ -811,7 +811,7 @@ export class AssistsX {
|
|
|
811
811
|
value: AccessibilityEventFilter
|
|
812
812
|
): Promise<any> {
|
|
813
813
|
const response = this.call(CallMethod.addAccessibilityEventFilter, {
|
|
814
|
-
args: value,
|
|
814
|
+
args: { value },
|
|
815
815
|
});
|
|
816
816
|
return response.getDataOrDefault({});
|
|
817
817
|
}
|