/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ import { SandyPluginDefinition } from './SandyPluginDefinition'; import { BasePluginInstance, BasePluginClient } from './PluginBase'; import { FlipperLib } from './FlipperLib'; import { Atom, ReadOnlyAtom } from '../state/atom'; import { DeviceOS, DeviceType, DeviceLogEntry, CrashLog, ServerAddOnControls, EventsContract, MethodsContract, DeviceDescription } from 'flipper-common'; export type DeviceLogListener = (entry: DeviceLogEntry) => void; export type CrashLogListener = (crash: CrashLog) => void; export interface Device { readonly isArchived: boolean; readonly description: DeviceDescription; readonly isConnected: boolean; readonly os: DeviceOS; readonly serial: string; readonly deviceType: DeviceType; readonly connected: Atom; executeShell(command: string): Promise; addLogListener(callback: DeviceLogListener): Symbol; addCrashListener(callback: CrashLogListener): Symbol; removeLogListener(id: Symbol): void; removeCrashListener(id: Symbol): void; executeShell(command: string): Promise; forwardPort(local: string, remote: string): Promise; clearLogs(): Promise; sendMetroCommand(command: string): Promise; navigateToLocation(location: string): Promise; screenshot(): Promise; installApp(appBundlePath: string, timeout?: number): Promise; } export type DevicePluginPredicate = (device: Device) => boolean; export type DevicePluginFactory = (client: DevicePluginClient) => object; export interface DevicePluginClient extends BasePluginClient { /** * opens a different plugin by id, optionally providing a deeplink to bring the plugin to a certain state */ selectPlugin(pluginId: string, deeplinkPayload?: unknown): void; readonly isConnected: boolean; readonly connected: ReadOnlyAtom; } export declare class SandyDevicePluginInstance extends BasePluginInstance { static is(thing: any): thing is SandyDevicePluginInstance; /** client that is bound to this instance */ readonly client: DevicePluginClient; constructor(serverAddOnControls: ServerAddOnControls, flipperLib: FlipperLib, definition: SandyPluginDefinition, device: Device, pluginKey: string, initialStates?: Record); toJSON(): string; destroy(): void; protected get serverAddOnOwner(): string; } //# sourceMappingURL=DevicePlugin.d.ts.map