@yume-chan/scrcpy 1.1.0 → 2.0.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 +18 -0
- package/LICENSE +1 -1
- package/esm/1_15/impl/back-or-screen-on.d.ts +1 -1
- package/esm/1_15/impl/clipboard-stream.d.ts +3 -3
- package/esm/1_15/impl/inject-touch.d.ts +9 -9
- package/esm/1_15/impl/inject-touch.d.ts.map +1 -1
- package/esm/1_15/impl/inject-touch.js +14 -18
- package/esm/1_15/impl/inject-touch.js.map +1 -1
- package/esm/1_15/impl/media-stream-transformer.d.ts +3 -3
- package/esm/1_15/impl/scroll-controller.d.ts +5 -5
- package/esm/1_15/impl/scroll-controller.js +2 -2
- package/esm/1_15/impl/scroll-controller.js.map +1 -1
- package/esm/1_15/impl/set-clipboard.d.ts +3 -3
- package/esm/1_15/index.d.ts +0 -1
- package/esm/1_15/index.d.ts.map +1 -1
- package/esm/1_15/index.js +0 -1
- package/esm/1_15/index.js.map +1 -1
- package/esm/1_15/options.d.ts +3 -4
- package/esm/1_15/options.d.ts.map +1 -1
- package/esm/1_15/options.js +1 -3
- package/esm/1_15/options.js.map +1 -1
- package/esm/1_15_1.d.ts +4 -2
- package/esm/1_15_1.d.ts.map +1 -1
- package/esm/1_15_1.js +2 -3
- package/esm/1_15_1.js.map +1 -1
- package/esm/1_16.d.ts +4 -2
- package/esm/1_16.d.ts.map +1 -1
- package/esm/1_16.js +2 -3
- package/esm/1_16.js.map +1 -1
- package/esm/1_17/index.d.ts +0 -1
- package/esm/1_17/index.d.ts.map +1 -1
- package/esm/1_17/index.js +0 -1
- package/esm/1_17/index.js.map +1 -1
- package/esm/1_17/options.d.ts +5 -6
- package/esm/1_17/options.d.ts.map +1 -1
- package/esm/1_17/options.js +1 -3
- package/esm/1_17/options.js.map +1 -1
- package/esm/1_18/impl/back-or-screen-on.d.ts +5 -3
- package/esm/1_18/impl/back-or-screen-on.d.ts.map +1 -1
- package/esm/1_18/impl/back-or-screen-on.js +2 -5
- package/esm/1_18/impl/back-or-screen-on.js.map +1 -1
- package/esm/1_18/index.d.ts +0 -1
- package/esm/1_18/index.d.ts.map +1 -1
- package/esm/1_18/index.js +0 -1
- package/esm/1_18/index.js.map +1 -1
- package/esm/1_18/options.d.ts +5 -6
- package/esm/1_18/options.d.ts.map +1 -1
- package/esm/1_18/options.js +1 -3
- package/esm/1_18/options.js.map +1 -1
- package/esm/1_19.d.ts +4 -2
- package/esm/1_19.d.ts.map +1 -1
- package/esm/1_19.js +2 -3
- package/esm/1_19.js.map +1 -1
- package/esm/1_20.d.ts +4 -2
- package/esm/1_20.d.ts.map +1 -1
- package/esm/1_20.js +2 -3
- package/esm/1_20.js.map +1 -1
- package/esm/1_21/impl/set-clipboard.d.ts +6 -6
- package/esm/1_21/index.d.ts +0 -1
- package/esm/1_21/index.d.ts.map +1 -1
- package/esm/1_21/index.js +0 -1
- package/esm/1_21/index.js.map +1 -1
- package/esm/1_21/options.d.ts +5 -6
- package/esm/1_21/options.d.ts.map +1 -1
- package/esm/1_21/options.js +1 -3
- package/esm/1_21/options.js.map +1 -1
- package/esm/1_22/impl/scroll-controller.d.ts +8 -6
- package/esm/1_22/impl/scroll-controller.d.ts.map +1 -1
- package/esm/1_22/impl/scroll-controller.js +2 -5
- package/esm/1_22/impl/scroll-controller.js.map +1 -1
- package/esm/1_22/index.d.ts +0 -1
- package/esm/1_22/index.d.ts.map +1 -1
- package/esm/1_22/index.js +0 -1
- package/esm/1_22/index.js.map +1 -1
- package/esm/1_22/options.d.ts +5 -6
- package/esm/1_22/options.d.ts.map +1 -1
- package/esm/1_22/options.js +1 -3
- package/esm/1_22/options.js.map +1 -1
- package/esm/1_23/index.d.ts +0 -1
- package/esm/1_23/index.d.ts.map +1 -1
- package/esm/1_23/index.js +0 -1
- package/esm/1_23/index.js.map +1 -1
- package/esm/1_23/options.d.ts +5 -6
- package/esm/1_23/options.d.ts.map +1 -1
- package/esm/1_23/options.js +1 -3
- package/esm/1_23/options.js.map +1 -1
- package/esm/1_24/index.d.ts +0 -1
- package/esm/1_24/index.d.ts.map +1 -1
- package/esm/1_24/index.js +0 -1
- package/esm/1_24/index.js.map +1 -1
- package/esm/1_24/options.d.ts +5 -6
- package/esm/1_24/options.d.ts.map +1 -1
- package/esm/1_24/options.js +1 -3
- package/esm/1_24/options.js.map +1 -1
- package/esm/1_25/impl/scroll-controller.d.ts +11 -11
- package/esm/1_25/impl/scroll-controller.d.ts.map +1 -1
- package/esm/1_25/impl/scroll-controller.js +14 -18
- package/esm/1_25/impl/scroll-controller.js.map +1 -1
- package/esm/1_25/index.d.ts +0 -1
- package/esm/1_25/index.d.ts.map +1 -1
- package/esm/1_25/index.js +0 -1
- package/esm/1_25/index.js.map +1 -1
- package/esm/1_25/options.d.ts +5 -6
- package/esm/1_25/options.d.ts.map +1 -1
- package/esm/1_25/options.js +1 -3
- package/esm/1_25/options.js.map +1 -1
- package/esm/2_0/impl/inject-touch.d.ts +11 -11
- package/esm/2_0/impl/inject-touch.js +2 -2
- package/esm/2_0/impl/inject-touch.js.map +1 -1
- package/esm/2_0/impl/parse-audio-stream-metadata.d.ts +1 -1
- package/esm/2_0/impl/parse-audio-stream-metadata.d.ts.map +1 -1
- package/esm/2_0/impl/parse-audio-stream-metadata.js.map +1 -1
- package/esm/2_0/index.d.ts +0 -1
- package/esm/2_0/index.d.ts.map +1 -1
- package/esm/2_0/index.js +0 -1
- package/esm/2_0/index.js.map +1 -1
- package/esm/2_0/options.d.ts +5 -6
- package/esm/2_0/options.d.ts.map +1 -1
- package/esm/2_0/options.js +1 -3
- package/esm/2_0/options.js.map +1 -1
- package/esm/2_1/impl/defaults.d.ts.map +1 -1
- package/esm/2_1/impl/defaults.js.map +1 -1
- package/esm/2_1/impl/init.d.ts +2 -2
- package/esm/2_1/impl/init.d.ts.map +1 -1
- package/esm/2_1/index.d.ts +0 -1
- package/esm/2_1/index.d.ts.map +1 -1
- package/esm/2_1/index.js +0 -1
- package/esm/2_1/index.js.map +1 -1
- package/esm/2_1/options.d.ts +8 -9
- package/esm/2_1/options.d.ts.map +1 -1
- package/esm/2_1/options.js +1 -3
- package/esm/2_1/options.js.map +1 -1
- package/esm/2_1_1.d.ts +5 -3
- package/esm/2_1_1.d.ts.map +1 -1
- package/esm/2_1_1.js +2 -3
- package/esm/2_1_1.js.map +1 -1
- package/esm/2_2/impl/defaults.d.ts.map +1 -1
- package/esm/2_2/impl/defaults.js.map +1 -1
- package/esm/2_2/impl/init.d.ts +1 -1
- package/esm/2_2/impl/init.d.ts.map +1 -1
- package/esm/2_2/index.d.ts +0 -1
- package/esm/2_2/index.d.ts.map +1 -1
- package/esm/2_2/index.js +0 -1
- package/esm/2_2/index.js.map +1 -1
- package/esm/2_2/options.d.ts +8 -9
- package/esm/2_2/options.d.ts.map +1 -1
- package/esm/2_2/options.js +1 -3
- package/esm/2_2/options.js.map +1 -1
- package/esm/2_3/impl/init.d.ts +2 -2
- package/esm/2_3/impl/init.d.ts.map +1 -1
- package/esm/2_3/index.d.ts +0 -1
- package/esm/2_3/index.d.ts.map +1 -1
- package/esm/2_3/index.js +0 -1
- package/esm/2_3/index.js.map +1 -1
- package/esm/2_3/options.d.ts +8 -9
- package/esm/2_3/options.d.ts.map +1 -1
- package/esm/2_3/options.js +1 -3
- package/esm/2_3/options.js.map +1 -1
- package/esm/2_3_1.d.ts +5 -3
- package/esm/2_3_1.d.ts.map +1 -1
- package/esm/2_3_1.js +2 -3
- package/esm/2_3_1.js.map +1 -1
- package/esm/2_4/impl/serialize-uhid-create.d.ts +3 -3
- package/esm/2_4/impl/uhid-output-stream.d.ts +3 -3
- package/esm/2_4/index.d.ts +0 -1
- package/esm/2_4/index.d.ts.map +1 -1
- package/esm/2_4/index.js +0 -1
- package/esm/2_4/index.js.map +1 -1
- package/esm/2_4/options.d.ts +8 -9
- package/esm/2_4/options.d.ts.map +1 -1
- package/esm/2_4/options.js +1 -3
- package/esm/2_4/options.js.map +1 -1
- package/esm/2_5.d.ts +5 -3
- package/esm/2_5.d.ts.map +1 -1
- package/esm/2_5.js +2 -3
- package/esm/2_5.js.map +1 -1
- package/esm/2_6/impl/defaults.d.ts.map +1 -1
- package/esm/2_6/impl/defaults.js.map +1 -1
- package/esm/2_6/impl/init.d.ts +2 -2
- package/esm/2_6/impl/init.d.ts.map +1 -1
- package/esm/2_6/index.d.ts +0 -1
- package/esm/2_6/index.d.ts.map +1 -1
- package/esm/2_6/index.js +0 -1
- package/esm/2_6/index.js.map +1 -1
- package/esm/2_6/options.d.ts +8 -9
- package/esm/2_6/options.d.ts.map +1 -1
- package/esm/2_6/options.js +1 -3
- package/esm/2_6/options.js.map +1 -1
- package/esm/2_6_1.d.ts +5 -3
- package/esm/2_6_1.d.ts.map +1 -1
- package/esm/2_6_1.js +2 -3
- package/esm/2_6_1.js.map +1 -1
- package/esm/2_7/impl/serialize-uhid-create.d.ts +7 -7
- package/esm/2_7/index.d.ts +0 -1
- package/esm/2_7/index.d.ts.map +1 -1
- package/esm/2_7/index.js +0 -1
- package/esm/2_7/index.js.map +1 -1
- package/esm/2_7/options.d.ts +8 -9
- package/esm/2_7/options.d.ts.map +1 -1
- package/esm/2_7/options.js +1 -3
- package/esm/2_7/options.js.map +1 -1
- package/esm/3_0/impl/defaults.d.ts.map +1 -1
- package/esm/3_0/impl/defaults.js.map +1 -1
- package/esm/3_0/impl/init.d.ts +1 -1
- package/esm/3_0/impl/init.d.ts.map +1 -1
- package/esm/3_0/index.d.ts +0 -1
- package/esm/3_0/index.d.ts.map +1 -1
- package/esm/3_0/index.js +0 -1
- package/esm/3_0/index.js.map +1 -1
- package/esm/3_0/options.d.ts +8 -9
- package/esm/3_0/options.d.ts.map +1 -1
- package/esm/3_0/options.js +1 -3
- package/esm/3_0/options.js.map +1 -1
- package/esm/3_0_1.d.ts +5 -3
- package/esm/3_0_1.d.ts.map +1 -1
- package/esm/3_0_1.js +2 -3
- package/esm/3_0_1.js.map +1 -1
- package/esm/3_0_2.d.ts +5 -3
- package/esm/3_0_2.d.ts.map +1 -1
- package/esm/3_0_2.js +2 -3
- package/esm/3_0_2.js.map +1 -1
- package/esm/3_1/impl/defaults.d.ts.map +1 -1
- package/esm/3_1/impl/defaults.js.map +1 -1
- package/esm/3_1/impl/init.d.ts +1 -1
- package/esm/3_1/impl/init.d.ts.map +1 -1
- package/esm/3_1/impl/serialize-uhid-create.d.ts +7 -7
- package/esm/3_1/index.d.ts +0 -1
- package/esm/3_1/index.d.ts.map +1 -1
- package/esm/3_1/index.js +0 -1
- package/esm/3_1/index.js.map +1 -1
- package/esm/3_1/options.d.ts +8 -9
- package/esm/3_1/options.d.ts.map +1 -1
- package/esm/3_1/options.js +1 -3
- package/esm/3_1/options.js.map +1 -1
- package/esm/android/key-event.d.ts.map +1 -1
- package/esm/android/key-event.js +3 -2
- package/esm/android/key-event.js.map +1 -1
- package/esm/base/options.d.ts +6 -5
- package/esm/base/options.d.ts.map +1 -1
- package/esm/codec/h265.d.ts +23 -2
- package/esm/codec/h265.d.ts.map +1 -1
- package/esm/codec/h265.js +25 -3
- package/esm/codec/h265.js.map +1 -1
- package/esm/control/empty.d.ts +1 -1
- package/esm/control/inject-key-code.d.ts +9 -9
- package/esm/control/inject-text.d.ts +3 -3
- package/esm/control/set-screen-power-mode.d.ts +3 -3
- package/esm/control/start-app.d.ts +3 -3
- package/esm/control/uhid.d.ts +6 -6
- package/esm/latest.d.ts +5 -3
- package/esm/latest.d.ts.map +1 -1
- package/esm/latest.js +2 -3
- package/esm/latest.js.map +1 -1
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/index.js.map +1 -1
- package/package.json +7 -7
- package/src/1_15/impl/inject-touch.ts +13 -12
- package/src/1_15/impl/scroll-controller.ts +2 -2
- package/src/1_15/index.ts +0 -1
- package/src/1_15/options.ts +3 -6
- package/src/1_15_1.ts +5 -3
- package/src/1_16.ts +5 -3
- package/src/1_17/index.ts +0 -1
- package/src/1_17/options.ts +7 -7
- package/src/1_18/impl/back-or-screen-on.ts +5 -9
- package/src/1_18/index.ts +0 -1
- package/src/1_18/options.ts +7 -7
- package/src/1_19.ts +5 -3
- package/src/1_20.ts +5 -3
- package/src/1_21/index.ts +0 -1
- package/src/1_21/options.ts +7 -7
- package/src/1_22/impl/scroll-controller.ts +5 -9
- package/src/1_22/index.ts +0 -1
- package/src/1_22/options.ts +7 -7
- package/src/1_23/index.ts +0 -1
- package/src/1_23/options.ts +7 -7
- package/src/1_24/index.ts +0 -1
- package/src/1_24/options.ts +7 -7
- package/src/1_25/impl/scroll-controller.ts +10 -9
- package/src/1_25/index.ts +0 -1
- package/src/1_25/options.ts +7 -7
- package/src/2_0/impl/inject-touch.ts +2 -2
- package/src/2_0/impl/parse-audio-stream-metadata.ts +1 -1
- package/src/2_0/index.ts +0 -1
- package/src/2_0/options.ts +7 -7
- package/src/2_1/impl/defaults.ts +1 -1
- package/src/2_1/impl/init.ts +2 -2
- package/src/2_1/index.ts +0 -1
- package/src/2_1/options.ts +12 -12
- package/src/2_1_1.ts +9 -4
- package/src/2_2/impl/defaults.ts +1 -1
- package/src/2_2/impl/init.ts +1 -1
- package/src/2_2/index.ts +0 -1
- package/src/2_2/options.ts +12 -12
- package/src/2_3/impl/init.ts +3 -2
- package/src/2_3/index.ts +0 -1
- package/src/2_3/options.ts +12 -12
- package/src/2_3_1.ts +9 -4
- package/src/2_4/index.ts +0 -1
- package/src/2_4/options.ts +12 -12
- package/src/2_5.ts +9 -4
- package/src/2_6/impl/defaults.ts +1 -1
- package/src/2_6/impl/init.ts +3 -2
- package/src/2_6/index.ts +0 -1
- package/src/2_6/options.ts +12 -12
- package/src/2_6_1.ts +9 -4
- package/src/2_7/index.ts +0 -1
- package/src/2_7/options.ts +12 -12
- package/src/3_0/impl/defaults.ts +1 -1
- package/src/3_0/impl/init.ts +2 -1
- package/src/3_0/index.ts +0 -1
- package/src/3_0/options.ts +12 -12
- package/src/3_0_1.ts +9 -4
- package/src/3_0_2.ts +9 -4
- package/src/3_1/impl/defaults.ts +1 -1
- package/src/3_1/impl/init.ts +1 -1
- package/src/3_1/index.ts +0 -1
- package/src/3_1/options.ts +12 -12
- package/src/android/key-event.ts +3 -2
- package/src/base/options.ts +11 -8
- package/src/codec/h265.ts +31 -5
- package/src/latest.ts +9 -4
- package/src/utils/index.ts +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/wrapper.d.ts +0 -38
- package/esm/utils/wrapper.d.ts.map +0 -1
- package/esm/utils/wrapper.js +0 -79
- package/esm/utils/wrapper.js.map +0 -1
- package/src/utils/wrapper.ts +0 -135
package/esm/latest.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ScrcpyOptions3_1 } from "./3_1/options.js";
|
|
2
2
|
export class ScrcpyOptionsLatest extends ScrcpyOptions3_1 {
|
|
3
|
-
constructor(init
|
|
4
|
-
super(init
|
|
3
|
+
constructor(init) {
|
|
4
|
+
super(init);
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
export { ScrcpyOptions3_1Impl as ScrcpyOptionsLatestImpl } from "./3_1/index.js";
|
|
8
7
|
export { BackOrScreenOnControlMessage as ScrcpyBackOrScreenOnControlMessage, CaptureOrientation as ScrcpyCaptureOrientation, CodecOptions as ScrcpyCodecOptions, Crop as ScrcpyCrop, InjectScrollControlMessage as ScrcpyInjectScrollControlMessage, InjectTouchControlMessage as ScrcpyInjectTouchControlMessage, InstanceId as ScrcpyInstanceId, LockOrientation as ScrcpyLockOrientation, NewDisplay as ScrcpyNewDisplay, Orientation as ScrcpyOrientation, PointerId as ScrcpyPointerId, SetClipboardControlMessage as ScrcpySetClipboardControlMessage, UHidCreateControlMessage as ScrcpyUHidCreateControlMessage, UHidOutputDeviceMessage as ScrcpyUHidOutputDeviceMessage, } from "./3_1/impl/index.js";
|
|
9
8
|
//# sourceMappingURL=latest.js.map
|
package/esm/latest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latest.js","sourceRoot":"","sources":["../src/latest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"latest.js","sourceRoot":"","sources":["../src/latest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,OAAO,mBAEX,SAAQ,gBAAwB;IAC9B,YAAY,IAAmC;QAC3C,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACJ;AAOD,OAAO,EACH,4BAA4B,IAAI,kCAAkC,EAClE,kBAAkB,IAAI,wBAAwB,EAC9C,YAAY,IAAI,kBAAkB,EAClC,IAAI,IAAI,UAAU,EAClB,0BAA0B,IAAI,gCAAgC,EAC9D,yBAAyB,IAAI,+BAA+B,EAC5D,UAAU,IAAI,gBAAgB,EAC9B,eAAe,IAAI,qBAAqB,EACxC,UAAU,IAAI,gBAAgB,EAC9B,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,0BAA0B,IAAI,gCAAgC,EAC9D,wBAAwB,IAAI,8BAA8B,EAC1D,uBAAuB,IAAI,6BAA6B,GAC3D,MAAM,qBAAqB,CAAC"}
|
package/esm/utils/index.d.ts
CHANGED
package/esm/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
package/esm/utils/index.js
CHANGED
package/esm/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yume-chan/scrcpy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "TypeScript implementation of Scrcpy client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adb",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@yume-chan/async": "^4.0.2",
|
|
31
|
-
"@yume-chan/
|
|
32
|
-
"@yume-chan/struct": "^
|
|
33
|
-
"@yume-chan/
|
|
31
|
+
"@yume-chan/stream-extra": "^2.0.0",
|
|
32
|
+
"@yume-chan/struct": "^2.0.0",
|
|
33
|
+
"@yume-chan/no-data-view": "^2.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^22.10
|
|
37
|
-
"prettier": "^3.
|
|
38
|
-
"typescript": "^5.
|
|
36
|
+
"@types/node": "^22.13.10",
|
|
37
|
+
"prettier": "^3.5.3",
|
|
38
|
+
"typescript": "^5.8.2",
|
|
39
39
|
"@yume-chan/test-runner": "^1.0.0",
|
|
40
40
|
"@yume-chan/eslint-config": "^1.0.0",
|
|
41
41
|
"@yume-chan/tsconfig": "^1.0.0"
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { getUint16, setUint16 } from "@yume-chan/no-data-view";
|
|
2
2
|
import type { Field, StructInit } from "@yume-chan/struct";
|
|
3
|
-
import {
|
|
3
|
+
import { field, struct, u16, u32, u64, u8 } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type { AndroidMotionEventAction } from "../../android/index.js";
|
|
6
6
|
import type { ScrcpyInjectTouchControlMessage } from "../../latest.js";
|
|
7
7
|
import { clamp } from "../../utils/index.js";
|
|
8
8
|
|
|
9
|
-
export const UnsignedFloat: Field<number, never, never> =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const UnsignedFloat: Field<number, never, never> = field(
|
|
10
|
+
2,
|
|
11
|
+
"byob",
|
|
12
|
+
(source, { buffer, index, littleEndian }) => {
|
|
12
13
|
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/app/src/util/binary.h#L51
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setUint16(buffer, index,
|
|
14
|
+
source = clamp(source, -1, 1);
|
|
15
|
+
source = source === 1 ? 0xffff : source * 0x10000;
|
|
16
|
+
setUint16(buffer, index, source, littleEndian);
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
+
function* (then, reader, { littleEndian }) {
|
|
18
19
|
const data = yield* then(reader.readExactly(2));
|
|
19
20
|
const value = getUint16(data, 0, littleEndian);
|
|
20
21
|
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/server/src/main/java/com/genymobile/scrcpy/Binary.java#L22
|
|
21
22
|
return value === 0xffff ? 1 : value / 0x10000;
|
|
22
|
-
}
|
|
23
|
-
|
|
23
|
+
},
|
|
24
|
+
);
|
|
24
25
|
|
|
25
26
|
export const PointerId = {
|
|
26
27
|
Mouse: -1n,
|
|
@@ -36,8 +37,8 @@ export const InjectTouchControlMessage = struct(
|
|
|
36
37
|
pointerId: u64,
|
|
37
38
|
pointerX: u32,
|
|
38
39
|
pointerY: u32,
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
videoWidth: u16,
|
|
41
|
+
videoHeight: u16,
|
|
41
42
|
pressure: UnsignedFloat,
|
|
42
43
|
buttons: u32,
|
|
43
44
|
},
|
package/src/1_15/index.ts
CHANGED
package/src/1_15/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -36,8 +36,6 @@ import {
|
|
|
36
36
|
export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
|
37
37
|
static readonly Defaults = Defaults;
|
|
38
38
|
|
|
39
|
-
readonly version: string;
|
|
40
|
-
|
|
41
39
|
readonly value: Required<Init>;
|
|
42
40
|
|
|
43
41
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -49,9 +47,8 @@ export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
|
|
49
47
|
return this.#clipboard;
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
constructor(init: Init
|
|
50
|
+
constructor(init: Init) {
|
|
53
51
|
this.value = { ...Defaults, ...init };
|
|
54
|
-
this.version = version;
|
|
55
52
|
|
|
56
53
|
if (this.value.control) {
|
|
57
54
|
this.#clipboard = new ClipboardStream();
|
|
@@ -78,7 +75,7 @@ export class ScrcpyOptions1_15 implements ScrcpyOptions<Init> {
|
|
|
78
75
|
|
|
79
76
|
async parseDeviceMessage(
|
|
80
77
|
id: number,
|
|
81
|
-
stream: AsyncExactReadable,
|
|
78
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
82
79
|
): Promise<void> {
|
|
83
80
|
if (await this.#clipboard!.parse(id, stream)) {
|
|
84
81
|
return;
|
package/src/1_15_1.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
|
2
2
|
|
|
3
3
|
export class ScrcpyOptions1_15_1 extends ScrcpyOptions1_15 {
|
|
4
|
-
constructor(init: ScrcpyOptions1_15.Init
|
|
5
|
-
super(init
|
|
4
|
+
constructor(init: ScrcpyOptions1_15.Init) {
|
|
5
|
+
super(init);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export namespace ScrcpyOptions1_15_1 {
|
|
10
|
+
export type Init = ScrcpyOptions1_15.Init;
|
|
11
|
+
}
|
package/src/1_16.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ScrcpyOptions1_15 } from "./1_15/index.js";
|
|
2
2
|
|
|
3
3
|
export class ScrcpyOptions1_16 extends ScrcpyOptions1_15 {
|
|
4
|
-
constructor(init: ScrcpyOptions1_15.Init
|
|
5
|
-
super(init
|
|
4
|
+
constructor(init: ScrcpyOptions1_15.Init) {
|
|
5
|
+
super(init);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export namespace ScrcpyOptions1_16 {
|
|
10
|
+
export type Init = ScrcpyOptions1_15.Init;
|
|
11
|
+
}
|
package/src/1_17/index.ts
CHANGED
package/src/1_17/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -37,11 +38,11 @@ import {
|
|
|
37
38
|
setListEncoders,
|
|
38
39
|
} from "./impl/index.js";
|
|
39
40
|
|
|
40
|
-
export class ScrcpyOptions1_17
|
|
41
|
+
export class ScrcpyOptions1_17
|
|
42
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
43
|
+
{
|
|
41
44
|
static readonly Defaults = Defaults;
|
|
42
45
|
|
|
43
|
-
readonly version: string;
|
|
44
|
-
|
|
45
46
|
readonly value: Required<Init>;
|
|
46
47
|
|
|
47
48
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,9 +54,8 @@ export class ScrcpyOptions1_17 implements ScrcpyOptions<Init> {
|
|
|
53
54
|
return this.#clipboard;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
constructor(init: Init
|
|
57
|
+
constructor(init: Init) {
|
|
57
58
|
this.value = { ...Defaults, ...init };
|
|
58
|
-
this.version = version;
|
|
59
59
|
|
|
60
60
|
if (this.value.control) {
|
|
61
61
|
this.#clipboard = new ClipboardStream();
|
|
@@ -90,7 +90,7 @@ export class ScrcpyOptions1_17 implements ScrcpyOptions<Init> {
|
|
|
90
90
|
|
|
91
91
|
async parseDeviceMessage(
|
|
92
92
|
id: number,
|
|
93
|
-
stream: AsyncExactReadable,
|
|
93
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
94
94
|
): Promise<void> {
|
|
95
95
|
if (await this.#clipboard!.parse(id, stream)) {
|
|
96
96
|
return;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { StructInit } from "@yume-chan/struct";
|
|
2
|
-
import {
|
|
2
|
+
import { extend, u8 } from "@yume-chan/struct";
|
|
3
3
|
|
|
4
4
|
import type { AndroidKeyEventAction } from "../../android/index.js";
|
|
5
5
|
import type { ScrcpyBackOrScreenOnControlMessage } from "../../latest.js";
|
|
6
6
|
|
|
7
7
|
import { PrevImpl } from "./prev.js";
|
|
8
8
|
|
|
9
|
-
export const BackOrScreenOnControlMessage =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
action: u8<AndroidKeyEventAction>(),
|
|
14
|
-
},
|
|
15
|
-
{ littleEndian: false },
|
|
16
|
-
))();
|
|
9
|
+
export const BackOrScreenOnControlMessage = extend(
|
|
10
|
+
PrevImpl.BackOrScreenOnControlMessage,
|
|
11
|
+
{ action: u8<AndroidKeyEventAction>() },
|
|
12
|
+
);
|
|
17
13
|
|
|
18
14
|
export type BackOrScreenOnControlMessage = StructInit<
|
|
19
15
|
typeof BackOrScreenOnControlMessage
|
package/src/1_18/index.ts
CHANGED
package/src/1_18/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -37,11 +38,11 @@ import {
|
|
|
37
38
|
setListEncoders,
|
|
38
39
|
} from "./impl/index.js";
|
|
39
40
|
|
|
40
|
-
export class ScrcpyOptions1_18
|
|
41
|
+
export class ScrcpyOptions1_18
|
|
42
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
43
|
+
{
|
|
41
44
|
static readonly Defaults = Defaults;
|
|
42
45
|
|
|
43
|
-
readonly version: string;
|
|
44
|
-
|
|
45
46
|
readonly value: Required<Init>;
|
|
46
47
|
|
|
47
48
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -53,9 +54,8 @@ export class ScrcpyOptions1_18 implements ScrcpyOptions<Init> {
|
|
|
53
54
|
return this.#clipboard;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
constructor(init: Init
|
|
57
|
+
constructor(init: Init) {
|
|
57
58
|
this.value = { ...Defaults, ...init };
|
|
58
|
-
this.version = version;
|
|
59
59
|
|
|
60
60
|
if (this.value.control) {
|
|
61
61
|
this.#clipboard = new ClipboardStream();
|
|
@@ -90,7 +90,7 @@ export class ScrcpyOptions1_18 implements ScrcpyOptions<Init> {
|
|
|
90
90
|
|
|
91
91
|
async parseDeviceMessage(
|
|
92
92
|
id: number,
|
|
93
|
-
stream: AsyncExactReadable,
|
|
93
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
94
94
|
): Promise<void> {
|
|
95
95
|
if (await this.#clipboard!.parse(id, stream)) {
|
|
96
96
|
return;
|
package/src/1_19.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
|
2
2
|
|
|
3
3
|
export class ScrcpyOptions1_19 extends ScrcpyOptions1_18 {
|
|
4
|
-
constructor(init: ScrcpyOptions1_18.Init
|
|
5
|
-
super(init
|
|
4
|
+
constructor(init: ScrcpyOptions1_18.Init) {
|
|
5
|
+
super(init);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export namespace ScrcpyOptions1_19 {
|
|
10
|
+
export type Init = ScrcpyOptions1_18.Init;
|
|
11
|
+
}
|
package/src/1_20.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ScrcpyOptions1_18 } from "./1_18/index.js";
|
|
2
2
|
|
|
3
3
|
export class ScrcpyOptions1_20 extends ScrcpyOptions1_18 {
|
|
4
|
-
constructor(init: ScrcpyOptions1_18.Init
|
|
5
|
-
super(init
|
|
4
|
+
constructor(init: ScrcpyOptions1_18.Init) {
|
|
5
|
+
super(init);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export namespace ScrcpyOptions1_20 {
|
|
10
|
+
export type Init = ScrcpyOptions1_18.Init;
|
|
11
|
+
}
|
package/src/1_21/index.ts
CHANGED
package/src/1_21/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -36,11 +37,11 @@ import {
|
|
|
36
37
|
setListEncoders,
|
|
37
38
|
} from "./impl/index.js";
|
|
38
39
|
|
|
39
|
-
export class ScrcpyOptions1_21
|
|
40
|
+
export class ScrcpyOptions1_21
|
|
41
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
42
|
+
{
|
|
40
43
|
static readonly Defaults = Defaults;
|
|
41
44
|
|
|
42
|
-
readonly version: string;
|
|
43
|
-
|
|
44
45
|
readonly value: Required<Init>;
|
|
45
46
|
|
|
46
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -54,9 +55,8 @@ export class ScrcpyOptions1_21 implements ScrcpyOptions<Init> {
|
|
|
54
55
|
|
|
55
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
56
57
|
|
|
57
|
-
constructor(init: Init
|
|
58
|
+
constructor(init: Init) {
|
|
58
59
|
this.value = { ...Defaults, ...init };
|
|
59
|
-
this.version = version;
|
|
60
60
|
|
|
61
61
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
62
62
|
this.#clipboard = new ClipboardStream();
|
|
@@ -92,7 +92,7 @@ export class ScrcpyOptions1_21 implements ScrcpyOptions<Init> {
|
|
|
92
92
|
|
|
93
93
|
async parseDeviceMessage(
|
|
94
94
|
id: number,
|
|
95
|
-
stream: AsyncExactReadable,
|
|
95
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
96
96
|
): Promise<void> {
|
|
97
97
|
if (await this.#clipboard?.parse(id, stream)) {
|
|
98
98
|
return;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { StructInit } from "@yume-chan/struct";
|
|
2
|
-
import {
|
|
2
|
+
import { extend, s32 } from "@yume-chan/struct";
|
|
3
3
|
|
|
4
4
|
import type { ScrcpyScrollController } from "../../base/index.js";
|
|
5
5
|
import type { ScrcpyInjectScrollControlMessage } from "../../latest.js";
|
|
6
6
|
|
|
7
7
|
import { PrevImpl } from "./prev.js";
|
|
8
8
|
|
|
9
|
-
export const InjectScrollControlMessage =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
buttons: s32,
|
|
14
|
-
},
|
|
15
|
-
{ littleEndian: false },
|
|
16
|
-
))();
|
|
9
|
+
export const InjectScrollControlMessage = extend(
|
|
10
|
+
PrevImpl.InjectScrollControlMessage,
|
|
11
|
+
{ buttons: s32 },
|
|
12
|
+
);
|
|
17
13
|
|
|
18
14
|
export type InjectScrollControlMessage = StructInit<
|
|
19
15
|
typeof InjectScrollControlMessage
|
package/src/1_22/index.ts
CHANGED
package/src/1_22/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -36,11 +37,11 @@ import {
|
|
|
36
37
|
setListEncoders,
|
|
37
38
|
} from "./impl/index.js";
|
|
38
39
|
|
|
39
|
-
export class ScrcpyOptions1_22
|
|
40
|
+
export class ScrcpyOptions1_22
|
|
41
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
42
|
+
{
|
|
40
43
|
static readonly Defaults = Defaults;
|
|
41
44
|
|
|
42
|
-
readonly version: string;
|
|
43
|
-
|
|
44
45
|
readonly value: Required<Init>;
|
|
45
46
|
|
|
46
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -54,9 +55,8 @@ export class ScrcpyOptions1_22 implements ScrcpyOptions<Init> {
|
|
|
54
55
|
|
|
55
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
56
57
|
|
|
57
|
-
constructor(init: Init
|
|
58
|
+
constructor(init: Init) {
|
|
58
59
|
this.value = { ...Defaults, ...init };
|
|
59
|
-
this.version = version;
|
|
60
60
|
|
|
61
61
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
62
62
|
this.#clipboard = new ClipboardStream();
|
|
@@ -92,7 +92,7 @@ export class ScrcpyOptions1_22 implements ScrcpyOptions<Init> {
|
|
|
92
92
|
|
|
93
93
|
async parseDeviceMessage(
|
|
94
94
|
id: number,
|
|
95
|
-
stream: AsyncExactReadable,
|
|
95
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
96
96
|
): Promise<void> {
|
|
97
97
|
if (await this.#clipboard?.parse(id, stream)) {
|
|
98
98
|
return;
|
package/src/1_23/index.ts
CHANGED
package/src/1_23/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -36,11 +37,11 @@ import {
|
|
|
36
37
|
setListEncoders,
|
|
37
38
|
} from "./impl/index.js";
|
|
38
39
|
|
|
39
|
-
export class ScrcpyOptions1_23
|
|
40
|
+
export class ScrcpyOptions1_23
|
|
41
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
42
|
+
{
|
|
40
43
|
static readonly Defaults = Defaults;
|
|
41
44
|
|
|
42
|
-
readonly version: string;
|
|
43
|
-
|
|
44
45
|
readonly value: Required<Init>;
|
|
45
46
|
|
|
46
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -54,9 +55,8 @@ export class ScrcpyOptions1_23 implements ScrcpyOptions<Init> {
|
|
|
54
55
|
|
|
55
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
56
57
|
|
|
57
|
-
constructor(init: Init
|
|
58
|
+
constructor(init: Init) {
|
|
58
59
|
this.value = { ...Defaults, ...init };
|
|
59
|
-
this.version = version;
|
|
60
60
|
|
|
61
61
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
62
62
|
this.#clipboard = new ClipboardStream();
|
|
@@ -92,7 +92,7 @@ export class ScrcpyOptions1_23 implements ScrcpyOptions<Init> {
|
|
|
92
92
|
|
|
93
93
|
async parseDeviceMessage(
|
|
94
94
|
id: number,
|
|
95
|
-
stream: AsyncExactReadable,
|
|
95
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
96
96
|
): Promise<void> {
|
|
97
97
|
if (await this.#clipboard?.parse(id, stream)) {
|
|
98
98
|
return;
|
package/src/1_24/index.ts
CHANGED
package/src/1_24/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
2
|
import type { ReadableStream, TransformStream } from "@yume-chan/stream-extra";
|
|
3
|
-
import type { AsyncExactReadable } from "@yume-chan/struct";
|
|
3
|
+
import type { AsyncExactReadable, ExactReadable } from "@yume-chan/struct";
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ScrcpyControlMessageType,
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ScrcpyEncoder,
|
|
9
9
|
ScrcpyMediaStreamPacket,
|
|
10
10
|
ScrcpyOptions,
|
|
11
|
+
ScrcpyOptionsListEncoders,
|
|
11
12
|
ScrcpyScrollController,
|
|
12
13
|
ScrcpyVideoStream,
|
|
13
14
|
} from "../base/index.js";
|
|
@@ -36,11 +37,11 @@ import {
|
|
|
36
37
|
setListEncoders,
|
|
37
38
|
} from "./impl/index.js";
|
|
38
39
|
|
|
39
|
-
export class ScrcpyOptions1_24
|
|
40
|
+
export class ScrcpyOptions1_24
|
|
41
|
+
implements ScrcpyOptions<Init>, ScrcpyOptionsListEncoders
|
|
42
|
+
{
|
|
40
43
|
static readonly Defaults = Defaults;
|
|
41
44
|
|
|
42
|
-
readonly version: string;
|
|
43
|
-
|
|
44
45
|
readonly value: Required<Init>;
|
|
45
46
|
|
|
46
47
|
get controlMessageTypes(): readonly ScrcpyControlMessageType[] {
|
|
@@ -54,9 +55,8 @@ export class ScrcpyOptions1_24 implements ScrcpyOptions<Init> {
|
|
|
54
55
|
|
|
55
56
|
#ackClipboardHandler: AckClipboardHandler | undefined;
|
|
56
57
|
|
|
57
|
-
constructor(init: Init
|
|
58
|
+
constructor(init: Init) {
|
|
58
59
|
this.value = { ...Defaults, ...init };
|
|
59
|
-
this.version = version;
|
|
60
60
|
|
|
61
61
|
if (this.value.control && this.value.clipboardAutosync) {
|
|
62
62
|
this.#clipboard = new ClipboardStream();
|
|
@@ -92,7 +92,7 @@ export class ScrcpyOptions1_24 implements ScrcpyOptions<Init> {
|
|
|
92
92
|
|
|
93
93
|
async parseDeviceMessage(
|
|
94
94
|
id: number,
|
|
95
|
-
stream: AsyncExactReadable,
|
|
95
|
+
stream: ExactReadable | AsyncExactReadable,
|
|
96
96
|
): Promise<void> {
|
|
97
97
|
if (await this.#clipboard?.parse(id, stream)) {
|
|
98
98
|
return;
|