microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/extension/networkInspector/devices/baseClientDevice.ts
54lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import { ITarget } from "../../mobileTarget"; |
| 5 | import { ClientOS } from "../clientUtils"; |
| 6 | |
| 7 | export enum DeviceStatus { |
| 8 | Prepared, |
| 9 | NotPrepared, |
| 10 | } |
| 11 | |
| 12 | export class BaseClientDevice implements ITarget { |
| 13 | // operating system of this device |
| 14 | protected _os: ClientOS; |
| 15 | // human readable name for this device |
| 16 | protected _name?: string; |
| 17 | // type of this device |
| 18 | protected _isVirtualTarget: boolean; |
| 19 | // serial number for this device |
| 20 | protected _id: string; |
| 21 | protected _deviceStatus: DeviceStatus; |
| 22 | |
| 23 | constructor(id: string, isVirtualTarget: boolean, os: ClientOS, name?: string) { |
| 24 | this._id = id; |
| 25 | this._name = name; |
| 26 | this._isVirtualTarget = isVirtualTarget; |
| 27 | this._os = os; |
| 28 | this._deviceStatus = DeviceStatus.NotPrepared; |
| 29 | } |
| 30 | |
| 31 | get id(): string { |
| 32 | return this._id; |
| 33 | } |
| 34 | |
| 35 | get os(): ClientOS { |
| 36 | return this._os; |
| 37 | } |
| 38 | |
| 39 | get name(): string | undefined { |
| 40 | return this._name; |
| 41 | } |
| 42 | |
| 43 | get isVirtualTarget(): boolean { |
| 44 | return this._isVirtualTarget; |
| 45 | } |
| 46 | |
| 47 | get deviceStatus(): DeviceStatus { |
| 48 | return this._deviceStatus; |
| 49 | } |
| 50 | |
| 51 | set deviceStatus(deviceStatus: DeviceStatus) { |
| 52 | this._deviceStatus = deviceStatus; |
| 53 | } |
| 54 | } |
| 55 | |