@yume-chan/scrcpy 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/esm/1_15/impl/defaults.d.ts +1 -2
- package/esm/1_15/impl/defaults.d.ts.map +1 -1
- package/esm/1_15/impl/defaults.js +2 -2
- package/esm/1_15/impl/defaults.js.map +1 -1
- package/esm/1_15/impl/init.d.ts +10 -2
- package/esm/1_15/impl/init.d.ts.map +1 -1
- package/esm/1_15/impl/init.js +15 -0
- package/esm/1_15/impl/init.js.map +1 -1
- package/esm/1_15/options.d.ts +3 -2
- package/esm/1_15/options.d.ts.map +1 -1
- package/esm/1_15/options.js +3 -1
- package/esm/1_15/options.js.map +1 -1
- package/esm/1_15_1.d.ts +6 -0
- package/esm/1_15_1.d.ts.map +1 -0
- package/esm/1_15_1.js +8 -0
- package/esm/1_15_1.js.map +1 -0
- package/esm/1_16.d.ts +5 -1
- package/esm/1_16.d.ts.map +1 -1
- package/esm/1_16.js +7 -1
- package/esm/1_16.js.map +1 -1
- package/esm/1_17/impl/defaults.d.ts +1 -2
- package/esm/1_17/impl/defaults.d.ts.map +1 -1
- package/esm/1_17/options.d.ts +3 -2
- package/esm/1_17/options.d.ts.map +1 -1
- package/esm/1_17/options.js +3 -1
- package/esm/1_17/options.js.map +1 -1
- package/esm/1_18/impl/defaults.d.ts +1 -2
- package/esm/1_18/impl/defaults.d.ts.map +1 -1
- package/esm/1_18/options.d.ts +3 -2
- package/esm/1_18/options.d.ts.map +1 -1
- package/esm/1_18/options.js +3 -1
- package/esm/1_18/options.js.map +1 -1
- package/esm/1_19.d.ts +5 -1
- package/esm/1_19.d.ts.map +1 -1
- package/esm/1_19.js +7 -1
- package/esm/1_19.js.map +1 -1
- package/esm/1_20.d.ts +5 -1
- package/esm/1_20.d.ts.map +1 -1
- package/esm/1_20.js +7 -1
- package/esm/1_20.js.map +1 -1
- package/esm/1_21/impl/defaults.d.ts +1 -2
- package/esm/1_21/impl/defaults.d.ts.map +1 -1
- package/esm/1_21/options.d.ts +3 -2
- package/esm/1_21/options.d.ts.map +1 -1
- package/esm/1_21/options.js +3 -1
- package/esm/1_21/options.js.map +1 -1
- package/esm/1_22/impl/defaults.d.ts +1 -2
- package/esm/1_22/impl/defaults.d.ts.map +1 -1
- package/esm/1_22/impl/index.d.ts +1 -1
- package/esm/1_22/impl/index.d.ts.map +1 -1
- package/esm/1_22/impl/index.js +1 -1
- package/esm/1_22/impl/index.js.map +1 -1
- package/esm/1_22/impl/scroll-controller.d.ts +2 -0
- package/esm/1_22/impl/scroll-controller.d.ts.map +1 -1
- package/esm/1_22/impl/scroll-controller.js +3 -0
- package/esm/1_22/impl/scroll-controller.js.map +1 -1
- package/esm/1_22/options.d.ts +3 -2
- package/esm/1_22/options.d.ts.map +1 -1
- package/esm/1_22/options.js +3 -1
- package/esm/1_22/options.js.map +1 -1
- package/esm/1_23/impl/defaults.d.ts +1 -2
- package/esm/1_23/impl/defaults.d.ts.map +1 -1
- package/esm/1_23/options.d.ts +3 -2
- package/esm/1_23/options.d.ts.map +1 -1
- package/esm/1_23/options.js +3 -1
- package/esm/1_23/options.js.map +1 -1
- package/esm/1_24/impl/defaults.d.ts +1 -2
- package/esm/1_24/impl/defaults.d.ts.map +1 -1
- package/esm/1_24/options.d.ts +3 -2
- package/esm/1_24/options.d.ts.map +1 -1
- package/esm/1_24/options.js +3 -1
- package/esm/1_24/options.js.map +1 -1
- package/esm/1_25/impl/index.d.ts +1 -1
- package/esm/1_25/impl/index.d.ts.map +1 -1
- package/esm/1_25/impl/index.js +1 -1
- package/esm/1_25/impl/index.js.map +1 -1
- package/esm/1_25/impl/scroll-controller.d.ts +1 -0
- package/esm/1_25/impl/scroll-controller.d.ts.map +1 -1
- package/esm/1_25/impl/scroll-controller.js +3 -0
- package/esm/1_25/impl/scroll-controller.js.map +1 -1
- package/esm/1_25/options.d.ts +3 -2
- package/esm/1_25/options.d.ts.map +1 -1
- package/esm/1_25/options.js +3 -1
- package/esm/1_25/options.js.map +1 -1
- package/esm/2_0/impl/defaults.d.ts +4 -6
- package/esm/2_0/impl/defaults.d.ts.map +1 -1
- package/esm/2_0/impl/defaults.js +3 -4
- package/esm/2_0/impl/defaults.js.map +1 -1
- package/esm/2_0/impl/init.d.ts +3 -3
- package/esm/2_0/impl/init.d.ts.map +1 -1
- package/esm/2_0/options.d.ts +6 -5
- package/esm/2_0/options.d.ts.map +1 -1
- package/esm/2_0/options.js +3 -1
- package/esm/2_0/options.js.map +1 -1
- package/esm/2_1/impl/defaults.d.ts +4 -5
- package/esm/2_1/impl/defaults.d.ts.map +1 -1
- package/esm/2_1/options.d.ts +6 -5
- package/esm/2_1/options.d.ts.map +1 -1
- package/esm/2_1/options.js +3 -1
- package/esm/2_1/options.js.map +1 -1
- package/esm/2_1_1.d.ts +6 -0
- package/esm/2_1_1.d.ts.map +1 -0
- package/esm/2_1_1.js +8 -0
- package/esm/2_1_1.js.map +1 -0
- package/esm/2_2/impl/defaults.d.ts +4 -5
- package/esm/2_2/impl/defaults.d.ts.map +1 -1
- package/esm/2_2/options.d.ts +6 -5
- package/esm/2_2/options.d.ts.map +1 -1
- package/esm/2_2/options.js +3 -1
- package/esm/2_2/options.js.map +1 -1
- package/esm/2_3/options.d.ts +6 -5
- package/esm/2_3/options.d.ts.map +1 -1
- package/esm/2_3/options.js +3 -1
- package/esm/2_3/options.js.map +1 -1
- package/esm/2_3_1.d.ts +6 -0
- package/esm/2_3_1.d.ts.map +1 -0
- package/esm/2_3_1.js +8 -0
- package/esm/2_3_1.js.map +1 -0
- package/esm/2_4/options.d.ts +6 -5
- package/esm/2_4/options.d.ts.map +1 -1
- package/esm/2_4/options.js +3 -1
- package/esm/2_4/options.js.map +1 -1
- package/esm/2_5.d.ts +5 -1
- package/esm/2_5.d.ts.map +1 -1
- package/esm/2_5.js +7 -1
- package/esm/2_5.js.map +1 -1
- package/esm/2_6/impl/defaults.d.ts +4 -5
- package/esm/2_6/impl/defaults.d.ts.map +1 -1
- package/esm/2_6/options.d.ts +6 -5
- package/esm/2_6/options.d.ts.map +1 -1
- package/esm/2_6/options.js +3 -1
- package/esm/2_6/options.js.map +1 -1
- package/esm/2_6_1.d.ts +6 -0
- package/esm/2_6_1.d.ts.map +1 -0
- package/esm/2_6_1.js +8 -0
- package/esm/2_6_1.js.map +1 -0
- package/esm/2_7/options.d.ts +6 -5
- package/esm/2_7/options.d.ts.map +1 -1
- package/esm/2_7/options.js +3 -1
- package/esm/2_7/options.js.map +1 -1
- package/esm/3_0/impl/defaults.d.ts +5 -7
- package/esm/3_0/impl/defaults.d.ts.map +1 -1
- package/esm/3_0/impl/defaults.js +1 -2
- package/esm/3_0/impl/defaults.js.map +1 -1
- package/esm/3_0/impl/init.d.ts +2 -2
- package/esm/3_0/impl/init.d.ts.map +1 -1
- package/esm/3_0/options.d.ts +7 -6
- package/esm/3_0/options.d.ts.map +1 -1
- package/esm/3_0/options.js +3 -1
- package/esm/3_0/options.js.map +1 -1
- package/esm/3_0_1.d.ts +6 -0
- package/esm/3_0_1.d.ts.map +1 -0
- package/esm/3_0_1.js +8 -0
- package/esm/3_0_1.js.map +1 -0
- package/esm/3_0_2.d.ts +6 -0
- package/esm/3_0_2.d.ts.map +1 -0
- package/esm/3_0_2.js +8 -0
- package/esm/3_0_2.js.map +1 -0
- package/esm/3_1/impl/defaults.d.ts +56 -0
- package/esm/3_1/impl/defaults.d.ts.map +1 -0
- package/esm/3_1/impl/defaults.js +6 -0
- package/esm/3_1/impl/defaults.js.map +1 -0
- package/esm/3_1/impl/index.d.ts +5 -0
- package/esm/3_1/impl/index.d.ts.map +1 -0
- package/esm/3_1/impl/index.js +4 -0
- package/esm/3_1/impl/index.js.map +1 -0
- package/esm/3_1/impl/init.d.ts +5 -0
- package/esm/3_1/impl/init.d.ts.map +1 -0
- package/esm/3_1/impl/init.js +2 -0
- package/esm/3_1/impl/init.js.map +1 -0
- package/esm/3_1/impl/prev.d.ts +2 -0
- package/esm/3_1/impl/prev.d.ts.map +1 -0
- package/esm/3_1/impl/prev.js +2 -0
- package/esm/3_1/impl/prev.js.map +1 -0
- package/esm/3_1/impl/serialize-uhid-create.d.ts +20 -0
- package/esm/3_1/impl/serialize-uhid-create.d.ts.map +1 -0
- package/esm/3_1/impl/serialize-uhid-create.js +14 -0
- package/esm/3_1/impl/serialize-uhid-create.js.map +1 -0
- package/esm/3_1/index.d.ts +3 -0
- package/esm/3_1/index.d.ts.map +1 -0
- package/esm/3_1/index.js +3 -0
- package/esm/3_1/index.js.map +1 -0
- package/esm/3_1/options.d.ts +91 -0
- package/esm/3_1/options.d.ts.map +1 -0
- package/esm/3_1/options.js +94 -0
- package/esm/3_1/options.js.map +1 -0
- package/esm/base/option-value.js +2 -2
- package/esm/base/option-value.js.map +1 -1
- package/esm/base/options.d.ts +1 -0
- package/esm/base/options.d.ts.map +1 -1
- package/esm/index.d.ts +7 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +7 -0
- package/esm/index.js.map +1 -1
- package/esm/latest.d.ts +6 -1
- package/esm/latest.d.ts.map +1 -1
- package/esm/latest.js +8 -1
- package/esm/latest.js.map +1 -1
- package/esm/utils/wrapper.d.ts +1 -0
- package/esm/utils/wrapper.d.ts.map +1 -1
- package/esm/utils/wrapper.js +3 -0
- package/esm/utils/wrapper.js.map +1 -1
- package/package.json +5 -5
- package/src/1_15/impl/defaults.ts +2 -2
- package/src/1_15/impl/init.ts +20 -2
- package/src/1_15/options.ts +4 -1
- package/src/1_15_1.ts +9 -0
- package/src/1_16.ts +9 -4
- package/src/1_17/options.ts +4 -1
- package/src/1_18/options.ts +4 -1
- package/src/1_19.ts +9 -4
- package/src/1_20.ts +9 -4
- package/src/1_21/options.ts +4 -1
- package/src/1_22/impl/index.ts +1 -0
- package/src/1_22/impl/scroll-controller.ts +5 -0
- package/src/1_22/options.ts +4 -1
- package/src/1_23/options.ts +4 -1
- package/src/1_24/options.ts +4 -1
- package/src/1_25/impl/index.ts +1 -0
- package/src/1_25/impl/scroll-controller.ts +5 -1
- package/src/1_25/options.ts +4 -1
- package/src/2_0/impl/defaults.ts +3 -4
- package/src/2_0/impl/init.ts +3 -3
- package/src/2_0/options.ts +4 -1
- package/src/2_1/options.ts +4 -1
- package/src/2_1_1.ts +9 -0
- package/src/2_2/options.ts +4 -1
- package/src/2_3/options.ts +4 -1
- package/src/2_3_1.ts +9 -0
- package/src/2_4/options.ts +4 -1
- package/src/2_5.ts +9 -4
- package/src/2_6/options.ts +5 -2
- package/src/2_6_1.ts +9 -0
- package/src/2_7/options.ts +4 -1
- package/src/3_0/impl/defaults.ts +1 -2
- package/src/3_0/impl/init.ts +2 -2
- package/src/3_0/options.ts +4 -1
- package/src/3_0_1.ts +9 -0
- package/src/3_0_2.ts +9 -0
- package/src/3_1/impl/defaults.ts +8 -0
- package/src/3_1/impl/index.ts +7 -0
- package/src/3_1/impl/init.ts +5 -0
- package/src/3_1/impl/prev.ts +1 -0
- package/src/3_1/impl/serialize-uhid-create.ts +28 -0
- package/src/3_1/index.ts +2 -0
- package/src/3_1/options.ts +190 -0
- package/src/base/option-value.ts +2 -2
- package/src/base/options.ts +2 -0
- package/src/index.ts +7 -0
- package/src/latest.ts +12 -1
- package/src/utils/wrapper.ts +4 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/src/1_25/options.ts
CHANGED
|
@@ -39,6 +39,8 @@ import {
|
|
|
39
39
|
export class ScrcpyOptions1_25 implements ScrcpyOptions<Init> {
|
|
40
40
|
static readonly Defaults = Defaults;
|
|
41
41
|
|
|
42
|
+
readonly version: string;
|
|
43
|
+
|
|
42
44
|
readonly value: Required<Init>;
|
|
43
45
|
|
|
44
46
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -52,8 +54,9 @@ export class ScrcpyOptions1_25 implements ScrcpyOptions<Init> {
|
|
|
52
54
|
|
|
53
55
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
54
56
|
|
|
55
|
-
constructor(init: Init) {
|
|
57
|
+
constructor(init: Init, version = "1.25") {
|
|
56
58
|
this.value = { ...Defaults, ...init };
|
|
59
|
+
this.version = version;
|
|
57
60
|
|
|
58
61
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
59
62
|
this.#clipboard = new ClipboardStream();
|
package/src/2_0/impl/defaults.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { omit } from "../../utils/index.js";
|
|
2
2
|
|
|
3
3
|
import type { Init } from "./init.js";
|
|
4
|
-
import { InstanceId } from "./init.js";
|
|
5
4
|
import { PrevImpl } from "./prev.js";
|
|
6
5
|
|
|
7
6
|
export const Defaults = /* #__PURE__ */ (() =>
|
|
8
7
|
({
|
|
9
8
|
...omit(PrevImpl.Defaults, "bitRate", "codecOptions", "encoderName"),
|
|
10
|
-
scid:
|
|
9
|
+
scid: undefined,
|
|
11
10
|
|
|
12
11
|
videoCodec: "h264",
|
|
13
12
|
videoBitRate: 8000000,
|
|
14
|
-
videoCodecOptions:
|
|
13
|
+
videoCodecOptions: undefined,
|
|
15
14
|
videoEncoder: undefined,
|
|
16
15
|
|
|
17
16
|
audio: true,
|
|
18
17
|
audioCodec: "opus",
|
|
19
18
|
audioBitRate: 128000,
|
|
20
|
-
audioCodecOptions:
|
|
19
|
+
audioCodecOptions: undefined,
|
|
21
20
|
audioEncoder: undefined,
|
|
22
21
|
|
|
23
22
|
listEncoders: false,
|
package/src/2_0/impl/init.ts
CHANGED
|
@@ -26,17 +26,17 @@ export class InstanceId implements ScrcpyOptionValue {
|
|
|
26
26
|
|
|
27
27
|
export interface Init
|
|
28
28
|
extends Omit<PrevImpl.Init, "bitRate" | "codecOptions" | "encoderName"> {
|
|
29
|
-
scid?: InstanceId;
|
|
29
|
+
scid?: InstanceId | string | undefined;
|
|
30
30
|
|
|
31
31
|
videoCodec?: "h264" | "h265" | "av1";
|
|
32
32
|
videoBitRate?: number;
|
|
33
|
-
videoCodecOptions?: PrevImpl.CodecOptions;
|
|
33
|
+
videoCodecOptions?: PrevImpl.CodecOptions | string | undefined;
|
|
34
34
|
videoEncoder?: string | undefined;
|
|
35
35
|
|
|
36
36
|
audio?: boolean;
|
|
37
37
|
audioCodec?: "raw" | "opus" | "aac";
|
|
38
38
|
audioBitRate?: number;
|
|
39
|
-
audioCodecOptions?: PrevImpl.CodecOptions;
|
|
39
|
+
audioCodecOptions?: PrevImpl.CodecOptions | string | undefined;
|
|
40
40
|
audioEncoder?: string | undefined;
|
|
41
41
|
|
|
42
42
|
listEncoders?: boolean;
|
package/src/2_0/options.ts
CHANGED
|
@@ -40,6 +40,8 @@ import {
|
|
|
40
40
|
export class ScrcpyOptions2_0 implements ScrcpyOptions<Init> {
|
|
41
41
|
static readonly Defaults = Defaults;
|
|
42
42
|
|
|
43
|
+
readonly version: string;
|
|
44
|
+
|
|
43
45
|
readonly value: Required<Init>;
|
|
44
46
|
|
|
45
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,8 +55,9 @@ export class ScrcpyOptions2_0 implements ScrcpyOptions<Init> {
|
|
|
53
55
|
|
|
54
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
55
57
|
|
|
56
|
-
constructor(init: Init) {
|
|
58
|
+
constructor(init: Init, version = "2.0") {
|
|
57
59
|
this.value = { ...Defaults, ...init };
|
|
60
|
+
this.version = version;
|
|
58
61
|
|
|
59
62
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
60
63
|
this.#clipboard = new ClipboardStream();
|
package/src/2_1/options.ts
CHANGED
|
@@ -40,6 +40,8 @@ import {
|
|
|
40
40
|
export class ScrcpyOptions2_1 implements ScrcpyOptions<Init> {
|
|
41
41
|
static readonly Defaults = Defaults;
|
|
42
42
|
|
|
43
|
+
readonly version: string;
|
|
44
|
+
|
|
43
45
|
readonly value: Required<Init>;
|
|
44
46
|
|
|
45
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,8 +55,9 @@ export class ScrcpyOptions2_1 implements ScrcpyOptions<Init> {
|
|
|
53
55
|
|
|
54
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
55
57
|
|
|
56
|
-
constructor(init: Init) {
|
|
58
|
+
constructor(init: Init, version = "2.1") {
|
|
57
59
|
this.value = { ...Defaults, ...init };
|
|
60
|
+
this.version = version;
|
|
58
61
|
|
|
59
62
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
60
63
|
this.#clipboard = new ClipboardStream();
|
package/src/2_1_1.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrcpyOptions2_1 } from "./2_1/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions2_1_1 extends ScrcpyOptions2_1 {
|
|
4
|
+
constructor(init: ScrcpyOptions2_1.Init, version = "2.1.1") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions2_1Impl as ScrcpyOptions2_1_1Impl } from "./2_1/index.js";
|
package/src/2_2/options.ts
CHANGED
|
@@ -40,6 +40,8 @@ import {
|
|
|
40
40
|
export class ScrcpyOptions2_2 implements ScrcpyOptions<Init> {
|
|
41
41
|
static readonly Defaults = Defaults;
|
|
42
42
|
|
|
43
|
+
readonly version: string;
|
|
44
|
+
|
|
43
45
|
readonly value: Required<Init>;
|
|
44
46
|
|
|
45
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,8 +55,9 @@ export class ScrcpyOptions2_2 implements ScrcpyOptions<Init> {
|
|
|
53
55
|
|
|
54
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
55
57
|
|
|
56
|
-
constructor(init: Init) {
|
|
58
|
+
constructor(init: Init, version = "v2.2") {
|
|
57
59
|
this.value = { ...Defaults, ...init };
|
|
60
|
+
this.version = version;
|
|
58
61
|
|
|
59
62
|
if (this.value.videoSource === "camera") {
|
|
60
63
|
this.value.control = false;
|
package/src/2_3/options.ts
CHANGED
|
@@ -40,6 +40,8 @@ import {
|
|
|
40
40
|
export class ScrcpyOptions2_3 implements ScrcpyOptions<Init> {
|
|
41
41
|
static readonly Defaults = Defaults;
|
|
42
42
|
|
|
43
|
+
readonly version: string;
|
|
44
|
+
|
|
43
45
|
readonly value: Required<Init>;
|
|
44
46
|
|
|
45
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,8 +55,9 @@ export class ScrcpyOptions2_3 implements ScrcpyOptions<Init> {
|
|
|
53
55
|
|
|
54
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
55
57
|
|
|
56
|
-
constructor(init: Init) {
|
|
58
|
+
constructor(init: Init, version = "2.3") {
|
|
57
59
|
this.value = { ...Defaults, ...init };
|
|
60
|
+
this.version = version;
|
|
58
61
|
|
|
59
62
|
if (this.value.videoSource === "camera") {
|
|
60
63
|
this.value.control = false;
|
package/src/2_3_1.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrcpyOptions2_3 } from "./2_3/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions2_3_1 extends ScrcpyOptions2_3 {
|
|
4
|
+
constructor(init: ScrcpyOptions2_3.Init, version = "2.3.1") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions2_3Impl as ScrcpyOptions2_3_1Impl } from "./2_3/index.js";
|
package/src/2_4/options.ts
CHANGED
|
@@ -44,6 +44,8 @@ import {
|
|
|
44
44
|
export class ScrcpyOptions2_4 implements ScrcpyOptions<Init> {
|
|
45
45
|
static readonly Defaults = Defaults;
|
|
46
46
|
|
|
47
|
+
readonly version: string;
|
|
48
|
+
|
|
47
49
|
readonly value: Required<Init>;
|
|
48
50
|
|
|
49
51
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -64,8 +66,9 @@ export class ScrcpyOptions2_4 implements ScrcpyOptions<Init> {
|
|
|
64
66
|
return this.#uHidOutput;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
constructor(init: Init) {
|
|
69
|
+
constructor(init: Init, version = "2.4") {
|
|
68
70
|
this.value = { ...Defaults, ...init };
|
|
71
|
+
this.version = version;
|
|
69
72
|
|
|
70
73
|
if (this.value.videoSource === "camera") {
|
|
71
74
|
this.value.control = false;
|
package/src/2_5.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ScrcpyOptions2_4 } from "./2_4/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions2_5 extends ScrcpyOptions2_4 {
|
|
4
|
+
constructor(init: ScrcpyOptions2_4.Init, version = "2.5") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions2_4Impl as ScrcpyOptions2_5Impl } from "./2_4/index.js";
|
package/src/2_6/options.ts
CHANGED
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
ScrcpyUHidOutputDeviceMessage,
|
|
21
21
|
} from "../latest.js";
|
|
22
22
|
|
|
23
|
+
import type { Init } from "./impl/index.js";
|
|
23
24
|
import {
|
|
24
25
|
AckClipboardHandler,
|
|
25
26
|
ClipboardStream,
|
|
@@ -39,11 +40,12 @@ import {
|
|
|
39
40
|
setListEncoders,
|
|
40
41
|
UHidOutputStream,
|
|
41
42
|
} from "./impl/index.js";
|
|
42
|
-
import type { Init } from "./impl/index.js";
|
|
43
43
|
|
|
44
44
|
export class ScrcpyOptions2_6 implements ScrcpyOptions<Init> {
|
|
45
45
|
static readonly Defaults = Defaults;
|
|
46
46
|
|
|
47
|
+
readonly version: string;
|
|
48
|
+
|
|
47
49
|
readonly value: Required<Init>;
|
|
48
50
|
|
|
49
51
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -64,8 +66,9 @@ export class ScrcpyOptions2_6 implements ScrcpyOptions<Init> {
|
|
|
64
66
|
return this.#uHidOutput;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
constructor(init: Init) {
|
|
69
|
+
constructor(init: Init, version = "2.6") {
|
|
68
70
|
this.value = { ...Defaults, ...init };
|
|
71
|
+
this.version = version;
|
|
69
72
|
|
|
70
73
|
if (this.value.videoSource === "camera") {
|
|
71
74
|
this.value.control = false;
|
package/src/2_6_1.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrcpyOptions2_6 } from "./2_6/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions2_6_1 extends ScrcpyOptions2_6 {
|
|
4
|
+
constructor(init: ScrcpyOptions2_6.Init, version = "2.6.1") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions2_6Impl as ScrcpyOptions2_6_1Impl } from "./2_6/index.js";
|
package/src/2_7/options.ts
CHANGED
|
@@ -44,6 +44,8 @@ import {
|
|
|
44
44
|
export class ScrcpyOptions2_7 implements ScrcpyOptions<Init> {
|
|
45
45
|
static readonly Defaults = Defaults;
|
|
46
46
|
|
|
47
|
+
readonly version: string;
|
|
48
|
+
|
|
47
49
|
readonly value: Required<Init>;
|
|
48
50
|
|
|
49
51
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -64,8 +66,9 @@ export class ScrcpyOptions2_7 implements ScrcpyOptions<Init> {
|
|
|
64
66
|
return this.#uHidOutput;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
constructor(init: Init) {
|
|
69
|
+
constructor(init: Init, version = "2.7") {
|
|
68
70
|
this.value = { ...Defaults, ...init };
|
|
71
|
+
this.version = version;
|
|
69
72
|
|
|
70
73
|
if (this.value.videoSource === "camera") {
|
|
71
74
|
this.value.control = false;
|
package/src/3_0/impl/defaults.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { omit } from "../../utils/index.js";
|
|
2
2
|
|
|
3
3
|
import type { Init } from "./init.js";
|
|
4
|
-
import { CaptureOrientation } from "./init.js";
|
|
5
4
|
import { PrevImpl } from "./prev.js";
|
|
6
5
|
|
|
7
6
|
export const Defaults = /* #__PURE__ */ (() =>
|
|
8
7
|
({
|
|
9
8
|
...omit(PrevImpl.Defaults, "lockVideoOrientation"),
|
|
10
|
-
captureOrientation:
|
|
9
|
+
captureOrientation: undefined,
|
|
11
10
|
angle: 0,
|
|
12
11
|
screenOffTimeout: undefined,
|
|
13
12
|
listApps: false,
|
package/src/3_0/impl/init.ts
CHANGED
|
@@ -107,7 +107,7 @@ export class NewDisplay implements ScrcpyOptionValue {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
export interface Init extends Omit<PrevImpl.Init, "lockVideoOrientation"> {
|
|
110
|
-
captureOrientation?: CaptureOrientation;
|
|
110
|
+
captureOrientation?: CaptureOrientation | string | undefined;
|
|
111
111
|
angle?: number;
|
|
112
112
|
screenOffTimeout?: number | undefined;
|
|
113
113
|
|
|
@@ -116,6 +116,6 @@ export interface Init extends Omit<PrevImpl.Init, "lockVideoOrientation"> {
|
|
|
116
116
|
// `display_id` and `new_display` can't be specified at the same time
|
|
117
117
|
// but `serialize` method will exclude options that are same as the default value
|
|
118
118
|
// so `displayId: 0` will be ignored
|
|
119
|
-
newDisplay?: NewDisplay | undefined;
|
|
119
|
+
newDisplay?: NewDisplay | string | undefined;
|
|
120
120
|
vdSystemDecorations?: boolean;
|
|
121
121
|
}
|
package/src/3_0/options.ts
CHANGED
|
@@ -44,6 +44,8 @@ import {
|
|
|
44
44
|
export class ScrcpyOptions3_0 implements ScrcpyOptions<Init> {
|
|
45
45
|
static readonly Defaults = Defaults;
|
|
46
46
|
|
|
47
|
+
readonly version: string;
|
|
48
|
+
|
|
47
49
|
readonly value: Required<Init>;
|
|
48
50
|
|
|
49
51
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -64,8 +66,9 @@ export class ScrcpyOptions3_0 implements ScrcpyOptions<Init> {
|
|
|
64
66
|
return this.#uHidOutput;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
constructor(init: Init) {
|
|
69
|
+
constructor(init: Init, version = "3.0") {
|
|
68
70
|
this.value = { ...Defaults, ...init };
|
|
71
|
+
this.version = version;
|
|
69
72
|
|
|
70
73
|
if (this.value.videoSource === "camera") {
|
|
71
74
|
this.value.control = false;
|
package/src/3_0_1.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrcpyOptions3_0 } from "./3_0/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions3_0_1 extends ScrcpyOptions3_0 {
|
|
4
|
+
constructor(init: ScrcpyOptions3_0.Init, version = "3.0.1") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions3_0Impl as ScrcpyOptions3_0_1Impl } from "./3_0/index.js";
|
package/src/3_0_2.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrcpyOptions3_0 } from "./3_0/index.js";
|
|
2
|
+
|
|
3
|
+
export class ScrcpyOptions3_0_2 extends ScrcpyOptions3_0 {
|
|
4
|
+
constructor(init: ScrcpyOptions3_0.Init, version = "3.0.2") {
|
|
5
|
+
super(init, version);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ScrcpyOptions3_0Impl as ScrcpyOptions3_0_2Impl } from "./3_0/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as PrevImpl from "../../3_0/impl/index.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StructInit } from "@yume-chan/struct";
|
|
2
|
+
import { buffer, string, struct, u16, u8 } from "@yume-chan/struct";
|
|
3
|
+
|
|
4
|
+
import { ScrcpyControlMessageType } from "../../base/control-message-type.js";
|
|
5
|
+
import type { ScrcpyUHidCreateControlMessage } from "../../latest.js";
|
|
6
|
+
|
|
7
|
+
export const UHidCreateControlMessage = /* #__PURE__ */ (() =>
|
|
8
|
+
struct(
|
|
9
|
+
{
|
|
10
|
+
type: u8(ScrcpyControlMessageType.UHidCreate),
|
|
11
|
+
id: u16,
|
|
12
|
+
vendorId: u16,
|
|
13
|
+
productId: u16,
|
|
14
|
+
name: string(u8),
|
|
15
|
+
data: buffer(u16),
|
|
16
|
+
},
|
|
17
|
+
{ littleEndian: false },
|
|
18
|
+
))();
|
|
19
|
+
|
|
20
|
+
export type UHidCreateControlMessage = StructInit<
|
|
21
|
+
typeof UHidCreateControlMessage
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export function serializeUHidCreateControlMessage(
|
|
25
|
+
message: ScrcpyUHidCreateControlMessage,
|
|
26
|
+
) {
|
|
27
|
+
return UHidCreateControlMessage.serialize(message);
|
|
28
|
+
}
|
package/src/3_1/index.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
|
+
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
+
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ScrcpyAudioStreamMetadata,
|
|
7
|
+
ScrcpyControlMessageType,
|
|
8
|
+
ScrcpyDisplay,
|
|
9
|
+
ScrcpyEncoder,
|
|
10
|
+
ScrcpyMediaStreamPacket,
|
|
11
|
+
ScrcpyOptions,
|
|
12
|
+
ScrcpyScrollController,
|
|
13
|
+
ScrcpyVideoStream,
|
|
14
|
+
} from "../base/index.js";
|
|
15
|
+
import type {
|
|
16
|
+
ScrcpyBackOrScreenOnControlMessage,
|
|
17
|
+
ScrcpyInjectTouchControlMessage,
|
|
18
|
+
ScrcpySetClipboardControlMessage,
|
|
19
|
+
ScrcpyUHidCreateControlMessage,
|
|
20
|
+
ScrcpyUHidOutputDeviceMessage,
|
|
21
|
+
} from "../latest.js";
|
|
22
|
+
|
|
23
|
+
import type { Init } from "./impl/index.js";
|
|
24
|
+
import {
|
|
25
|
+
AckClipboardHandler,
|
|
26
|
+
ClipboardStream,
|
|
27
|
+
ControlMessageTypes,
|
|
28
|
+
createMediaStreamTransformer,
|
|
29
|
+
createScrollController,
|
|
30
|
+
Defaults,
|
|
31
|
+
parseAudioStreamMetadata,
|
|
32
|
+
parseDisplay,
|
|
33
|
+
parseEncoder,
|
|
34
|
+
parseVideoStreamMetadata,
|
|
35
|
+
serialize,
|
|
36
|
+
serializeBackOrScreenOnControlMessage,
|
|
37
|
+
serializeInjectTouchControlMessage,
|
|
38
|
+
serializeUHidCreateControlMessage,
|
|
39
|
+
setListDisplays,
|
|
40
|
+
setListEncoders,
|
|
41
|
+
UHidOutputStream,
|
|
42
|
+
} from "./impl/index.js";
|
|
43
|
+
|
|
44
|
+
export class ScrcpyOptions3_1 implements ScrcpyOptions<Init> {
|
|
45
|
+
static readonly Defaults = Defaults;
|
|
46
|
+
|
|
47
|
+
readonly version: string;
|
|
48
|
+
|
|
49
|
+
readonly value: Required<Init>;
|
|
50
|
+
|
|
51
|
+
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
52
|
+
return ControlMessageTypes;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#clipboard: ClipboardStream | undefined;
|
|
56
|
+
get clipboard(): ReadableStream<string> | undefined {
|
|
57
|
+
return this.#clipboard;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
61
|
+
|
|
62
|
+
#uHidOutput: UHidOutputStream | undefined;
|
|
63
|
+
get uHidOutput():
|
|
64
|
+
| ReadableStream<ScrcpyUHidOutputDeviceMessage>
|
|
65
|
+
| undefined {
|
|
66
|
+
return this.#uHidOutput;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
constructor(init: Init, version = "3.1") {
|
|
70
|
+
this.value = { ...Defaults, ...init };
|
|
71
|
+
this.version = version;
|
|
72
|
+
|
|
73
|
+
if (this.value.videoSource === "camera") {
|
|
74
|
+
this.value.control = false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (this.value.audioDup) {
|
|
78
|
+
this.value.audioSource = "playback";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (this.value.control) {
|
|
82
|
+
if (this.value.clipboardAutosync) {
|
|
83
|
+
this.#clipboard = new ClipboardStream();
|
|
84
|
+
this.#ackClipboardHandler = new AckClipboardHandler();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.#uHidOutput = new UHidOutputStream();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
serialize(): string[] {
|
|
92
|
+
return serialize(this.value, Defaults);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setListDisplays(): void {
|
|
96
|
+
setListDisplays(this.value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
parseDisplay(line: string): ScrcpyDisplay | undefined {
|
|
100
|
+
return parseDisplay(line);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setListEncoders() {
|
|
104
|
+
setListEncoders(this.value);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
parseEncoder(line: string): ScrcpyEncoder | undefined {
|
|
108
|
+
return parseEncoder(line);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
parseVideoStreamMetadata(
|
|
112
|
+
stream: ReadableStream<Uint8Array>,
|
|
113
|
+
): MaybePromiseLike<ScrcpyVideoStream> {
|
|
114
|
+
return parseVideoStreamMetadata(this.value, stream);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
parseAudioStreamMetadata(
|
|
118
|
+
stream: ReadableStream<Uint8Array>,
|
|
119
|
+
): MaybePromiseLike<ScrcpyAudioStreamMetadata> {
|
|
120
|
+
return parseAudioStreamMetadata(stream, this.value);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async parseDeviceMessage(
|
|
124
|
+
id: number,
|
|
125
|
+
stream: AsyncExactReadable,
|
|
126
|
+
): Promise<void> {
|
|
127
|
+
if (await this.#clipboard?.parse(id, stream)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (await this.#ackClipboardHandler?.parse(id, stream)) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
throw new Error("Unknown device message");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
endDeviceMessageStream(e?: unknown): void {
|
|
139
|
+
if (e) {
|
|
140
|
+
this.#clipboard?.error(e);
|
|
141
|
+
this.#ackClipboardHandler?.error(e);
|
|
142
|
+
} else {
|
|
143
|
+
this.#clipboard?.close();
|
|
144
|
+
this.#ackClipboardHandler?.close();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
createMediaStreamTransformer(): TransformStream<
|
|
149
|
+
Uint8Array,
|
|
150
|
+
ScrcpyMediaStreamPacket
|
|
151
|
+
> {
|
|
152
|
+
return createMediaStreamTransformer(this.value);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
serializeInjectTouchControlMessage(
|
|
156
|
+
message: ScrcpyInjectTouchControlMessage,
|
|
157
|
+
): Uint8Array {
|
|
158
|
+
return serializeInjectTouchControlMessage(message);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
serializeBackOrScreenOnControlMessage(
|
|
162
|
+
message: ScrcpyBackOrScreenOnControlMessage,
|
|
163
|
+
): Uint8Array | undefined {
|
|
164
|
+
return serializeBackOrScreenOnControlMessage(message);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
serializeSetClipboardControlMessage(
|
|
168
|
+
message: ScrcpySetClipboardControlMessage,
|
|
169
|
+
): Uint8Array | [Uint8Array, Promise<void>] {
|
|
170
|
+
return this.#ackClipboardHandler!.serializeSetClipboardControlMessage(
|
|
171
|
+
message,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
createScrollController(): ScrcpyScrollController {
|
|
176
|
+
return createScrollController();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
serializeUHidCreateControlMessage(
|
|
180
|
+
message: ScrcpyUHidCreateControlMessage,
|
|
181
|
+
): Uint8Array {
|
|
182
|
+
return serializeUHidCreateControlMessage(message);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
type Init_ = Init;
|
|
187
|
+
|
|
188
|
+
export namespace ScrcpyOptions3_1 {
|
|
189
|
+
export type Init = Init_;
|
|
190
|
+
}
|
package/src/base/option-value.ts
CHANGED
|
@@ -28,8 +28,8 @@ export function toScrcpyOptionValue<T>(value: unknown, empty: T): string | T {
|
|
|
28
28
|
typeof value !== "number" &&
|
|
29
29
|
typeof value !== "boolean"
|
|
30
30
|
) {
|
|
31
|
-
throw new TypeError(`Invalid option value: ${
|
|
31
|
+
throw new TypeError(`Invalid option value: ${JSON.stringify(value)}`);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
return
|
|
34
|
+
return value.toString();
|
|
35
35
|
}
|
package/src/base/options.ts
CHANGED
|
@@ -19,6 +19,8 @@ import type { ScrcpyScrollController } from "./scroll-controller.js";
|
|
|
19
19
|
import type { ScrcpyVideoStream } from "./video.js";
|
|
20
20
|
|
|
21
21
|
export interface ScrcpyOptions<T extends object> {
|
|
22
|
+
get version(): string;
|
|
23
|
+
|
|
22
24
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[];
|
|
23
25
|
|
|
24
26
|
value: Required<T>;
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./1_15/index.js";
|
|
2
|
+
export * from "./1_15_1.js";
|
|
2
3
|
export * from "./1_16.js";
|
|
3
4
|
export * from "./1_17/index.js";
|
|
4
5
|
export * from "./1_18/index.js";
|
|
@@ -11,13 +12,19 @@ export * from "./1_24/index.js";
|
|
|
11
12
|
export * from "./1_25/index.js";
|
|
12
13
|
export * from "./2_0/index.js";
|
|
13
14
|
export * from "./2_1/index.js";
|
|
15
|
+
export * from "./2_1_1.js";
|
|
14
16
|
export * from "./2_2/index.js";
|
|
15
17
|
export * from "./2_3/index.js";
|
|
18
|
+
export * from "./2_3_1.js";
|
|
16
19
|
export * from "./2_4/index.js";
|
|
17
20
|
export * from "./2_5.js";
|
|
18
21
|
export * from "./2_6/index.js";
|
|
22
|
+
export * from "./2_6_1.js";
|
|
19
23
|
export * from "./2_7/index.js";
|
|
20
24
|
export * from "./3_0/index.js";
|
|
25
|
+
export * from "./3_0_1.js";
|
|
26
|
+
export * from "./3_0_2.js";
|
|
27
|
+
export * from "./3_1/index.js";
|
|
21
28
|
export * from "./android/index.js";
|
|
22
29
|
export * from "./base/index.js";
|
|
23
30
|
export * from "./codec/index.js";
|