import type { AppInfo, ConnectionConfig, DeviceSettings, Geolocation, LaunchOptions, MobilewrightDriver, Orientation, RecordingOptions, RecordingResult, ScreenSize, Session } from '@mobilewright/protocol'; import { Screen } from './screen.js'; import type { LocatorOptions, StepFn } from './locator.js'; export interface DeviceOptions { locatorDefaults?: LocatorOptions; /** Timeout waiting for app to reach foreground after launch, in ms. Default: 20000. */ appLaunchTimeout?: number; /** Timeout for app installation in ms. Default: none (no limit). */ installTimeout?: number; } export declare class Device { readonly driver: MobilewrightDriver; private cleanupCallbacks; private _screen; private _stepFn; private session; private readonly opts; constructor(driver: MobilewrightDriver, opts?: DeviceOptions); /** Register a callback to run on close(). Used by launchers for cleanup. */ onClose(callback: () => Promise): void; connect(config: ConnectionConfig): Promise; disconnect(): Promise; /** * Apply device-level settings (animations, etc.) to the connected device. * No-ops when the driver doesn't support it. Fire-and-forget: settings are * not restored on disconnect. */ applyDeviceSettings(settings: DeviceSettings): Promise; /** Full cleanup: disconnect + run any registered cleanup callbacks. */ close(): Promise; /** Wire test-step reporting for this device and its screen (report visibility). */ setStepFn(fn: StepFn): void; private _step; get screen(): Screen; /** The physical device identifier (Android serial / iOS UDID) this device connected to. */ get id(): string; getOrientation(): Promise; setOrientation(orientation: Orientation): Promise; /** * Override the GPS location reported by the device. * Passing null or undefined clears the override — matches Playwright's setGeolocation(). */ setGeolocation(geolocation?: Geolocation | null): Promise; /** Screen dimensions and pixel density: { width, height, scale }. */ screenSize(): Promise; openUrl(url: string): Promise; /** Alias for openUrl — matches Playwright's page.goto(). */ goto(url: string): Promise; launchApp(bundleId: string, opts?: LaunchOptions): Promise; private _launchApp; terminateApp(bundleId: string): Promise; listApps(): Promise; getForegroundApp(): Promise; installApp(path: string): Promise; uninstallApp(bundleId: string): Promise; startRecording(opts: RecordingOptions): Promise; stopRecording(): Promise; } //# sourceMappingURL=device.d.ts.map