Factor out realDevice [7/n]

Summary: `device.realDevice` was the escape hatch used in Sandy plugins to give access to device specific features like taking screenshots, clearing logs or accessing `adb`. Since in decapitated Flipper that won't be possible anymore (since plugins run in the client but device implementations on the server), all escape hatches have been bridged in this stack, and we can get of the `realDevice` interaction, by explicitly exposing those cases, which makes it type safe as well.

Reviewed By: passy

Differential Revision: D31079509

fbshipit-source-id: c9ec2e044d0dec0ccb1de287cf424907b198f818
This commit is contained in:
Michel Weststrate
2021-09-22 09:01:29 -07:00
committed by Facebook GitHub Bot
parent 11a27f9e1a
commit 3882357579
23 changed files with 106 additions and 93 deletions

View File

@@ -69,7 +69,11 @@ declare module 'adbkit' {
getProperties: (serial: string) => Promise<{[key: string]: string}>;
trackDevices: () => Promise<DeviceTracker>;
kill: () => Promise<boolean>;
forward: (serial: string, local: string, remote: string) => Promise<void>;
forward: (
serial: string,
local: string,
remote: string,
) => Promise<boolean>; // TODO: verify correctness of signature
}
export function createClient(config: {port: number; host: string}): Client;
}