Migration of Basedevice from js to tsx
Summary: Converted BaseDevice from js to tsx Reviewed By: passy Differential Revision: D16648356 fbshipit-source-id: 12954532acf91930ab8c5f995bb94f6f9fe44015
This commit is contained in:
committed by
Facebook Github Bot
parent
fe5df63d41
commit
604e6d761f
@@ -5,12 +5,12 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DeviceType, DeviceShell} from './BaseDevice.js';
|
||||
import type {DeviceType, DeviceShell} from './BaseDevice.tsx';
|
||||
|
||||
import {Priority} from 'adbkit-logcat-fb';
|
||||
import child_process from 'child_process';
|
||||
import child_process_promise from 'child-process-es6-promise';
|
||||
import BaseDevice from './BaseDevice.js';
|
||||
import BaseDevice from './BaseDevice.tsx';
|
||||
import ArchivedDevice from './ArchivedDevice.js';
|
||||
|
||||
type ADBClient = any;
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @format
|
||||
*/
|
||||
import BaseDevice from './BaseDevice.js';
|
||||
import BaseDevice from './BaseDevice.tsx';
|
||||
import type {
|
||||
DeviceType,
|
||||
OS,
|
||||
DeviceShell,
|
||||
DeviceLogEntry,
|
||||
} from './BaseDevice.js';
|
||||
} from './BaseDevice.tsx';
|
||||
|
||||
export default class ArchivedDevice extends BaseDevice {
|
||||
constructor(
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type stream from 'stream';
|
||||
import type ArchivedDevice from './ArchivedDevice';
|
||||
import stream from 'stream';
|
||||
|
||||
export type LogLevel =
|
||||
| 'unknown'
|
||||
@@ -17,7 +16,7 @@ export type LogLevel =
|
||||
| 'error'
|
||||
| 'fatal';
|
||||
|
||||
export type DeviceLogEntry = {|
|
||||
export type DeviceLogEntry = {
|
||||
date: Date,
|
||||
pid: number,
|
||||
tid: number,
|
||||
@@ -25,7 +24,7 @@ export type DeviceLogEntry = {|
|
||||
type: LogLevel,
|
||||
tag: string,
|
||||
message: string,
|
||||
|};
|
||||
};
|
||||
|
||||
export type DeviceShell = {
|
||||
stdout: stream.Readable,
|
||||
@@ -41,13 +40,13 @@ export type DeviceType =
|
||||
| 'archivedEmulator'
|
||||
| 'archivedPhysical';
|
||||
|
||||
export type DeviceExport = {|
|
||||
export type DeviceExport = {
|
||||
os: string,
|
||||
title: string,
|
||||
deviceType: DeviceType,
|
||||
serial: string,
|
||||
logs: Array<DeviceLogEntry>,
|
||||
|};
|
||||
};
|
||||
|
||||
export type OS = 'iOS' | 'Android' | 'Windows' | 'MacOS';
|
||||
|
||||
@@ -71,7 +70,7 @@ export default class BaseDevice {
|
||||
serial: string;
|
||||
|
||||
// possible src of icon to display next to the device title
|
||||
icon: ?string;
|
||||
icon: string | null | undefined;
|
||||
|
||||
logListeners: Map<Symbol, DeviceLogListener> = new Map();
|
||||
logEntries: Array<DeviceLogEntry> = [];
|
||||
@@ -135,7 +134,7 @@ export default class BaseDevice {
|
||||
this.logListeners.delete(id);
|
||||
}
|
||||
|
||||
spawnShell(): ?DeviceShell {
|
||||
spawnShell(): DeviceShell | null | undefined {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
@@ -143,7 +142,7 @@ export default class BaseDevice {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
archive(): ?ArchivedDevice {
|
||||
archive(): any | null | undefined {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DeviceType, LogLevel, DeviceLogEntry} from './BaseDevice.js';
|
||||
import type {DeviceType, LogLevel, DeviceLogEntry} from './BaseDevice.tsx';
|
||||
import child_process from 'child_process';
|
||||
import BaseDevice from './BaseDevice.js';
|
||||
import BaseDevice from './BaseDevice.tsx';
|
||||
import JSONStream from 'JSONStream';
|
||||
import {Transform} from 'stream';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import BaseDevice from './BaseDevice.js';
|
||||
import BaseDevice from './BaseDevice.tsx';
|
||||
|
||||
export default class MacDevice extends BaseDevice {
|
||||
os = 'MacOS';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import BaseDevice from './BaseDevice.js';
|
||||
import BaseDevice from './BaseDevice.tsx';
|
||||
|
||||
export default class WindowsDevice extends BaseDevice {
|
||||
os = 'Windows';
|
||||
|
||||
Reference in New Issue
Block a user