Migrate ArchivedDevice from js to tsx
Summary: As per the title Reviewed By: passy Differential Revision: D16667144 fbshipit-source-id: 9fe923f8389feafa66d6bf6967217ce89ddbfaf2
This commit is contained in:
committed by
Facebook Github Bot
parent
47a55b0f26
commit
f26a28f6f6
46
src/devices/ArchivedDevice.tsx
Normal file
46
src/devices/ArchivedDevice.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright 2018-present Facebook.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @format
|
||||
*/
|
||||
import BaseDevice from './BaseDevice';
|
||||
import {DeviceType, OS, DeviceShell, DeviceLogEntry} from './BaseDevice';
|
||||
|
||||
export default class ArchivedDevice extends BaseDevice {
|
||||
// @ts-ignore: Super needs to be on the first line
|
||||
constructor(
|
||||
serial: string,
|
||||
deviceType: DeviceType,
|
||||
title: string,
|
||||
os: OS,
|
||||
logEntries: Array<DeviceLogEntry>,
|
||||
) {
|
||||
let archivedDeviceType = deviceType;
|
||||
if (archivedDeviceType === 'emulator') {
|
||||
archivedDeviceType = 'archivedEmulator';
|
||||
} else if (archivedDeviceType === 'physical') {
|
||||
archivedDeviceType = 'archivedPhysical';
|
||||
}
|
||||
super(serial, archivedDeviceType, title);
|
||||
this.os = os;
|
||||
this.logs = logEntries;
|
||||
}
|
||||
|
||||
logs: Array<DeviceLogEntry>;
|
||||
|
||||
isArchived = true;
|
||||
|
||||
getLogs() {
|
||||
return this.logs;
|
||||
}
|
||||
|
||||
clearLogs(): Promise<void> {
|
||||
this.logs = [];
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
spawnShell(): DeviceShell | undefined | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user