adbkit typing

Summary: Adding proper types for adbkit (extracted from their documentation)

Reviewed By: passy

Differential Revision: D17342184

fbshipit-source-id: da0fc0264961ca3a0fa775ab5165d20872042eb8
This commit is contained in:
Daniel Büchele
2019-09-13 05:25:36 -07:00
committed by Facebook Github Bot
parent 01be3dc5d1
commit 4e7cf077b8
8 changed files with 144 additions and 168 deletions

View File

@@ -20,6 +20,7 @@ import {reportPlatformFailures} from './metrics';
import {getAdbClient} from './adbClient';
import * as androidUtil from './androidContainerUtility';
import os from 'os';
import {Client as ADBClient} from 'adbkit-fb';
const tmpFile = promisify(tmp.file) as (
options?: FileOptions,
@@ -72,7 +73,7 @@ export type SecureServerConfig = {
*/
export default class CertificateProvider {
logger: Logger;
adb: Promise<any>;
adb: Promise<ADBClient>;
certificateSetup: Promise<void>;
server: Server;
@@ -260,7 +261,7 @@ export default class CertificateProvider {
): Promise<string> {
return this.adb
.then(client => client.listDevices())
.then((devices: Array<{id: string}>) => {
.then(devices => {
if (devices.length === 0) {
throw new Error('No Android devices found');
}