diff --git a/src/index.ts b/src/index.ts index e69de29..10980bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -0,0 +1 @@ +id('res').bounds(0, 0, 100, 100).visibleToUser() \ No newline at end of file diff --git a/types/widget-operation.d.ts b/types/widget-operation.d.ts index 6ef46e2..95fbad8 100644 --- a/types/widget-operation.d.ts +++ b/types/widget-operation.d.ts @@ -397,6 +397,12 @@ declare module 'widget-operation' { */ idMatches(reg: RegExp | string): this; + /** + * @description: 返回控件,仅选择当前界面可见的控件,如果不可见直接过滤掉(例如抖音,快手出现多视频折叠的情况) + * @return {this} 返回选择器自身以便链式调用。 + */ + visibleToUser(): Rect; + /** * @description: 为当前选择器附加控件 `className` 等于字符串 `str` 的筛选条件。控件的 `className` (类名)表示一个控件的类别,例如文本控件的类名为 `android.widget.TextView` 。如果一个控件的类名以 `android.widget.` 开头,则可以省略这部分,例如文本控件可以直接用 `className('TextView')` 的选择器。 * @param {string} str 控件 `className` 属性。