forked from httptoolkit/httptoolkit-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadbkit.d.ts
53 lines (48 loc) · 1.54 KB
/
adbkit.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
declare module '@devicefarmer/adbkit' {
import * as stream from 'stream';
import * as events from 'events';
export interface Device {
id: string;
type: string;
}
export interface File {
name: string;
}
export interface AdbClient {
listDevices(): Promise<Device[]>;
isInstalled(id: string, pkg: string): Promise<boolean>;
install(id: string, apk: string | stream.Readable): Promise<true>;
startActivity(
id: string,
options: {
debug?: boolean;
wait?: boolean;
action?: string;
data?: string;
}
): Promise<true>;
readdir(id: string, path: string): Promise<Array<File>>;
push(
id: string,
contents: string | stream.Readable,
path: string,
mode?: number
): Promise<events.EventEmitter>;
pull(
id: string,
path: string
): Promise<stream.Readable & { cancel: () => void }>
shell(id: string, cmd: string | string[]): Promise<stream.Readable>;
root(id: string): Promise<true>;
on(type: 'error', handler: (error: Error) => void): void;
reverse(id: string, remote: string, local: string): Promise<true>;
}
export function createClient(options?: {
port?: number,
host?: string,
bin?: string
}): AdbClient;
export namespace util {
export function readAll(stream: stream.Readable): Promise<Buffer>;
}
}