mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 01:39:21 +02:00
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import type { Adb } from "@yume-chan/adb";
|
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
|
import { ScrcpyOptions2_3_1 } from "@yume-chan/scrcpy";
|
|
|
|
import {
|
|
createConnection,
|
|
getDisplays,
|
|
getEncoders,
|
|
} from "./2_1/impl/index.js";
|
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
|
import type { AdbScrcpyConnection } from "./connection.js";
|
|
import { AdbScrcpyOptions } from "./types.js";
|
|
|
|
export class AdbScrcpyOptions2_3_1<
|
|
TVideo extends boolean,
|
|
> extends AdbScrcpyOptions<ScrcpyOptions2_3_1.Init<TVideo>> {
|
|
constructor(
|
|
init: ScrcpyOptions2_3_1.Init<TVideo>,
|
|
clientOptions?: AdbScrcpyClientOptions,
|
|
) {
|
|
super(
|
|
new ScrcpyOptions2_3_1(init, clientOptions?.version),
|
|
clientOptions?.spawner,
|
|
);
|
|
}
|
|
|
|
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
|
return getEncoders(adb, path, this);
|
|
}
|
|
|
|
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
|
return getDisplays(adb, path, this);
|
|
}
|
|
|
|
override createConnection(adb: Adb): AdbScrcpyConnection {
|
|
return createConnection(adb, this.value);
|
|
}
|
|
}
|
|
|
|
export namespace AdbScrcpyOptions2_3_1 {
|
|
export type Init<TVideo extends boolean = boolean> =
|
|
ScrcpyOptions2_3_1.Init<TVideo>;
|
|
}
|