mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 10:19:17 +02:00
feat(scrcpy): move version to AdbScrcpyOptions
and simplify inheritance
This commit is contained in:
parent
b79df96301
commit
fe06652f52
69 changed files with 714 additions and 672 deletions
6
.changeset/chilly-tigers-float.md
Normal file
6
.changeset/chilly-tigers-float.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
"@yume-chan/adb-scrcpy": major
|
||||||
|
"@yume-chan/scrcpy": major
|
||||||
|
---
|
||||||
|
|
||||||
|
Move `version` parameter to `AdbScrcpyOptions`
|
|
@ -1,3 +1,2 @@
|
||||||
export * from "./create-connection.js";
|
export * from "./create-connection.js";
|
||||||
export * from "./get-displays.js";
|
export * from "./get-displays.js";
|
||||||
export * from "./get-encoders.js";
|
|
||||||
|
|
|
@ -1,33 +1,36 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_15 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_15 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "../connection.js";
|
import type { AdbScrcpyConnection } from "../connection.js";
|
||||||
import { AdbScrcpyOptions } from "../types.js";
|
import type { AdbScrcpyOptions } from "../types.js";
|
||||||
|
|
||||||
import { createConnection, getDisplays, getEncoders } from "./impl/index.js";
|
import { createConnection, getDisplays } from "./impl/index.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_15
|
||||||
|
extends ScrcpyOptions1_15
|
||||||
|
implements AdbScrcpyOptions<ScrcpyOptions1_15.Init>
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_15 extends AdbScrcpyOptions<ScrcpyOptions1_15.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_15.Init,
|
init: ScrcpyOptions1_15.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_15(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.15";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getEncoders(adb, path, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,35 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_15_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_15_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import {
|
import { createConnection, getDisplays } from "./1_15/impl/index.js";
|
||||||
createConnection,
|
|
||||||
getDisplays,
|
|
||||||
getEncoders,
|
|
||||||
} from "./1_15/impl/index.js";
|
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_15_1
|
||||||
|
extends ScrcpyOptions1_15_1
|
||||||
|
implements AdbScrcpyOptions<ScrcpyOptions1_15_1.Init>
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_15_1 extends AdbScrcpyOptions<ScrcpyOptions1_15_1.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_15_1.Init,
|
init: ScrcpyOptions1_15_1.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_15_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.15.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getEncoders(adb, path, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,35 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_16 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_16 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import {
|
import { createConnection, getDisplays } from "./1_15/impl/index.js";
|
||||||
createConnection,
|
|
||||||
getDisplays,
|
|
||||||
getEncoders,
|
|
||||||
} from "./1_15/impl/index.js";
|
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_16
|
||||||
|
extends ScrcpyOptions1_16
|
||||||
|
implements AdbScrcpyOptions<ScrcpyOptions1_16.Init>
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_16 extends AdbScrcpyOptions<ScrcpyOptions1_16.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_16.Init,
|
init: ScrcpyOptions1_16.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_16(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.16";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getEncoders(adb, path, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
|
||||||
import { ScrcpyOptions1_17 } from "@yume-chan/scrcpy";
|
|
||||||
|
|
||||||
import {
|
|
||||||
createConnection,
|
|
||||||
getDisplays,
|
|
||||||
getEncoders,
|
|
||||||
} from "./1_15/impl/index.js";
|
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_17 extends AdbScrcpyOptions<ScrcpyOptions1_17.Init> {
|
|
||||||
constructor(
|
|
||||||
init: ScrcpyOptions1_17.Init,
|
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
|
||||||
) {
|
|
||||||
super(
|
|
||||||
new ScrcpyOptions1_17(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 AdbScrcpyOptions1_17 {
|
|
||||||
export type Init = ScrcpyOptions1_17.Init;
|
|
||||||
}
|
|
|
@ -1,5 +1,9 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb } from "@yume-chan/adb";
|
||||||
import type { ScrcpyEncoder, ScrcpyOptions1_15 } from "@yume-chan/scrcpy";
|
import type {
|
||||||
|
ScrcpyEncoder,
|
||||||
|
ScrcpyOptions1_17,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
|
} from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import { AdbScrcpyClient } from "../../client.js";
|
import { AdbScrcpyClient } from "../../client.js";
|
||||||
import type { AdbScrcpyOptions } from "../../types.js";
|
import type { AdbScrcpyOptions } from "../../types.js";
|
||||||
|
@ -7,13 +11,14 @@ import type { AdbScrcpyOptions } from "../../types.js";
|
||||||
export async function getEncoders(
|
export async function getEncoders(
|
||||||
adb: Adb,
|
adb: Adb,
|
||||||
path: string,
|
path: string,
|
||||||
options: AdbScrcpyOptions<Pick<ScrcpyOptions1_15.Init, "tunnelForward">>,
|
options: AdbScrcpyOptions<Pick<ScrcpyOptions1_17.Init, "tunnelForward">> &
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
): Promise<ScrcpyEncoder[]> {
|
): Promise<ScrcpyEncoder[]> {
|
||||||
const client = await AdbScrcpyClient.start(adb, path, options);
|
const client = await AdbScrcpyClient.start(adb, path, options);
|
||||||
|
|
||||||
const encoders: ScrcpyEncoder[] = [];
|
const encoders: ScrcpyEncoder[] = [];
|
||||||
|
|
||||||
for await (const line of client.stdout) {
|
for await (const line of client.output) {
|
||||||
const encoder = options.parseEncoder(line);
|
const encoder = options.parseEncoder(line);
|
||||||
if (encoder) {
|
if (encoder) {
|
||||||
encoders.push(encoder);
|
encoders.push(encoder);
|
2
libraries/adb-scrcpy/src/1_17/impl/index.ts
Normal file
2
libraries/adb-scrcpy/src/1_17/impl/index.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export * from "../../1_15/impl/index.js";
|
||||||
|
export { getEncoders } from "./get-encoders.js";
|
1
libraries/adb-scrcpy/src/1_17/index.ts
Normal file
1
libraries/adb-scrcpy/src/1_17/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export * from "./options.js";
|
40
libraries/adb-scrcpy/src/1_17/options.ts
Normal file
40
libraries/adb-scrcpy/src/1_17/options.ts
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_18 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_18 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -6,31 +6,40 @@ import {
|
||||||
createConnection,
|
createConnection,
|
||||||
getDisplays,
|
getDisplays,
|
||||||
getEncoders,
|
getEncoders,
|
||||||
} from "./1_15/impl/index.js";
|
} from "./1_17/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_18
|
||||||
|
extends ScrcpyOptions1_18
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_18.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_18 extends AdbScrcpyOptions<ScrcpyOptions1_18.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_18.Init,
|
init: ScrcpyOptions1_18.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_18(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.18";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_19 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_19 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -6,31 +6,40 @@ import {
|
||||||
createConnection,
|
createConnection,
|
||||||
getDisplays,
|
getDisplays,
|
||||||
getEncoders,
|
getEncoders,
|
||||||
} from "./1_15/impl/index.js";
|
} from "./1_17/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_19
|
||||||
|
extends ScrcpyOptions1_19
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_19.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_19 extends AdbScrcpyOptions<ScrcpyOptions1_19.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_19.Init,
|
init: ScrcpyOptions1_19.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_19(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.19";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_20 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_20 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -6,31 +6,40 @@ import {
|
||||||
createConnection,
|
createConnection,
|
||||||
getDisplays,
|
getDisplays,
|
||||||
getEncoders,
|
getEncoders,
|
||||||
} from "./1_15/impl/index.js";
|
} from "./1_17/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_20
|
||||||
|
extends ScrcpyOptions1_20
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_20.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_20 extends AdbScrcpyOptions<ScrcpyOptions1_20.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_20.Init,
|
init: ScrcpyOptions1_20.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_20(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.20";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_21 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_21 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -6,31 +6,40 @@ import {
|
||||||
createConnection,
|
createConnection,
|
||||||
getDisplays,
|
getDisplays,
|
||||||
getEncoders,
|
getEncoders,
|
||||||
} from "./1_15/impl/index.js";
|
} from "./1_17/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_21
|
||||||
|
extends ScrcpyOptions1_21
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_21.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_21 extends AdbScrcpyOptions<ScrcpyOptions1_21.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_21.Init,
|
init: ScrcpyOptions1_21.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_21(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.21";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
export * from "../../1_15/impl/index.js";
|
export * from "../../1_17/impl/index.js";
|
||||||
export { createConnection } from "./create-connection.js";
|
export { createConnection } from "./create-connection.js";
|
||||||
|
|
|
@ -1,36 +1,45 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_22 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_22 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import {
|
|
||||||
createConnection,
|
|
||||||
getDisplays,
|
|
||||||
getEncoders,
|
|
||||||
} from "../1_15/impl/index.js";
|
|
||||||
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "../connection.js";
|
import type { AdbScrcpyConnection } from "../connection.js";
|
||||||
import { AdbScrcpyOptions } from "../types.js";
|
import type {
|
||||||
|
AdbScrcpyOptions,
|
||||||
|
AdbScrcpyOptionsGetEncoders,
|
||||||
|
} from "../types.js";
|
||||||
|
|
||||||
|
import { createConnection, getDisplays, getEncoders } from "./impl/index.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_22
|
||||||
|
extends ScrcpyOptions1_22
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_22.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_22 extends AdbScrcpyOptions<ScrcpyOptions1_22.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_22.Init,
|
init: ScrcpyOptions1_22.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_22(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.22";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_23 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_23 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,28 +9,37 @@ import {
|
||||||
} from "./1_22/impl/index.js";
|
} from "./1_22/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_23
|
||||||
|
extends ScrcpyOptions1_23
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_23.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_23 extends AdbScrcpyOptions<ScrcpyOptions1_23.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_23.Init,
|
init: ScrcpyOptions1_23.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_23(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.23";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_24 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_24 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,28 +9,37 @@ import {
|
||||||
} from "./1_22/impl/index.js";
|
} from "./1_22/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions1_24
|
||||||
|
extends ScrcpyOptions1_24
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions1_24.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_24 extends AdbScrcpyOptions<ScrcpyOptions1_24.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_24.Init,
|
init: ScrcpyOptions1_24.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_24(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.24";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions1_25 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions1_25 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,28 +9,37 @@ import {
|
||||||
} from "./1_22/impl/index.js";
|
} from "./1_22/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.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;
|
||||||
|
|
||||||
export class AdbScrcpyOptions1_25 extends AdbScrcpyOptions<ScrcpyOptions1_25.Init> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions1_25.Init,
|
init: ScrcpyOptions1_25.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions1_25(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "1.25";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb } from "@yume-chan/adb";
|
||||||
import type { ScrcpyEncoder, ScrcpyOptions1_15 } from "@yume-chan/scrcpy";
|
import type {
|
||||||
|
ScrcpyEncoder,
|
||||||
|
ScrcpyOptions2_0,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
|
} from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import { AdbScrcpyClient, AdbScrcpyExitedError } from "../../client.js";
|
import { AdbScrcpyClient, AdbScrcpyExitedError } from "../../client.js";
|
||||||
import type { AdbScrcpyOptions } from "../../types.js";
|
import type { AdbScrcpyOptions } from "../../types.js";
|
||||||
|
@ -7,7 +11,8 @@ import type { AdbScrcpyOptions } from "../../types.js";
|
||||||
export async function getEncoders(
|
export async function getEncoders(
|
||||||
adb: Adb,
|
adb: Adb,
|
||||||
path: string,
|
path: string,
|
||||||
options: AdbScrcpyOptions<Pick<ScrcpyOptions1_15.Init, "tunnelForward">>,
|
options: AdbScrcpyOptions<Pick<ScrcpyOptions2_0.Init, "tunnelForward">> &
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
): Promise<ScrcpyEncoder[]> {
|
): Promise<ScrcpyEncoder[]> {
|
||||||
try {
|
try {
|
||||||
// Similar to `getDisplays`, now the server won't create video sockets,
|
// Similar to `getDisplays`, now the server won't create video sockets,
|
||||||
|
|
|
@ -1,33 +1,45 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_0 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_0 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "../connection.js";
|
import type { AdbScrcpyConnection } from "../connection.js";
|
||||||
import { AdbScrcpyOptions } from "../types.js";
|
import type {
|
||||||
|
AdbScrcpyOptions,
|
||||||
|
AdbScrcpyOptionsGetEncoders,
|
||||||
|
} from "../types.js";
|
||||||
|
|
||||||
import { createConnection, getDisplays, getEncoders } from "./impl/index.js";
|
import { createConnection, getDisplays, getEncoders } from "./impl/index.js";
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_0 extends AdbScrcpyOptions<ScrcpyOptions2_0.Init> {
|
export class AdbScrcpyOptions2_0
|
||||||
|
extends ScrcpyOptions2_0
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_0.Init>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_0.Init,
|
init: ScrcpyOptions2_0.Init,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_0(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.0";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +1,45 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
import {
|
|
||||||
createConnection,
|
|
||||||
getDisplays,
|
|
||||||
getEncoders,
|
|
||||||
} from "../2_1/impl/index.js";
|
|
||||||
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
import type { AdbScrcpyClientOptions } from "../client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "../connection.js";
|
import type { AdbScrcpyConnection } from "../connection.js";
|
||||||
import { AdbScrcpyOptions } from "../types.js";
|
import type {
|
||||||
|
AdbScrcpyOptions,
|
||||||
|
AdbScrcpyOptionsGetEncoders,
|
||||||
|
} from "../types.js";
|
||||||
|
|
||||||
|
import { createConnection, getDisplays, getEncoders } from "./impl/index.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_1<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_1<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_1.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_1<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_1.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_1.Init<TVideo>,
|
init: ScrcpyOptions2_1.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_1_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_1_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_1_1<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_1_1<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_1_1.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_1_1<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_1_1.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_1_1.Init<TVideo>,
|
init: ScrcpyOptions2_1_1.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_1_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.1.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_2 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_2 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_2<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_2<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_2.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_2<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_2.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_2.Init<TVideo>,
|
init: ScrcpyOptions2_2.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_2(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "v2.2";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_3 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_3 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_3<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_3<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_3.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_3<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_3.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_3.Init<TVideo>,
|
init: ScrcpyOptions2_3.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_3(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.3";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_3_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_3_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_3_1<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_3_1<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_3_1.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_3_1<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_3_1.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_3_1.Init<TVideo>,
|
init: ScrcpyOptions2_3_1.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_3_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.3.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_4 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_4 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_4<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_4<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_4.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_4<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_4.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_4.Init<TVideo>,
|
init: ScrcpyOptions2_4.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_4(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.4";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_5 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_5 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_5<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_5<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_5.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_5<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_5.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_5.Init<TVideo>,
|
init: ScrcpyOptions2_5.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_5(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.5";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_6 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_6 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_6<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_6<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_6.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_6<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_6.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_6.Init<TVideo>,
|
init: ScrcpyOptions2_6.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_6(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.6";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions2_7 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions2_7 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions2_7<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions2_7<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions2_7.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions2_7<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions2_7.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions2_7.Init<TVideo>,
|
init: ScrcpyOptions2_7.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions2_7(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "2.7";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions3_0 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions3_0 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions3_0<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions3_0<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions3_0.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions3_0<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions3_0.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions3_0.Init<TVideo>,
|
init: ScrcpyOptions3_0.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions3_0(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "3.0";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions3_0_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions3_0_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions3_0_1<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions3_0_1<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions3_0_1.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions3_0_1<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions3_0_1.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions3_0_1.Init<TVideo>,
|
init: ScrcpyOptions3_0_1.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions3_0_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "3.0.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions3_0_2 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions3_0_2 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions3_0_2<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions3_0_2<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions3_0_2.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions3_0_2<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions3_0_2.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions3_0_2.Init<TVideo>,
|
init: ScrcpyOptions3_0_2.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions3_0_2(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "3.0.2";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Adb } from "@yume-chan/adb";
|
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptions3_1 } from "@yume-chan/scrcpy";
|
import { ScrcpyOptions3_1 } from "@yume-chan/scrcpy";
|
||||||
|
|
||||||
|
@ -9,30 +9,37 @@ import {
|
||||||
} from "./2_1/impl/index.js";
|
} from "./2_1/impl/index.js";
|
||||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
|
|
||||||
|
export class AdbScrcpyOptions3_1<TVideo extends boolean>
|
||||||
|
extends ScrcpyOptions3_1<TVideo>
|
||||||
|
implements
|
||||||
|
AdbScrcpyOptions<ScrcpyOptions3_1.Init<TVideo>>,
|
||||||
|
AdbScrcpyOptionsGetEncoders
|
||||||
|
{
|
||||||
|
readonly version: string;
|
||||||
|
|
||||||
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
|
|
||||||
export class AdbScrcpyOptions3_1<
|
|
||||||
TVideo extends boolean,
|
|
||||||
> extends AdbScrcpyOptions<ScrcpyOptions3_1.Init<TVideo>> {
|
|
||||||
constructor(
|
constructor(
|
||||||
init: ScrcpyOptions3_1.Init<TVideo>,
|
init: ScrcpyOptions3_1.Init<TVideo>,
|
||||||
clientOptions?: AdbScrcpyClientOptions,
|
clientOptions?: AdbScrcpyClientOptions,
|
||||||
) {
|
) {
|
||||||
super(
|
super(init);
|
||||||
new ScrcpyOptions3_1(init, clientOptions?.version),
|
|
||||||
clientOptions?.spawner,
|
this.version = clientOptions?.version ?? "3.1";
|
||||||
);
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||||
return getEncoders(adb, path, this);
|
return getEncoders(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||||
return getDisplays(adb, path, this);
|
return getDisplays(adb, path, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override createConnection(adb: Adb): AdbScrcpyConnection {
|
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||||
return createConnection(adb, this.value);
|
return createConnection(adb, this.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
import { ExactReadableEndedError } from "@yume-chan/struct";
|
import { ExactReadableEndedError } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
import type { AdbScrcpyOptions } from "./types.js";
|
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||||
import { AdbScrcpyVideoStream } from "./video.js";
|
import { AdbScrcpyVideoStream } from "./video.js";
|
||||||
|
|
||||||
function arrayToStream<T>(array: T[]): ReadableStream<T> {
|
function arrayToStream<T>(array: T[]): ReadableStream<T> {
|
||||||
|
@ -68,7 +68,7 @@ export class AdbScrcpyExitedError extends Error {
|
||||||
interface AdbScrcpyClientInit<TOptions extends AdbScrcpyOptions<object>> {
|
interface AdbScrcpyClientInit<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
options: TOptions;
|
options: TOptions;
|
||||||
process: AdbNoneProtocolProcess;
|
process: AdbNoneProtocolProcess;
|
||||||
stdout: ReadableStream<string>;
|
output: ReadableStream<string>;
|
||||||
|
|
||||||
videoStream: ReadableStream<Uint8Array> | undefined;
|
videoStream: ReadableStream<Uint8Array> | undefined;
|
||||||
audioStream: ReadableStream<Uint8Array> | undefined;
|
audioStream: ReadableStream<Uint8Array> | undefined;
|
||||||
|
@ -188,7 +188,7 @@ export class AdbScrcpyClient<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
return new AdbScrcpyClient({
|
return new AdbScrcpyClient({
|
||||||
options,
|
options,
|
||||||
process,
|
process,
|
||||||
stdout: concatStreams(arrayToStream(lines), output),
|
output: concatStreams(arrayToStream(lines), output),
|
||||||
videoStream: streams.video,
|
videoStream: streams.video,
|
||||||
audioStream: streams.audio,
|
audioStream: streams.audio,
|
||||||
controlStream: streams.control,
|
controlStream: streams.control,
|
||||||
|
@ -208,7 +208,7 @@ export class AdbScrcpyClient<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
static getEncoders(
|
static getEncoders(
|
||||||
adb: Adb,
|
adb: Adb,
|
||||||
path: string,
|
path: string,
|
||||||
options: AdbScrcpyOptions<object>,
|
options: AdbScrcpyOptions<object> & AdbScrcpyOptionsGetEncoders,
|
||||||
): Promise<ScrcpyEncoder[]> {
|
): Promise<ScrcpyEncoder[]> {
|
||||||
options.setListEncoders();
|
options.setListEncoders();
|
||||||
return options.getEncoders(adb, path);
|
return options.getEncoders(adb, path);
|
||||||
|
@ -230,9 +230,9 @@ export class AdbScrcpyClient<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
#options: TOptions;
|
#options: TOptions;
|
||||||
#process: AdbNoneProtocolProcess;
|
#process: AdbNoneProtocolProcess;
|
||||||
|
|
||||||
#stdout: ReadableStream<string>;
|
#output: ReadableStream<string>;
|
||||||
get stdout() {
|
get output() {
|
||||||
return this.#stdout;
|
return this.#output;
|
||||||
}
|
}
|
||||||
|
|
||||||
get exited() {
|
get exited() {
|
||||||
|
@ -290,14 +290,14 @@ export class AdbScrcpyClient<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
constructor({
|
constructor({
|
||||||
options,
|
options,
|
||||||
process,
|
process,
|
||||||
stdout,
|
output,
|
||||||
videoStream,
|
videoStream,
|
||||||
audioStream,
|
audioStream,
|
||||||
controlStream,
|
controlStream,
|
||||||
}: AdbScrcpyClientInit<TOptions>) {
|
}: AdbScrcpyClientInit<TOptions>) {
|
||||||
this.#options = options;
|
this.#options = options;
|
||||||
this.#process = process;
|
this.#process = process;
|
||||||
this.#stdout = stdout;
|
this.#output = output;
|
||||||
|
|
||||||
this.#videoStream = videoStream
|
this.#videoStream = videoStream
|
||||||
? this.#createVideoStream(videoStream)
|
? this.#createVideoStream(videoStream)
|
||||||
|
@ -349,6 +349,12 @@ export class AdbScrcpyClient<TOptions extends AdbScrcpyOptions<object>> {
|
||||||
async #createAudioStream(
|
async #createAudioStream(
|
||||||
initialStream: ReadableStream<Uint8Array>,
|
initialStream: ReadableStream<Uint8Array>,
|
||||||
): Promise<AdbScrcpyAudioStreamMetadata> {
|
): Promise<AdbScrcpyAudioStreamMetadata> {
|
||||||
|
if (!this.#options.parseAudioStreamMetadata) {
|
||||||
|
throw new Error(
|
||||||
|
"parsing audio stream is not supported in this version",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const metadata =
|
const metadata =
|
||||||
await this.#options.parseAudioStreamMetadata(initialStream);
|
await this.#options.parseAudioStreamMetadata(initialStream);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export * from "./1_15/index.js";
|
export * from "./1_15/index.js";
|
||||||
export * from "./1_15_1.js";
|
export * from "./1_15_1.js";
|
||||||
export * from "./1_16.js";
|
export * from "./1_16.js";
|
||||||
export * from "./1_17.js";
|
export * from "./1_17/index.js";
|
||||||
export * from "./1_18.js";
|
export * from "./1_18.js";
|
||||||
export * from "./1_19.js";
|
export * from "./1_19.js";
|
||||||
export * from "./1_20.js";
|
export * from "./1_20.js";
|
||||||
|
|
|
@ -3,27 +3,21 @@ import type {
|
||||||
ScrcpyDisplay,
|
ScrcpyDisplay,
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
} from "@yume-chan/scrcpy";
|
} from "@yume-chan/scrcpy";
|
||||||
import { ScrcpyOptionsWrapper } from "@yume-chan/scrcpy";
|
|
||||||
|
|
||||||
import type { AdbScrcpyConnection } from "./connection.js";
|
import type { AdbScrcpyConnection } from "./connection.js";
|
||||||
|
|
||||||
export abstract class AdbScrcpyOptions<
|
export interface AdbScrcpyOptions<T extends object> extends ScrcpyOptions<T> {
|
||||||
T extends object,
|
readonly version: string;
|
||||||
> extends ScrcpyOptionsWrapper<T> {
|
|
||||||
#spawner: AdbNoneProtocolSpawner | undefined;
|
|
||||||
get spawner() {
|
|
||||||
return this.#spawner;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(base: ScrcpyOptions<T>, spawner?: AdbNoneProtocolSpawner) {
|
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||||
super(base);
|
|
||||||
this.#spawner = spawner;
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]>;
|
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]>;
|
||||||
|
|
||||||
abstract getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]>;
|
createConnection(adb: Adb): AdbScrcpyConnection;
|
||||||
|
}
|
||||||
abstract createConnection(adb: Adb): AdbScrcpyConnection;
|
|
||||||
|
export interface AdbScrcpyOptionsGetEncoders extends ScrcpyOptionsListEncoders {
|
||||||
|
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { EventEmitter } from "@yume-chan/event";
|
import { StickyEventEmitter } from "@yume-chan/event";
|
||||||
import type {
|
import type {
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyVideoStreamMetadata,
|
ScrcpyVideoStreamMetadata,
|
||||||
|
@ -27,7 +27,7 @@ export class AdbScrcpyVideoStream {
|
||||||
return this.#stream;
|
return this.#stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sizeChanged = new EventEmitter<{ width: number; height: number }>();
|
#sizeChanged = new StickyEventEmitter<{ width: number; height: number }>();
|
||||||
get sizeChanged() {
|
get sizeChanged() {
|
||||||
return this.#sizeChanged.event;
|
return this.#sizeChanged.event;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -36,8 +36,6 @@ import {
|
||||||
export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -49,9 +47,8 @@ export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
||||||
return this.#clipboard;
|
return this.#clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init, version = "1.15") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control) {
|
if (this.value.control) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -78,7 +75,7 @@ export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard!.parse(id, stream)) {
|
if (await this.#clipboard!.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_15_1 extends ScrcpyOptions1_15 {
|
export class ScrcpyOptions1_15_1 extends ScrcpyOptions1_15 {
|
||||||
constructor(init: ScrcpyOptions1_15.Init, version = "1.15.1") {
|
constructor(init: ScrcpyOptions1_15.Init) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_16 extends ScrcpyOptions1_15 {
|
export class ScrcpyOptions1_16 extends ScrcpyOptions1_15 {
|
||||||
constructor(init: ScrcpyOptions1_15.Init, version = "1.16") {
|
constructor(init: ScrcpyOptions1_15.Init) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -37,11 +38,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_17 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_17
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -53,9 +54,8 @@ export class ScrcpyOptions1_17 implements ScrcpyOptions<Init> {
|
||||||
return this.#clipboard;
|
return this.#clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init, version = "1.17") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control) {
|
if (this.value.control) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -90,7 +90,7 @@ export class ScrcpyOptions1_17 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard!.parse(id, stream)) {
|
if (await this.#clipboard!.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -37,11 +38,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_18 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_18
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -53,9 +54,8 @@ export class ScrcpyOptions1_18 implements ScrcpyOptions<Init> {
|
||||||
return this.#clipboard;
|
return this.#clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init, version = "1.18") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control) {
|
if (this.value.control) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -90,7 +90,7 @@ export class ScrcpyOptions1_18 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard!.parse(id, stream)) {
|
if (await this.#clipboard!.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_19 extends ScrcpyOptions1_18 {
|
export class ScrcpyOptions1_19 extends ScrcpyOptions1_18 {
|
||||||
constructor(init: ScrcpyOptions1_18.Init, version = "1.19") {
|
constructor(init: ScrcpyOptions1_18.Init) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_20 extends ScrcpyOptions1_18 {
|
export class ScrcpyOptions1_20 extends ScrcpyOptions1_18 {
|
||||||
constructor(init: ScrcpyOptions1_18.Init, version = "1.20") {
|
constructor(init: ScrcpyOptions1_18.Init) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -36,11 +37,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_21 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_21
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -54,9 +55,8 @@ export class ScrcpyOptions1_21 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "1.21") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -92,7 +92,7 @@ export class ScrcpyOptions1_21 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -36,11 +37,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_22 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_22
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -54,9 +55,8 @@ export class ScrcpyOptions1_22 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "1.22") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -92,7 +92,7 @@ export class ScrcpyOptions1_22 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -36,11 +37,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_23 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_23
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -54,9 +55,8 @@ export class ScrcpyOptions1_23 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "1.23") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -92,7 +92,7 @@ export class ScrcpyOptions1_23 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -36,11 +37,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_24 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_24
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -54,9 +55,8 @@ export class ScrcpyOptions1_24 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "1.24") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -92,7 +92,7 @@ export class ScrcpyOptions1_24 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyControlMessageType,
|
ScrcpyControlMessageType,
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -36,11 +37,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions1_25 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions1_25
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -54,9 +55,8 @@ export class ScrcpyOptions1_25 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "1.25") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -92,7 +92,7 @@ export class ScrcpyOptions1_25 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -37,11 +38,11 @@ import {
|
||||||
setListEncoders,
|
setListEncoders,
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_0 implements ScrcpyOptions<Init> {
|
export class ScrcpyOptions2_0
|
||||||
|
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
||||||
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init>;
|
readonly value: Required<Init>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -55,9 +56,8 @@ export class ScrcpyOptions2_0 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init, version = "2.0") {
|
constructor(init: Init) {
|
||||||
this.value = { ...Defaults, ...init };
|
this.value = { ...Defaults, ...init };
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -99,7 +99,7 @@ export class ScrcpyOptions2_0 implements ScrcpyOptions<Init> {
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -38,12 +39,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_1<TVideo extends boolean>
|
export class ScrcpyOptions2_1<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -57,9 +56,8 @@ export class ScrcpyOptions2_1<TVideo extends boolean>
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "2.1") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.control && this.value.clipboardAutosync) {
|
if (this.value.control && this.value.clipboardAutosync) {
|
||||||
this.#clipboard = new ClipboardStream();
|
this.#clipboard = new ClipboardStream();
|
||||||
|
@ -101,7 +99,7 @@ export class ScrcpyOptions2_1<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions2_1 } from "./2_1/index.js";
|
||||||
export class ScrcpyOptions2_1_1<
|
export class ScrcpyOptions2_1_1<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions2_1<TVideo> {
|
> extends ScrcpyOptions2_1<TVideo> {
|
||||||
constructor(init: ScrcpyOptions2_1.Init<TVideo>, version = "2.1.1") {
|
constructor(init: ScrcpyOptions2_1.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -38,12 +39,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_2<TVideo extends boolean>
|
export class ScrcpyOptions2_2<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -57,9 +56,8 @@ export class ScrcpyOptions2_2<TVideo extends boolean>
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "v2.2") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -105,7 +103,7 @@ export class ScrcpyOptions2_2<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -38,12 +39,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_3<TVideo extends boolean>
|
export class ScrcpyOptions2_3<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -57,9 +56,8 @@ export class ScrcpyOptions2_3<TVideo extends boolean>
|
||||||
|
|
||||||
#ackClipboardHandler: AckClipboardHandler | undefined;
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "2.3") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -105,7 +103,7 @@ export class ScrcpyOptions2_3<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions2_3 } from "./2_3/index.js";
|
||||||
export class ScrcpyOptions2_3_1<
|
export class ScrcpyOptions2_3_1<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions2_3<TVideo> {
|
> extends ScrcpyOptions2_3<TVideo> {
|
||||||
constructor(init: ScrcpyOptions2_3.Init<TVideo>, version = "2.3.1") {
|
constructor(init: ScrcpyOptions2_3.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -42,12 +43,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_4<TVideo extends boolean>
|
export class ScrcpyOptions2_4<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -68,9 +67,8 @@ export class ScrcpyOptions2_4<TVideo extends boolean>
|
||||||
return this.#uHidOutput;
|
return this.#uHidOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "2.4") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -120,7 +118,7 @@ export class ScrcpyOptions2_4<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions2_4 } from "./2_4/index.js";
|
||||||
export class ScrcpyOptions2_5<
|
export class ScrcpyOptions2_5<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions2_4<TVideo> {
|
> extends ScrcpyOptions2_4<TVideo> {
|
||||||
constructor(init: ScrcpyOptions2_4.Init<TVideo>, version = "2.5") {
|
constructor(init: ScrcpyOptions2_4.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -42,12 +43,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_6<TVideo extends boolean>
|
export class ScrcpyOptions2_6<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -68,9 +67,8 @@ export class ScrcpyOptions2_6<TVideo extends boolean>
|
||||||
return this.#uHidOutput;
|
return this.#uHidOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "2.6") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -124,7 +122,7 @@ export class ScrcpyOptions2_6<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions2_6 } from "./2_6/index.js";
|
||||||
export class ScrcpyOptions2_6_1<
|
export class ScrcpyOptions2_6_1<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions2_6<TVideo> {
|
> extends ScrcpyOptions2_6<TVideo> {
|
||||||
constructor(init: ScrcpyOptions2_6.Init<TVideo>, version = "2.6.1") {
|
constructor(init: ScrcpyOptions2_6.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -42,12 +43,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions2_7<TVideo extends boolean>
|
export class ScrcpyOptions2_7<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -68,9 +67,8 @@ export class ScrcpyOptions2_7<TVideo extends boolean>
|
||||||
return this.#uHidOutput;
|
return this.#uHidOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "2.7") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -124,7 +122,7 @@ export class ScrcpyOptions2_7<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -42,12 +43,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions3_0<TVideo extends boolean>
|
export class ScrcpyOptions3_0<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -68,9 +67,8 @@ export class ScrcpyOptions3_0<TVideo extends boolean>
|
||||||
return this.#uHidOutput;
|
return this.#uHidOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "3.0") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -124,7 +122,7 @@ export class ScrcpyOptions3_0<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions3_0 } from "./3_0/index.js";
|
||||||
export class ScrcpyOptions3_0_1<
|
export class ScrcpyOptions3_0_1<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions3_0<TVideo> {
|
> extends ScrcpyOptions3_0<TVideo> {
|
||||||
constructor(init: ScrcpyOptions3_0.Init<TVideo>, version = "3.0.1") {
|
constructor(init: ScrcpyOptions3_0.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions3_0 } from "./3_0/index.js";
|
||||||
export class ScrcpyOptions3_0_2<
|
export class ScrcpyOptions3_0_2<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions3_0<TVideo> {
|
> extends ScrcpyOptions3_0<TVideo> {
|
||||||
constructor(init: ScrcpyOptions3_0.Init<TVideo>, version = "3.0.2") {
|
constructor(init: ScrcpyOptions3_0.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyAudioStreamMetadata,
|
ScrcpyAudioStreamMetadata,
|
||||||
|
@ -9,6 +9,7 @@ import type {
|
||||||
ScrcpyEncoder,
|
ScrcpyEncoder,
|
||||||
ScrcpyMediaStreamPacket,
|
ScrcpyMediaStreamPacket,
|
||||||
ScrcpyOptions,
|
ScrcpyOptions,
|
||||||
|
ScrcpyOptionsListEncoders,
|
||||||
ScrcpyScrollController,
|
ScrcpyScrollController,
|
||||||
ScrcpyVideoStream,
|
ScrcpyVideoStream,
|
||||||
} from "../base/index.js";
|
} from "../base/index.js";
|
||||||
|
@ -42,12 +43,10 @@ import {
|
||||||
} from "./impl/index.js";
|
} from "./impl/index.js";
|
||||||
|
|
||||||
export class ScrcpyOptions3_1<TVideo extends boolean>
|
export class ScrcpyOptions3_1<TVideo extends boolean>
|
||||||
implements ScrcpyOptions<Init<TVideo>>
|
implements ScrcpyOptions<Init<TVideo>>, ScrcpyOptionsListEncoders
|
||||||
{
|
{
|
||||||
static readonly Defaults = Defaults;
|
static readonly Defaults = Defaults;
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
|
|
||||||
readonly value: Required<Init<TVideo>>;
|
readonly value: Required<Init<TVideo>>;
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
||||||
|
@ -68,9 +67,8 @@ export class ScrcpyOptions3_1<TVideo extends boolean>
|
||||||
return this.#uHidOutput;
|
return this.#uHidOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(init: Init<TVideo>, version = "3.1") {
|
constructor(init: Init<TVideo>) {
|
||||||
this.value = { ...Defaults, ...init } as never;
|
this.value = { ...Defaults, ...init } as never;
|
||||||
this.version = version;
|
|
||||||
|
|
||||||
if (this.value.videoSource === "camera") {
|
if (this.value.videoSource === "camera") {
|
||||||
this.value.control = false;
|
this.value.control = false;
|
||||||
|
@ -124,7 +122,7 @@ export class ScrcpyOptions3_1<TVideo extends boolean>
|
||||||
|
|
||||||
async parseDeviceMessage(
|
async parseDeviceMessage(
|
||||||
id: number,
|
id: number,
|
||||||
stream: AsyncExactReadable,
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.#clipboard?.parse(id, stream)) {
|
if (await this.#clipboard?.parse(id, stream)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ScrcpyBackOrScreenOnControlMessage,
|
ScrcpyBackOrScreenOnControlMessage,
|
||||||
|
@ -19,8 +19,6 @@ import type { ScrcpyScrollController } from "./scroll-controller.js";
|
||||||
import type { ScrcpyVideoStream } from "./video.js";
|
import type { ScrcpyVideoStream } from "./video.js";
|
||||||
|
|
||||||
export interface ScrcpyOptions<T extends object> {
|
export interface ScrcpyOptions<T extends object> {
|
||||||
get version(): string;
|
|
||||||
|
|
||||||
get controlMessageTypes(): readonly ScrcpyControlMessageType[];
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[];
|
||||||
|
|
||||||
value: Required<T>;
|
value: Required<T>;
|
||||||
|
@ -37,10 +35,6 @@ export interface ScrcpyOptions<T extends object> {
|
||||||
|
|
||||||
parseDisplay(line: string): ScrcpyDisplay | undefined;
|
parseDisplay(line: string): ScrcpyDisplay | undefined;
|
||||||
|
|
||||||
setListEncoders?(): void;
|
|
||||||
|
|
||||||
parseEncoder?(line: string): ScrcpyEncoder | undefined;
|
|
||||||
|
|
||||||
parseVideoStreamMetadata(
|
parseVideoStreamMetadata(
|
||||||
stream: ReadableStream<Uint8Array>,
|
stream: ReadableStream<Uint8Array>,
|
||||||
): MaybePromiseLike<ScrcpyVideoStream>;
|
): MaybePromiseLike<ScrcpyVideoStream>;
|
||||||
|
@ -49,7 +43,10 @@ export interface ScrcpyOptions<T extends object> {
|
||||||
stream: ReadableStream<Uint8Array>,
|
stream: ReadableStream<Uint8Array>,
|
||||||
): MaybePromiseLike<ScrcpyAudioStreamMetadata>;
|
): MaybePromiseLike<ScrcpyAudioStreamMetadata>;
|
||||||
|
|
||||||
parseDeviceMessage(id: number, stream: AsyncExactReadable): Promise<void>;
|
parseDeviceMessage(
|
||||||
|
id: number,
|
||||||
|
stream: ExactReadable | AsyncExactReadable,
|
||||||
|
): Promise<void>;
|
||||||
|
|
||||||
endDeviceMessageStream(e?: unknown): void;
|
endDeviceMessageStream(e?: unknown): void;
|
||||||
|
|
||||||
|
@ -76,3 +73,9 @@ export interface ScrcpyOptions<T extends object> {
|
||||||
message: ScrcpyUHidCreateControlMessage,
|
message: ScrcpyUHidCreateControlMessage,
|
||||||
): Uint8Array;
|
): Uint8Array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ScrcpyOptionsListEncoders {
|
||||||
|
setListEncoders(): void;
|
||||||
|
|
||||||
|
parseEncoder(line: string): ScrcpyEncoder | undefined;
|
||||||
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { ScrcpyOptions3_1 } from "./3_1/options.js";
|
||||||
export class ScrcpyOptionsLatest<
|
export class ScrcpyOptionsLatest<
|
||||||
TVideo extends boolean,
|
TVideo extends boolean,
|
||||||
> extends ScrcpyOptions3_1<TVideo> {
|
> extends ScrcpyOptions3_1<TVideo> {
|
||||||
constructor(init: ScrcpyOptions3_1.Init<TVideo>, version: string) {
|
constructor(init: ScrcpyOptions3_1.Init<TVideo>) {
|
||||||
super(init, version);
|
super(init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
export * from "./clamp.js";
|
export * from "./clamp.js";
|
||||||
export * from "./constants.js";
|
export * from "./constants.js";
|
||||||
export * from "./omit.js";
|
export * from "./omit.js";
|
||||||
export * from "./wrapper.js";
|
|
||||||
|
|
|
@ -1,135 +0,0 @@
|
||||||
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
||||||
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
||||||
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
||||||
|
|
||||||
import type { ScrcpyAudioStreamMetadata } from "../base/audio.js";
|
|
||||||
import type { ScrcpyEncoder } from "../base/encoder.js";
|
|
||||||
import type { ScrcpyMediaStreamPacket } from "../base/media.js";
|
|
||||||
import type { ScrcpyOptions } from "../base/options.js";
|
|
||||||
import type { ScrcpyScrollController } from "../base/scroll-controller.js";
|
|
||||||
import type { ScrcpyVideoStream } from "../base/video.js";
|
|
||||||
import type {
|
|
||||||
ScrcpyBackOrScreenOnControlMessage,
|
|
||||||
ScrcpyInjectTouchControlMessage,
|
|
||||||
ScrcpySetClipboardControlMessage,
|
|
||||||
ScrcpyUHidCreateControlMessage,
|
|
||||||
} from "../latest.js";
|
|
||||||
|
|
||||||
export class ScrcpyOptionsWrapper<T extends object>
|
|
||||||
implements ScrcpyOptions<T>
|
|
||||||
{
|
|
||||||
#base: ScrcpyOptions<T>;
|
|
||||||
|
|
||||||
get version() {
|
|
||||||
return this.#base.version;
|
|
||||||
}
|
|
||||||
|
|
||||||
get controlMessageTypes() {
|
|
||||||
return this.#base.controlMessageTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
get value() {
|
|
||||||
return this.#base.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
get clipboard() {
|
|
||||||
return this.#base.clipboard;
|
|
||||||
}
|
|
||||||
|
|
||||||
get uHidOutput() {
|
|
||||||
return this.#base.uHidOutput;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(base: ScrcpyOptions<T>) {
|
|
||||||
this.#base = base;
|
|
||||||
}
|
|
||||||
|
|
||||||
serialize(): string[] {
|
|
||||||
return this.#base.serialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
setListDisplays() {
|
|
||||||
this.#base.setListDisplays();
|
|
||||||
}
|
|
||||||
|
|
||||||
parseDisplay(line: string) {
|
|
||||||
return this.#base.parseDisplay(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
setListEncoders(): void {
|
|
||||||
if (!this.#base.setListEncoders) {
|
|
||||||
throw new Error("setListEncoders is not implemented");
|
|
||||||
}
|
|
||||||
this.#base.setListEncoders();
|
|
||||||
}
|
|
||||||
|
|
||||||
parseEncoder(line: string): ScrcpyEncoder | undefined {
|
|
||||||
if (!this.#base.parseEncoder) {
|
|
||||||
throw new Error("parseEncoder is not implemented");
|
|
||||||
}
|
|
||||||
return this.#base.parseEncoder(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
parseVideoStreamMetadata(
|
|
||||||
stream: ReadableStream<Uint8Array>,
|
|
||||||
): MaybePromiseLike<ScrcpyVideoStream> {
|
|
||||||
return this.#base.parseVideoStreamMetadata(stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
parseAudioStreamMetadata(
|
|
||||||
stream: ReadableStream<Uint8Array>,
|
|
||||||
): MaybePromiseLike<ScrcpyAudioStreamMetadata> {
|
|
||||||
if (!this.#base.parseAudioStreamMetadata) {
|
|
||||||
throw new Error("parseAudioStreamMetadata is not implemented");
|
|
||||||
}
|
|
||||||
return this.#base.parseAudioStreamMetadata(stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
parseDeviceMessage(id: number, stream: AsyncExactReadable): Promise<void> {
|
|
||||||
return this.#base.parseDeviceMessage(id, stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
endDeviceMessageStream(e?: unknown): void {
|
|
||||||
this.#base.endDeviceMessageStream(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
createMediaStreamTransformer(): TransformStream<
|
|
||||||
Uint8Array,
|
|
||||||
ScrcpyMediaStreamPacket
|
|
||||||
> {
|
|
||||||
return this.#base.createMediaStreamTransformer();
|
|
||||||
}
|
|
||||||
|
|
||||||
serializeInjectTouchControlMessage(
|
|
||||||
message: ScrcpyInjectTouchControlMessage,
|
|
||||||
): Uint8Array {
|
|
||||||
return this.#base.serializeInjectTouchControlMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
serializeBackOrScreenOnControlMessage(
|
|
||||||
message: ScrcpyBackOrScreenOnControlMessage,
|
|
||||||
): Uint8Array | undefined {
|
|
||||||
return this.#base.serializeBackOrScreenOnControlMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
serializeSetClipboardControlMessage(
|
|
||||||
message: ScrcpySetClipboardControlMessage,
|
|
||||||
): Uint8Array | [Uint8Array, Promise<void>] {
|
|
||||||
return this.#base.serializeSetClipboardControlMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
createScrollController(): ScrcpyScrollController {
|
|
||||||
return this.#base.createScrollController();
|
|
||||||
}
|
|
||||||
|
|
||||||
serializeUHidCreateControlMessage(
|
|
||||||
message: ScrcpyUHidCreateControlMessage,
|
|
||||||
): Uint8Array {
|
|
||||||
if (!this.#base.serializeUHidCreateControlMessage) {
|
|
||||||
throw new Error(
|
|
||||||
"serializeUHidCreateControlMessage is not implemented",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return this.#base.serializeUHidCreateControlMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue