UNPKG

4.06 kBTypeScriptView Raw
1/// <reference types="node" />
2export declare type Device = {
3 pid?: string;
4 name: string;
5 type: 'emulator' | 'device';
6 isBooted: boolean;
7 isAuthorized: boolean;
8};
9export declare function getAllAvailableDevicesAsync(): Promise<Device[]>;
10export declare function getAttachedDevicesAsync(): Promise<Device[]>;
11export declare function isPlatformSupported(): boolean;
12export declare function getAdbOutputAsync(args: string[]): Promise<string>;
13export declare function getAdbFileOutputAsync(args: string[], encoding?: 'latin1'): Promise<string | Buffer>;
14export declare function installExpoAsync({ device, url, version, }: {
15 device: Device;
16 url?: string;
17 version?: string;
18}): Promise<string>;
19export declare function installOnDeviceAsync(device: Pick<Device, 'pid'>, { binaryPath }: {
20 binaryPath: string;
21}): Promise<string>;
22export declare function isDeviceBootedAsync({ name, }?: {
23 name?: string;
24}): Promise<Device | null>;
25export declare function uninstallExpoAsync(device: Device): Promise<string | undefined>;
26export declare function upgradeExpoAsync({ url, version, device, }?: {
27 url?: string;
28 version?: string;
29 device?: Device | null;
30}): Promise<boolean>;
31export declare function activateEmulatorWindowAsync(device: Pick<Device, 'type' | 'pid'>): Promise<void>;
32/**
33 * @param device Android device to open on
34 * @param props.launchActivity Activity to launch `[application identifier]/.[main activity name]`, ex: `com.bacon.app/.MainActivity`
35 */
36export declare function openAppAsync(device: Pick<Device, 'pid' | 'type'>, { launchActivity, }: {
37 launchActivity: string;
38}): Promise<string>;
39export declare function attemptToStartEmulatorOrAssertAsync(device: Device): Promise<Device | null>;
40export declare function resolveApplicationIdAsync(projectRoot: string): Promise<string | null>;
41export declare function openProjectAsync({ projectRoot, shouldPrompt, devClient, device, scheme, applicationId, launchActivity, }: {
42 projectRoot: string;
43 shouldPrompt?: boolean;
44 devClient?: boolean;
45 device?: Device;
46 scheme?: string;
47 applicationId?: string | null;
48 launchActivity?: string;
49}): Promise<{
50 success: true;
51 url: string;
52} | {
53 success: false;
54 error: Error | string;
55}>;
56export declare function openWebProjectAsync({ projectRoot, shouldPrompt, }: {
57 projectRoot: string;
58 shouldPrompt?: boolean;
59}): Promise<{
60 success: true;
61 url: string;
62} | {
63 success: false;
64 error: string;
65}>;
66export declare function startAdbReverseAsync(projectRoot: string): Promise<boolean>;
67export declare function stopAdbReverseAsync(projectRoot: string): Promise<void>;
68/**
69 * Checks whether `resizeMode` is set to `native` and if `true` analyzes provided images for splashscreen
70 * providing `Logger` feedback upon problems.
71 * @param projectRoot - directory of the expo project
72 * @since SDK33
73 */
74export declare function checkSplashScreenImages(projectRoot: string): Promise<void>;
75export declare function maybeStopAdbDaemonAsync(): Promise<boolean>;
76export declare function promptForDeviceAsync(devices: Device[]): Promise<Device | null>;
77export declare enum DeviceABI {
78 arm = "arm",
79 arm64 = "arm64",
80 x64 = "x64",
81 x86 = "x86",
82 armeabiV7a = "armeabi-v7a",
83 armeabi = "armeabi",
84 universal = "universal"
85}
86declare type DeviceProperties = Record<string, string>;
87/**
88 * @returns string like '11' (i.e. Android 11)
89 */
90export declare function getDeviceSDKVersionAsync(device: Pick<Device, 'name' | 'pid'>): Promise<string>;
91/**
92 * @returns number like `30` (i.e. API 30)
93 */
94export declare function getDeviceAPIVersionAsync(device: Pick<Device, 'name' | 'pid'>): Promise<number>;
95export declare function getDeviceABIsAsync(device: Pick<Device, 'name' | 'pid'>): Promise<DeviceABI[]>;
96export declare function getPropertyForDeviceAsync(device: Pick<Device, 'name' | 'pid'>, name: string, shouldRefresh?: boolean): Promise<string>;
97export declare function parseAdbDeviceProperties(devicePropertiesString: string): DeviceProperties;
98export {};