UNPKG

@yume-chan/adb-scrcpy

Version:

Use `@yume-chan/adb` to bootstrap `@yume-chan/scrcpy`.

41 lines (31 loc) 1.21 kB
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb"; import type { ScrcpyDisplay } from "@yume-chan/scrcpy"; import { ScrcpyOptions1_17 } from "@yume-chan/scrcpy"; import type { AdbScrcpyClientOptions } from "../client-options.js"; import type { AdbScrcpyConnection } from "../connection.js"; import type { AdbScrcpyOptions } from "../types.js"; import { createConnection, getDisplays } from "./impl/index.js"; export class AdbScrcpyOptions1_17 extends ScrcpyOptions1_17 implements AdbScrcpyOptions<ScrcpyOptions1_17.Init> { readonly version: string; readonly spawner: AdbNoneProtocolSpawner | undefined; constructor( init: ScrcpyOptions1_17.Init, clientOptions?: AdbScrcpyClientOptions, ) { super(init); this.version = clientOptions?.version ?? "1.17"; this.spawner = clientOptions?.spawner; } getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> { return getDisplays(adb, path, this); } createConnection(adb: Adb): AdbScrcpyConnection { return createConnection(adb, this.value); } } export namespace AdbScrcpyOptions1_17 { export type Init = ScrcpyOptions1_17.Init; }