@swipt/api 0.1.0-nightly.38 → 0.1.0-nightly.40
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/accessibility.d.ts +7 -1
- package/accessibility.mjs +2 -1
- package/device.mjs +1 -1
- package/image.d.ts +1 -1
- package/image.mjs +1 -1
- package/index.d.ts +4 -0
- package/input.d.ts +0 -1
- package/input.mjs +1 -1
- package/package.json +1 -1
- package/repl.d.ts +1 -0
- package/screen.mjs +1 -1
- package/swiplet.mjs +1 -1
package/accessibility.d.ts
CHANGED
|
@@ -69,5 +69,11 @@ export interface FindOptions extends CallOptions {
|
|
|
69
69
|
|
|
70
70
|
export declare function snapshot(options?: SnapshotOptions): Promise<AccessibilitySnapshot>;
|
|
71
71
|
export declare function find(selector: AccessibilitySelector | readonly AccessibilitySelector[], options?: FindOptions): Promise<AccessibilityElement | null>;
|
|
72
|
-
export
|
|
72
|
+
export interface ElementOptions extends CallOptions {
|
|
73
|
+
/** Omitted or 0 tries once; a positive number or Infinity keeps checking until a tap would reach the element, and fails at the limit. */
|
|
74
|
+
readonly timeoutMs?: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare function tap(element: AccessibilityElement, options?: ElementOptions): Promise<void>;
|
|
78
|
+
export declare function setText(element: AccessibilityElement, text: string, options?: ElementOptions): Promise<void>;
|
|
73
79
|
export declare function perform(element: AccessibilityElement, action: AccessibilityAction | (string & {}), options?: CallOptions): Promise<void>;
|
package/accessibility.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const outside = () => {
|
|
2
|
-
throw new Error("@swipt/api/accessibility runs inside Swipt; build the swiplet with `swipt build`");
|
|
2
|
+
throw new Error("@swipt/api/accessibility runs inside Swipt; build the swiplet with `swipt project build`");
|
|
3
3
|
};
|
|
4
4
|
|
|
5
5
|
export const snapshot = outside;
|
|
6
6
|
export const find = outside;
|
|
7
|
+
export const tap = outside;
|
|
7
8
|
export const setText = outside;
|
|
8
9
|
export const perform = outside;
|
package/device.mjs
CHANGED
package/image.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export interface RasterImage {
|
|
|
81
81
|
readonly scale: number;
|
|
82
82
|
readonly frame: Rect;
|
|
83
83
|
readonly time: number | null;
|
|
84
|
+
readonly timestamp: number | null;
|
|
84
85
|
|
|
85
86
|
crop(rect: Rect): RasterImage;
|
|
86
87
|
resize(scale: number): RasterImage;
|
|
@@ -98,7 +99,6 @@ export interface RasterImage {
|
|
|
98
99
|
save(file: FileHandle | string, options?: CallOptions & { readonly format?: ImageFormat; readonly quality?: number }): Promise<FileHandle>;
|
|
99
100
|
pixel(point: Point, options?: CallOptions): Promise<[red: number, green: number, blue: number, alpha: number]>;
|
|
100
101
|
stats(options?: CallOptions & { readonly region?: Rect }): Promise<ImageStats>;
|
|
101
|
-
release(): void;
|
|
102
102
|
|
|
103
103
|
find(template: RasterImage, options?: TemplateMatchOptions): Promise<TemplateMatch | null>;
|
|
104
104
|
findAll(template: RasterImage, options?: TemplateMatchOptions & { readonly limit?: number; readonly overlap?: number }): Promise<TemplateMatch[]>;
|
package/image.mjs
CHANGED
package/index.d.ts
CHANGED
|
@@ -21,3 +21,7 @@ export type Jsonify<T> = T extends string | number | boolean | null ? T
|
|
|
21
21
|
: T extends readonly (infer U)[] ? Jsonify<U>[]
|
|
22
22
|
: T extends object ? { [K in keyof T]: Jsonify<Exclude<T[K], undefined>> }
|
|
23
23
|
: never;
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
function sleep(ms: number, options?: CallOptions): Promise<void>;
|
|
27
|
+
}
|
package/input.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { CallOptions, Point } from "./index";
|
|
|
2
2
|
|
|
3
3
|
export interface TapOptions extends CallOptions {
|
|
4
4
|
readonly count?: number;
|
|
5
|
-
readonly holdMs?: number;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
export type KeyboardKey = "return" | "backspace" | "forwardDelete" | "tab" | "escape" | "space" | "left" | "right" | "up" | "down"
|
package/input.mjs
CHANGED
package/package.json
CHANGED
package/repl.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare global {
|
|
|
5
5
|
const screen: typeof import("@swipt/api/screen");
|
|
6
6
|
const image: typeof import("@swipt/api/image");
|
|
7
7
|
const dialog: import("@swipt/api/swiplet").IntentDialog;
|
|
8
|
+
const args: readonly string[];
|
|
8
9
|
|
|
9
10
|
function show(image: import("@swipt/api/image").RasterImage): void;
|
|
10
11
|
}
|
package/screen.mjs
CHANGED
package/swiplet.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const outside = () => {
|
|
2
|
-
throw new Error("@swipt/api/swiplet runs inside Swipt; build the swiplet with `swipt build`");
|
|
2
|
+
throw new Error("@swipt/api/swiplet runs inside Swipt; build the swiplet with `swipt project build`");
|
|
3
3
|
};
|
|
4
4
|
|
|
5
5
|
export const defineExtension = outside;
|