Expose device description in device interface
Summary: This is needed to avoid mobile builds depending on BaseDevice Reviewed By: mweststrate Differential Revision: D37315909 fbshipit-source-id: a090bd3e76ceefe1f2ac68f832ee544ae45a8d6a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6c5faf2932
commit
749abfeff2
@@ -19,6 +19,7 @@ import {
|
||||
ServerAddOnControls,
|
||||
EventsContract,
|
||||
MethodsContract,
|
||||
DeviceDescription,
|
||||
} from 'flipper-common';
|
||||
|
||||
export type DeviceLogListener = (entry: DeviceLogEntry) => void;
|
||||
@@ -26,6 +27,7 @@ export type CrashLogListener = (crash: CrashLog) => void;
|
||||
|
||||
export interface Device {
|
||||
readonly isArchived: boolean;
|
||||
readonly description: DeviceDescription;
|
||||
readonly isConnected: boolean;
|
||||
readonly os: DeviceOS;
|
||||
readonly serial: string;
|
||||
|
||||
@@ -575,6 +575,16 @@ function createMockDevice(options?: StartPluginOptions): Device & {
|
||||
const crashListeners: (undefined | CrashLogListener)[] = [];
|
||||
return {
|
||||
os: 'Android',
|
||||
description: {
|
||||
os: 'Android',
|
||||
deviceType: 'emulator',
|
||||
features: {
|
||||
screenCaptureAvailable: false,
|
||||
screenshotAvailable: false,
|
||||
},
|
||||
serial: '123',
|
||||
title: 'Test device',
|
||||
},
|
||||
deviceType: 'emulator',
|
||||
serial: 'serial-000',
|
||||
isArchived: !!options?.isArchived,
|
||||
|
||||
Reference in New Issue
Block a user