From cc657faffd00d6d68a9652db62aeca9aadeda887 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Fri, 1 Feb 2019 13:30:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20`images.fromBase64`=20?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://hyb1996.github.io/AutoJs-Docs/#/images?id=imagesfrombase64base64 如果base64无法解码时会返回null。 --- types/modules/images.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/modules/images.d.ts b/types/modules/images.d.ts index 52c6bdd..bab1cad 100644 --- a/types/modules/images.d.ts +++ b/types/modules/images.d.ts @@ -34,6 +34,6 @@ declare namespace images { function findImageInRegion(image: Image, template: Image, x: number, y: number, width?: number, height?: number, threshold?: number): Point; function findMultiColors(image: Image, firstColor: number | string, colors: [number, number, number | string][], options?: FindColorOptions): Point; - function fromBase64(base64: string): Image; + function fromBase64(base64: string): Image | null; function toBase64(img: Image): string; } From d78e7609bdaaeb77fbe690c9a44919c492223d3f Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Fri, 1 Feb 2019 14:46:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20`images`=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/modules/images.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/modules/images.d.ts b/types/modules/images.d.ts index bab1cad..aba153e 100644 --- a/types/modules/images.d.ts +++ b/types/modules/images.d.ts @@ -21,18 +21,18 @@ declare namespace images { threshold?: number; } function clip(image: Image, x: number, y: number, w: number, h: number): Image; - function findColor(image: Image, color: number | string, options: FindColorOptions): Point; - function findColorInRegion(image: Image, color: number | string, x: number, y: number, width?: number, height?: number, threshold?: number): Point; - function findColorEquals(image: Image, color: number | string, x?: number, y?: number, width?: number, height?: number): Point; - function detectsColor(image: Image, color: number | string, x: number, y: number, threshold?: number, algorithm?: 'diff'): Point; + function findColor(image: Image, color: number | string, options: FindColorOptions): Point | null; + function findColorInRegion(image: Image, color: number | string, x: number, y: number, width?: number, height?: number, threshold?: number): Point | null; + function findColorEquals(image: Image, color: number | string, x?: number, y?: number, width?: number, height?: number): Point | null; + function detectsColor(image: Image, color: number | string, x: number, y: number, threshold?: number, algorithm?: 'diff'): Boolean; interface FindImageOptions { region?: [number, number] | [number, number, number, number]; threshold?: number; level?: number; } - function findImage(image: Image, template: Image, options: FindImageOptions): Point; - function findImageInRegion(image: Image, template: Image, x: number, y: number, width?: number, height?: number, threshold?: number): Point; - function findMultiColors(image: Image, firstColor: number | string, colors: [number, number, number | string][], options?: FindColorOptions): Point; + function findImage(image: Image, template: Image, options: FindImageOptions): Point | null; + function findImageInRegion(image: Image, template: Image, x: number, y: number, width?: number, height?: number, threshold?: number): Point | null; + function findMultiColors(image: Image, firstColor: number | string, colors: [number, number, number | string][], options?: FindColorOptions): Point | null; function fromBase64(base64: string): Image | null; function toBase64(img: Image): string; From 02ff76fc2ea6b79b6d412ab7ce620ec57af75f4a Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Fri, 1 Feb 2019 16:53:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20`coordinate`=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/modules/coordinate.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/modules/coordinate.d.ts b/types/modules/coordinate.d.ts index 712ac1d..6b9ce6c 100644 --- a/types/modules/coordinate.d.ts +++ b/types/modules/coordinate.d.ts @@ -12,14 +12,14 @@ declare function setScreenMetrics(width: number, height: number): void; * * 模拟点击坐标(x, y)大约150毫秒,并返回是否点击成功。只有在点击执行完成后脚本才继续执行。 */ -declare function click(x: number, y: number): void; +declare function click(x: number, y: number): boolean; /** * Android7.0以上 * * 模拟长按坐标(x, y), 并返回是否成功。只有在长按执行完成(大约600毫秒)时脚本才会继续执行。 */ -declare function longClick(x: number, y: number): void; +declare function longClick(x: number, y: number): boolean; /** * Android7.0以上 @@ -28,7 +28,7 @@ declare function longClick(x: number, y: number): void; * * 如果按住时间过短,那么会被系统认为是点击;如果时长超过500毫秒,则认为是长按。 */ -declare function press(x: number, y: number, duration: number): void; +declare function press(x: number, y: number, duration: number): boolean; /** * 模拟从坐标(x1, y1)滑动到坐标(x2, y2),并返回是否成功。只有滑动操作执行完成时脚本才会继续执行。