|
1 | 1 | export type SimDeckLaunchOptions = { |
2 | | - cliPath?: string; |
3 | | - projectRoot?: string; |
4 | | - keepDaemon?: boolean; |
5 | | - isolated?: boolean; |
6 | | - port?: number; |
7 | | - videoCodec?: "hevc" | "h264" | "h264-software"; |
| 2 | + cliPath?: string; |
| 3 | + projectRoot?: string; |
| 4 | + keepDaemon?: boolean; |
| 5 | + isolated?: boolean; |
| 6 | + port?: number; |
| 7 | + videoCodec?: "hevc" | "h264" | "h264-software"; |
8 | 8 | }; |
9 | 9 | export type QueryOptions = { |
10 | | - source?: "auto" | "nativescript" | "uikit" | "native-ax"; |
11 | | - maxDepth?: number; |
12 | | - includeHidden?: boolean; |
| 10 | + source?: "auto" | "nativescript" | "uikit" | "native-ax"; |
| 11 | + maxDepth?: number; |
| 12 | + includeHidden?: boolean; |
13 | 13 | }; |
14 | 14 | export type ElementSelector = { |
15 | | - id?: string; |
16 | | - label?: string; |
17 | | - value?: string; |
18 | | - type?: string; |
| 15 | + id?: string; |
| 16 | + label?: string; |
| 17 | + value?: string; |
| 18 | + type?: string; |
19 | 19 | }; |
20 | 20 | export type TapOptions = QueryOptions & { |
21 | | - durationMs?: number; |
22 | | - waitTimeoutMs?: number; |
23 | | - pollMs?: number; |
| 21 | + durationMs?: number; |
| 22 | + waitTimeoutMs?: number; |
| 23 | + pollMs?: number; |
24 | 24 | }; |
25 | 25 | export type SimDeckSession = { |
26 | | - endpoint: string; |
27 | | - pid: number; |
28 | | - projectRoot: string; |
29 | | - list(): Promise<unknown>; |
30 | | - install(udid: string, appPath: string): Promise<void>; |
31 | | - uninstall(udid: string, bundleId: string): Promise<void>; |
32 | | - launch(udid: string, bundleId: string): Promise<void>; |
33 | | - openUrl(udid: string, url: string): Promise<void>; |
34 | | - tap(udid: string, x: number, y: number): Promise<void>; |
35 | | - tapElement(udid: string, selector: ElementSelector, options?: TapOptions): Promise<void>; |
36 | | - touch(udid: string, x: number, y: number, phase: string): Promise<void>; |
37 | | - key(udid: string, keyCode: number, modifiers?: number): Promise<void>; |
38 | | - button(udid: string, button: string, durationMs?: number): Promise<void>; |
39 | | - pasteboardSet(udid: string, text: string): Promise<void>; |
40 | | - pasteboardGet(udid: string): Promise<string>; |
41 | | - chromeProfile(udid: string): Promise<unknown>; |
42 | | - tree(udid: string, options?: QueryOptions): Promise<unknown>; |
43 | | - query(udid: string, selector: ElementSelector, options?: QueryOptions): Promise<unknown[]>; |
44 | | - assert(udid: string, selector: ElementSelector, options?: QueryOptions): Promise<unknown>; |
45 | | - waitFor(udid: string, selector: ElementSelector, options?: QueryOptions & { |
46 | | - timeoutMs?: number; |
47 | | - pollMs?: number; |
48 | | - }): Promise<unknown>; |
49 | | - batch(udid: string, steps: unknown[], continueOnError?: boolean): Promise<unknown>; |
50 | | - screenshot(udid: string): Promise<Buffer>; |
51 | | - close(): void; |
| 26 | + endpoint: string; |
| 27 | + pid: number; |
| 28 | + projectRoot: string; |
| 29 | + list(): Promise<unknown>; |
| 30 | + install(udid: string, appPath: string): Promise<void>; |
| 31 | + uninstall(udid: string, bundleId: string): Promise<void>; |
| 32 | + launch(udid: string, bundleId: string): Promise<void>; |
| 33 | + openUrl(udid: string, url: string): Promise<void>; |
| 34 | + tap(udid: string, x: number, y: number): Promise<void>; |
| 35 | + tapElement( |
| 36 | + udid: string, |
| 37 | + selector: ElementSelector, |
| 38 | + options?: TapOptions, |
| 39 | + ): Promise<void>; |
| 40 | + touch(udid: string, x: number, y: number, phase: string): Promise<void>; |
| 41 | + key(udid: string, keyCode: number, modifiers?: number): Promise<void>; |
| 42 | + button(udid: string, button: string, durationMs?: number): Promise<void>; |
| 43 | + pasteboardSet(udid: string, text: string): Promise<void>; |
| 44 | + pasteboardGet(udid: string): Promise<string>; |
| 45 | + chromeProfile(udid: string): Promise<unknown>; |
| 46 | + tree(udid: string, options?: QueryOptions): Promise<unknown>; |
| 47 | + query( |
| 48 | + udid: string, |
| 49 | + selector: ElementSelector, |
| 50 | + options?: QueryOptions, |
| 51 | + ): Promise<unknown[]>; |
| 52 | + assert( |
| 53 | + udid: string, |
| 54 | + selector: ElementSelector, |
| 55 | + options?: QueryOptions, |
| 56 | + ): Promise<unknown>; |
| 57 | + waitFor( |
| 58 | + udid: string, |
| 59 | + selector: ElementSelector, |
| 60 | + options?: QueryOptions & { |
| 61 | + timeoutMs?: number; |
| 62 | + pollMs?: number; |
| 63 | + }, |
| 64 | + ): Promise<unknown>; |
| 65 | + batch( |
| 66 | + udid: string, |
| 67 | + steps: unknown[], |
| 68 | + continueOnError?: boolean, |
| 69 | + ): Promise<unknown>; |
| 70 | + screenshot(udid: string): Promise<Buffer>; |
| 71 | + close(): void; |
52 | 72 | }; |
53 | | -export declare function connect(options?: SimDeckLaunchOptions): Promise<SimDeckSession>; |
| 73 | +export declare function connect( |
| 74 | + options?: SimDeckLaunchOptions, |
| 75 | +): Promise<SimDeckSession>; |
0 commit comments