Add type annotations to iOSDevice

Summary:
Not ideal to just assert a type based on JSON output
but better than the `ts-ignore` because complete
misuse of the functions is still caught.

Reviewed By: jknoxville

Differential Revision: D17346265

fbshipit-source-id: 52d8109a11f552b912b67b1074cb906cb2cc161b
This commit is contained in:
Pascal Hartig
2019-09-13 02:34:12 -07:00
committed by Facebook Github Bot
parent cf956c91e5
commit b7ad035742

View File

@@ -122,12 +122,10 @@ function getActiveSimulators(): Promise<Array<IOSDeviceParams>> {
},
)
.then(({stdout}) => JSON.parse(stdout).devices)
.then(simulatorDevices => {
// @ts-ignore
.then((simulatorDevices: Array<iOSSimulatorDevice>) => {
const simulators: Array<iOSSimulatorDevice> = Object.values(
simulatorDevices,
// @ts-ignore
).reduce((acc, cv) => acc.concat(cv), []);
).reduce((acc: Array<iOSSimulatorDevice>, cv) => acc.concat(cv), []);
return simulators
.filter(