UNPKG

@yume-chan/adb-scrcpy

Version:

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

50 lines (40 loc) 1.44 kB
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb"; import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy"; import { ScrcpyOptions1_25 } from "@yume-chan/scrcpy"; import { createConnection, getDisplays, getEncoders, } from "./1_22/impl/index.js"; import type { AdbScrcpyClientOptions } from "./client-options.js"; import type { AdbScrcpyConnection } from "./connection.js"; import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js"; export class AdbScrcpyOptions1_25 extends ScrcpyOptions1_25 implements AdbScrcpyOptions<ScrcpyOptions1_25.Init>, AdbScrcpyOptionsGetEncoders { readonly version: string; readonly spawner: AdbNoneProtocolSpawner | undefined; constructor( init: ScrcpyOptions1_25.Init, clientOptions?: AdbScrcpyClientOptions, ) { super(init); this.version = clientOptions?.version ?? "1.25"; this.spawner = clientOptions?.spawner; } getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> { return getEncoders(adb, path, this); } getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> { return getDisplays(adb, path, this); } createConnection(adb: Adb): AdbScrcpyConnection { return createConnection(adb, this.value); } } export namespace AdbScrcpyOptions1_25 { export type Init = ScrcpyOptions1_25.Init; }