import type { Server as HttpServer } from 'node:http';
import type { AdbServerClient } from '@yume-chan/adb';
import express from 'express';
import { Server } from 'socket.io';
export declare const debugPage: import("@midscene/shared/logger").DebugFunction;
export interface ScrcpyConnectDeviceRequest {
    deviceId?: string;
    maxSize?: number;
}
export interface ScrcpyListedDevice {
    id: string;
    name: string;
    status: string;
}
export interface ScrcpyDeviceListSource {
    getDevices(): Promise<ScrcpyListedDevice[]>;
    subscribe(listener: (devices: ScrcpyListedDevice[]) => void): () => void;
}
export interface ScrcpyServerOptions {
    deviceListSource?: ScrcpyDeviceListSource;
}
export declare function resolveRequestedDeviceId(options: ScrcpyConnectDeviceRequest | undefined, currentDeviceId: string | null): string | undefined;
export default class ScrcpyServer {
    app: express.Application;
    httpServer: HttpServer;
    io: Server;
    port?: number | null;
    defaultPort: number;
    adbClient: AdbServerClient | null;
    currentDeviceId: string | null;
    devicePollInterval: NodeJS.Timeout | null;
    private deviceListSource?;
    private deviceListSourceUnsubscribe?;
    lastDeviceList: string;
    constructor(options?: ScrcpyServerOptions);
    private setupApiRoutes;
    private getDevicesList;
    private broadcastDevicesList;
    private getAdbClient;
    private getAdb;
    private startScrcpy;
    private setupSocketHandlers;
    launch(port?: number): Promise<this>;
    private startDeviceMonitoring;
    close(): HttpServer<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
}
