@yume-chan/scrcpy 0.0.18 → 0.0.19
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.json +18 -0
- package/CHANGELOG.md +10 -1
- package/README.md +111 -61
- package/bin/scrcpy-server +0 -0
- package/bin/version.d.ts +1 -1
- package/bin/version.js +1 -1
- package/esm/adb/client.d.ts +40 -40
- package/esm/adb/client.d.ts.map +1 -1
- package/esm/adb/client.js +223 -242
- package/esm/adb/client.js.map +1 -1
- package/esm/adb/connection.d.ts +48 -46
- package/esm/adb/connection.d.ts.map +1 -1
- package/esm/adb/connection.js +121 -109
- package/esm/adb/connection.js.map +1 -1
- package/esm/adb/index.d.ts +3 -3
- package/esm/adb/index.js +3 -3
- package/esm/adb/options/1_16.d.ts +7 -7
- package/esm/adb/options/1_16.d.ts.map +1 -1
- package/esm/adb/options/1_16.js +19 -19
- package/esm/adb/options/1_16.js.map +1 -1
- package/esm/adb/options/1_22.d.ts +7 -7
- package/esm/adb/options/1_22.d.ts.map +1 -1
- package/esm/adb/options/1_22.js +16 -16
- package/esm/adb/options/1_22.js.map +1 -1
- package/esm/adb/options/1_26.d.ts +9 -0
- package/esm/adb/options/1_26.d.ts.map +1 -0
- package/esm/adb/options/1_26.js +11 -0
- package/esm/adb/options/1_26.js.map +1 -0
- package/esm/adb/options/2_0.d.ts +8 -0
- package/esm/adb/options/2_0.d.ts.map +1 -0
- package/esm/adb/options/2_0.js +13 -0
- package/esm/adb/options/2_0.js.map +1 -0
- package/esm/adb/options/index.d.ts +3 -3
- package/esm/adb/options/index.js +3 -3
- package/esm/adb/options/types.d.ts +23 -23
- package/esm/adb/options/types.d.ts.map +1 -1
- package/esm/adb/options/types.js +36 -36
- package/esm/codec/av1.d.ts +33 -0
- package/esm/codec/av1.d.ts.map +1 -0
- package/esm/codec/av1.js +35 -0
- package/esm/codec/av1.js.map +1 -0
- package/esm/codec/h264.d.ts +98 -0
- package/esm/codec/h264.d.ts.map +1 -0
- package/esm/codec/h264.js +477 -0
- package/esm/codec/h264.js.map +1 -0
- package/esm/codec/h265.d.ts +36 -0
- package/esm/codec/h265.d.ts.map +1 -0
- package/esm/codec/h265.js +38 -0
- package/esm/codec/h265.js.map +1 -0
- package/esm/codec/index.d.ts +4 -0
- package/esm/codec/index.d.ts.map +1 -0
- package/esm/codec/index.js +4 -0
- package/esm/codec/index.js.map +1 -0
- package/esm/codec.d.ts +33 -33
- package/esm/codec.js +36 -36
- package/esm/control/back-or-screen-on.d.ts +2 -2
- package/esm/control/back-or-screen-on.d.ts.map +1 -1
- package/esm/control/back-or-screen-on.js +1 -1
- package/esm/control/basic.d.ts +5 -0
- package/esm/control/basic.d.ts.map +1 -0
- package/esm/control/basic.js +3 -0
- package/esm/control/basic.js.map +1 -0
- package/esm/control/hover-helper.d.ts +17 -17
- package/esm/control/hover-helper.d.ts.map +1 -1
- package/esm/control/hover-helper.js +43 -43
- package/esm/control/hover-helper.js.map +1 -1
- package/esm/control/index.d.ts +11 -11
- package/esm/control/index.js +11 -11
- package/esm/control/inject-keycode.d.ts +194 -60
- package/esm/control/inject-keycode.d.ts.map +1 -1
- package/esm/control/inject-keycode.js +199 -61
- package/esm/control/inject-keycode.js.map +1 -1
- package/esm/control/inject-scroll.d.ts +2 -2
- package/esm/control/inject-scroll.d.ts.map +1 -1
- package/esm/control/inject-scroll.js +1 -1
- package/esm/control/inject-text.d.ts +8 -8
- package/esm/control/inject-text.d.ts.map +1 -1
- package/esm/control/inject-text.js +6 -6
- package/esm/control/inject-text.js.map +1 -1
- package/esm/control/inject-touch.d.ts +37 -37
- package/esm/control/inject-touch.d.ts.map +1 -1
- package/esm/control/inject-touch.js +62 -62
- package/esm/control/rotate-device.d.ts +6 -6
- package/esm/control/rotate-device.d.ts.map +1 -1
- package/esm/control/rotate-device.js +3 -4
- package/esm/control/rotate-device.js.map +1 -1
- package/esm/control/serializer.d.ts +35 -33
- package/esm/control/serializer.d.ts.map +1 -1
- package/esm/control/serializer.js +82 -78
- package/esm/control/serializer.js.map +1 -1
- package/esm/control/set-clipboard.d.ts +2 -2
- package/esm/control/set-clipboard.d.ts.map +1 -1
- package/esm/control/set-clipboard.js +1 -1
- package/esm/control/set-screen-power-mode.d.ts +11 -11
- package/esm/control/set-screen-power-mode.d.ts.map +1 -1
- package/esm/control/set-screen-power-mode.js +11 -11
- package/esm/control/set-screen-power-mode.js.map +1 -1
- package/esm/control/simple.d.ts +5 -0
- package/esm/control/simple.d.ts.map +1 -0
- package/esm/control/simple.js +3 -0
- package/esm/control/simple.js.map +1 -0
- package/esm/control/type.d.ts +14 -14
- package/esm/control/type.js +18 -18
- package/esm/decoder.d.ts +2 -0
- package/esm/decoder.d.ts.map +1 -0
- package/esm/decoder.js +2 -0
- package/esm/decoder.js.map +1 -0
- package/esm/device-message/ack-clipboard.d.ts +8 -8
- package/esm/device-message/ack-clipboard.d.ts.map +1 -1
- package/esm/device-message/ack-clipboard.js +5 -5
- package/esm/device-message/clipboard.d.ts +9 -9
- package/esm/device-message/clipboard.d.ts.map +1 -1
- package/esm/device-message/clipboard.js +6 -6
- package/esm/device-message/index.d.ts +4 -4
- package/esm/device-message/index.js +4 -4
- package/esm/device-message/stream.d.ts +7 -7
- package/esm/device-message/stream.js +19 -19
- package/esm/device-message/type.d.ts +4 -4
- package/esm/device-message/type.js +6 -6
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/options/1.17.d.ts +3 -0
- package/esm/options/1.17.d.ts.map +1 -0
- package/esm/options/1.17.js +2 -0
- package/esm/options/1.17.js.map +1 -0
- package/esm/options/1_16/codec-options.d.ts +20 -19
- package/esm/options/1_16/codec-options.d.ts.map +1 -1
- package/esm/options/1_16/codec-options.js +25 -25
- package/esm/options/1_16/codec-options.js.map +1 -1
- package/esm/options/1_16/float-to-uint16.d.ts +5 -0
- package/esm/options/1_16/float-to-uint16.d.ts.map +1 -0
- package/esm/options/1_16/float-to-uint16.js +27 -0
- package/esm/options/1_16/float-to-uint16.js.map +1 -0
- package/esm/options/1_16/h264-configuration.d.ts +48 -48
- package/esm/options/1_16/h264-configuration.js +413 -413
- package/esm/options/1_16/index.d.ts +4 -4
- package/esm/options/1_16/index.js +4 -4
- package/esm/options/1_16/init.d.ts +66 -0
- package/esm/options/1_16/init.d.ts.map +1 -0
- package/esm/options/1_16/init.js +16 -0
- package/esm/options/1_16/init.js.map +1 -0
- package/esm/options/1_16/message.d.ts +32 -0
- package/esm/options/1_16/message.d.ts.map +1 -0
- package/esm/options/1_16/message.js +37 -0
- package/esm/options/1_16/message.js.map +1 -0
- package/esm/options/1_16/options.d.ts +102 -93
- package/esm/options/1_16/options.d.ts.map +1 -1
- package/esm/options/1_16/options.js +189 -189
- package/esm/options/1_16/options.js.map +1 -1
- package/esm/options/1_16/scroll.d.ts +27 -26
- package/esm/options/1_16/scroll.d.ts.map +1 -1
- package/esm/options/1_16/scroll.js +55 -55
- package/esm/options/1_16/scroll.js.map +1 -1
- package/esm/options/1_17.d.ts +32 -0
- package/esm/options/1_17.d.ts.map +1 -0
- package/esm/options/1_17.js +36 -0
- package/esm/options/1_17.js.map +1 -0
- package/esm/options/1_18.d.ts +21 -19
- package/esm/options/1_18.d.ts.map +1 -1
- package/esm/options/1_18.js +45 -45
- package/esm/options/1_18.js.map +1 -1
- package/esm/options/1_21.d.ts +22 -20
- package/esm/options/1_21.d.ts.map +1 -1
- package/esm/options/1_21.js +36 -36
- package/esm/options/1_21.js.map +1 -1
- package/esm/options/1_22/index.d.ts +2 -2
- package/esm/options/1_22/index.js +2 -2
- package/esm/options/1_22/init.d.ts +17 -0
- package/esm/options/1_22/init.d.ts.map +1 -0
- package/esm/options/1_22/init.js +2 -0
- package/esm/options/1_22/init.js.map +1 -0
- package/esm/options/1_22/options.d.ts +29 -28
- package/esm/options/1_22/options.d.ts.map +1 -1
- package/esm/options/1_22/options.js +25 -25
- package/esm/options/1_22/options.js.map +1 -1
- package/esm/options/1_22/scroll.d.ts +16 -16
- package/esm/options/1_22/scroll.d.ts.map +1 -1
- package/esm/options/1_22/scroll.js +14 -14
- package/esm/options/1_23.d.ts +12 -11
- package/esm/options/1_23.d.ts.map +1 -1
- package/esm/options/1_23.js +34 -34
- package/esm/options/1_23.js.map +1 -1
- package/esm/options/1_24.d.ts +9 -8
- package/esm/options/1_24.d.ts.map +1 -1
- package/esm/options/1_24.js +12 -12
- package/esm/options/1_24.js.map +1 -1
- package/esm/options/1_25/index.d.ts +2 -2
- package/esm/options/1_25/index.js +2 -2
- package/esm/options/1_25/options.d.ts +6 -5
- package/esm/options/1_25/options.d.ts.map +1 -1
- package/esm/options/1_25/options.js +7 -7
- package/esm/options/1_25/options.js.map +1 -1
- package/esm/options/1_25/scroll.d.ts +19 -18
- package/esm/options/1_25/scroll.d.ts.map +1 -1
- package/esm/options/1_25/scroll.js +32 -32
- package/esm/options/1_25/scroll.js.map +1 -1
- package/esm/options/1_26.d.ts +57 -0
- package/esm/options/1_26.d.ts.map +1 -0
- package/esm/options/1_26.js +67 -0
- package/esm/options/1_26.js.map +1 -0
- package/esm/options/2.d.ts +57 -0
- package/esm/options/2.d.ts.map +1 -0
- package/esm/options/2.js +67 -0
- package/esm/options/2.js.map +1 -0
- package/esm/options/2_0.d.ts +87 -0
- package/esm/options/2_0.d.ts.map +1 -0
- package/esm/options/2_0.js +175 -0
- package/esm/options/2_0.js.map +1 -0
- package/esm/options/codec.d.ts +52 -0
- package/esm/options/codec.d.ts.map +1 -0
- package/esm/options/codec.js +26 -0
- package/esm/options/codec.js.map +1 -0
- package/esm/options/index.d.ts +8 -8
- package/esm/options/index.js +8 -8
- package/esm/options/latest.d.ts +12 -0
- package/esm/options/latest.d.ts.map +1 -0
- package/esm/options/latest.js +8 -0
- package/esm/options/latest.js.map +1 -0
- package/esm/options/types.d.ts +46 -46
- package/esm/options/types.d.ts.map +1 -1
- package/esm/options/types.js +17 -17
- package/package.json +11 -10
- package/src/adb/client.ts +72 -88
- package/src/adb/connection.ts +42 -25
- package/src/adb/index.ts +3 -3
- package/src/adb/options/1_16.ts +6 -4
- package/src/adb/options/1_22.ts +3 -3
- package/src/adb/options/index.ts +3 -3
- package/src/adb/options/types.ts +10 -10
- package/src/control/back-or-screen-on.ts +1 -1
- package/src/control/hover-helper.ts +2 -4
- package/src/control/inject-keycode.ts +193 -48
- package/src/control/inject-scroll.ts +1 -1
- package/src/control/inject-text.ts +7 -8
- package/src/control/inject-touch.ts +1 -1
- package/src/control/rotate-device.ts +7 -6
- package/src/control/serializer.ts +29 -26
- package/src/control/set-clipboard.ts +1 -1
- package/src/control/set-screen-power-mode.ts +7 -8
- package/src/device-message/ack-clipboard.ts +1 -1
- package/src/device-message/clipboard.ts +1 -1
- package/src/index.ts +5 -5
- package/src/options/1_16/codec-options.ts +4 -6
- package/src/options/1_16/options.ts +17 -12
- package/src/options/1_16/scroll.ts +2 -4
- package/src/options/1_18.ts +6 -6
- package/src/options/1_21.ts +5 -6
- package/src/options/1_22/options.ts +3 -2
- package/src/options/1_22/scroll.ts +1 -1
- package/src/options/1_23.ts +3 -5
- package/src/options/1_24.ts +5 -3
- package/src/options/1_25/options.ts +3 -2
- package/src/options/1_25/scroll.ts +4 -7
- package/src/options/index.ts +3 -3
- package/src/options/types.ts +8 -8
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import Struct, { NumberFieldType } from "@yume-chan/struct";
|
|
2
|
-
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
-
export declare enum AndroidMotionEventAction {
|
|
4
|
-
Down = 0,
|
|
5
|
-
Up = 1,
|
|
6
|
-
Move = 2,
|
|
7
|
-
Cancel = 3,
|
|
8
|
-
Outside = 4,
|
|
9
|
-
PointerDown = 5,
|
|
10
|
-
PointerUp = 6,
|
|
11
|
-
HoverMove = 7,
|
|
12
|
-
Scroll = 8,
|
|
13
|
-
HoverEnter = 9,
|
|
14
|
-
HoverExit = 10,
|
|
15
|
-
ButtonPress = 11,
|
|
16
|
-
ButtonRelease = 12
|
|
17
|
-
}
|
|
18
|
-
export declare namespace ScrcpyPointerId {
|
|
19
|
-
const Mouse: bigint;
|
|
20
|
-
const Finger: bigint;
|
|
21
|
-
const VirtualMouse: bigint;
|
|
22
|
-
const VirtualFinger: bigint;
|
|
23
|
-
}
|
|
24
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
25
|
-
export declare const ScrcpyFloatToUint16NumberType: NumberFieldType;
|
|
26
|
-
export declare const ScrcpyInjectTouchControlMessage: Struct<{
|
|
27
|
-
type: ScrcpyControlMessageType.InjectTouch;
|
|
28
|
-
action: AndroidMotionEventAction;
|
|
29
|
-
pointerId: bigint;
|
|
30
|
-
pointerX: number;
|
|
31
|
-
pointerY: number;
|
|
32
|
-
screenWidth: number;
|
|
33
|
-
screenHeight: number;
|
|
34
|
-
pressure: number;
|
|
35
|
-
buttons: number;
|
|
36
|
-
}, never, Record<never, never>, undefined>;
|
|
37
|
-
export type ScrcpyInjectTouchControlMessage = typeof ScrcpyInjectTouchControlMessage["TInit"];
|
|
1
|
+
import Struct, { NumberFieldType } from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
export declare enum AndroidMotionEventAction {
|
|
4
|
+
Down = 0,
|
|
5
|
+
Up = 1,
|
|
6
|
+
Move = 2,
|
|
7
|
+
Cancel = 3,
|
|
8
|
+
Outside = 4,
|
|
9
|
+
PointerDown = 5,
|
|
10
|
+
PointerUp = 6,
|
|
11
|
+
HoverMove = 7,
|
|
12
|
+
Scroll = 8,
|
|
13
|
+
HoverEnter = 9,
|
|
14
|
+
HoverExit = 10,
|
|
15
|
+
ButtonPress = 11,
|
|
16
|
+
ButtonRelease = 12
|
|
17
|
+
}
|
|
18
|
+
export declare namespace ScrcpyPointerId {
|
|
19
|
+
const Mouse: bigint;
|
|
20
|
+
const Finger: bigint;
|
|
21
|
+
const VirtualMouse: bigint;
|
|
22
|
+
const VirtualFinger: bigint;
|
|
23
|
+
}
|
|
24
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
25
|
+
export declare const ScrcpyFloatToUint16NumberType: NumberFieldType;
|
|
26
|
+
export declare const ScrcpyInjectTouchControlMessage: Struct<{
|
|
27
|
+
type: ScrcpyControlMessageType.InjectTouch;
|
|
28
|
+
action: AndroidMotionEventAction;
|
|
29
|
+
pointerId: bigint;
|
|
30
|
+
pointerX: number;
|
|
31
|
+
pointerY: number;
|
|
32
|
+
screenWidth: number;
|
|
33
|
+
screenHeight: number;
|
|
34
|
+
pressure: number;
|
|
35
|
+
buttons: number;
|
|
36
|
+
}, never, Record<never, never>, undefined>;
|
|
37
|
+
export type ScrcpyInjectTouchControlMessage = (typeof ScrcpyInjectTouchControlMessage)["TInit"];
|
|
38
38
|
//# sourceMappingURL=inject-touch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-touch.d.ts","sourceRoot":"","sources":["../../src/control/inject-touch.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAEX,eAAe,EAElB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,oBAAY,wBAAwB;IAChC,IAAI,IAAA;IACJ,EAAE,IAAA;IACF,IAAI,IAAA;IACJ,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,SAAS,IAAA;IACT,SAAS,IAAA;IACT,MAAM,IAAA;IACN,UAAU,IAAA;IACV,SAAS,KAAA;IACT,WAAW,KAAA;IACX,aAAa,KAAA;CAChB;AAGD,yBAAiB,eAAe,CAAC;IACtB,MAAM,KAAK,QAAa,CAAC;IACzB,MAAM,MAAM,QAAa,CAAC;IAC1B,MAAM,YAAY,QAAa,CAAC;IAChC,MAAM,aAAa,QAAa,CAAC;CAC3C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUrE;AAED,eAAO,MAAM,6BAA6B,EAAE,eAc3C,CAAC;AAMF,eAAO,MAAM,+BAA+B;;;;;;;;;;0CAStB,CAAC;AAEvB,MAAM,MAAM,+BAA+B,GACvC,OAAO,+BAA+B,CAAC,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"inject-touch.d.ts","sourceRoot":"","sources":["../../src/control/inject-touch.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAEX,eAAe,EAElB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,oBAAY,wBAAwB;IAChC,IAAI,IAAA;IACJ,EAAE,IAAA;IACF,IAAI,IAAA;IACJ,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,SAAS,IAAA;IACT,SAAS,IAAA;IACT,MAAM,IAAA;IACN,UAAU,IAAA;IACV,SAAS,KAAA;IACT,WAAW,KAAA;IACX,aAAa,KAAA;CAChB;AAGD,yBAAiB,eAAe,CAAC;IACtB,MAAM,KAAK,QAAa,CAAC;IACzB,MAAM,MAAM,QAAa,CAAC;IAC1B,MAAM,YAAY,QAAa,CAAC;IAChC,MAAM,aAAa,QAAa,CAAC;CAC3C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUrE;AAED,eAAO,MAAM,6BAA6B,EAAE,eAc3C,CAAC;AAMF,eAAO,MAAM,+BAA+B;;;;;;;;;;0CAStB,CAAC;AAEvB,MAAM,MAAM,+BAA+B,GACvC,CAAC,OAAO,+BAA+B,CAAC,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import Struct, { NumberFieldDefinition, NumberFieldType, placeholder, } from "@yume-chan/struct";
|
|
2
|
-
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
-
// https://developer.android.com/reference/android/view/MotionEvent#constants_1
|
|
4
|
-
export var AndroidMotionEventAction;
|
|
5
|
-
(function (AndroidMotionEventAction) {
|
|
6
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Down"] = 0] = "Down";
|
|
7
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Up"] = 1] = "Up";
|
|
8
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Move"] = 2] = "Move";
|
|
9
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Cancel"] = 3] = "Cancel";
|
|
10
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Outside"] = 4] = "Outside";
|
|
11
|
-
AndroidMotionEventAction[AndroidMotionEventAction["PointerDown"] = 5] = "PointerDown";
|
|
12
|
-
AndroidMotionEventAction[AndroidMotionEventAction["PointerUp"] = 6] = "PointerUp";
|
|
13
|
-
AndroidMotionEventAction[AndroidMotionEventAction["HoverMove"] = 7] = "HoverMove";
|
|
14
|
-
AndroidMotionEventAction[AndroidMotionEventAction["Scroll"] = 8] = "Scroll";
|
|
15
|
-
AndroidMotionEventAction[AndroidMotionEventAction["HoverEnter"] = 9] = "HoverEnter";
|
|
16
|
-
AndroidMotionEventAction[AndroidMotionEventAction["HoverExit"] = 10] = "HoverExit";
|
|
17
|
-
AndroidMotionEventAction[AndroidMotionEventAction["ButtonPress"] = 11] = "ButtonPress";
|
|
18
|
-
AndroidMotionEventAction[AndroidMotionEventAction["ButtonRelease"] = 12] = "ButtonRelease";
|
|
19
|
-
})(AndroidMotionEventAction = AndroidMotionEventAction || (AndroidMotionEventAction = {}));
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
21
|
-
export var ScrcpyPointerId;
|
|
22
|
-
(function (ScrcpyPointerId) {
|
|
23
|
-
ScrcpyPointerId.Mouse = BigInt(-1);
|
|
24
|
-
ScrcpyPointerId.Finger = BigInt(-2);
|
|
25
|
-
ScrcpyPointerId.VirtualMouse = BigInt(-3);
|
|
26
|
-
ScrcpyPointerId.VirtualFinger = BigInt(-4);
|
|
27
|
-
})(ScrcpyPointerId = ScrcpyPointerId || (ScrcpyPointerId = {}));
|
|
28
|
-
export function clamp(value, min, max) {
|
|
29
|
-
if (value < min) {
|
|
30
|
-
return min;
|
|
31
|
-
}
|
|
32
|
-
if (value > max) {
|
|
33
|
-
return max;
|
|
34
|
-
}
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
export const ScrcpyFloatToUint16NumberType = {
|
|
38
|
-
size: 2,
|
|
39
|
-
signed: false,
|
|
40
|
-
deserialize(array, littleEndian) {
|
|
41
|
-
const value = NumberFieldType.Uint16.deserialize(array, littleEndian);
|
|
42
|
-
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/server/src/main/java/com/genymobile/scrcpy/Binary.java#L22
|
|
43
|
-
return value === 0xffff ? 1 : value / 0x10000;
|
|
44
|
-
},
|
|
45
|
-
serialize(dataView, offset, value, littleEndian) {
|
|
46
|
-
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/app/src/util/binary.h#L51
|
|
47
|
-
value = clamp(value, -1, 1);
|
|
48
|
-
value = value === 1 ? 0xffff : value * 0x10000;
|
|
49
|
-
NumberFieldType.Uint16.serialize(dataView, offset, value, littleEndian);
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
const ScrcpyFloatToUint16FieldDefinition = new NumberFieldDefinition(ScrcpyFloatToUint16NumberType);
|
|
53
|
-
export const ScrcpyInjectTouchControlMessage = new Struct()
|
|
54
|
-
.uint8("type", ScrcpyControlMessageType.InjectTouch)
|
|
55
|
-
.uint8("action", placeholder())
|
|
56
|
-
.uint64("pointerId")
|
|
57
|
-
.uint32("pointerX")
|
|
58
|
-
.uint32("pointerY")
|
|
59
|
-
.uint16("screenWidth")
|
|
60
|
-
.uint16("screenHeight")
|
|
61
|
-
.field("pressure", ScrcpyFloatToUint16FieldDefinition)
|
|
62
|
-
.uint32("buttons");
|
|
1
|
+
import Struct, { NumberFieldDefinition, NumberFieldType, placeholder, } from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
// https://developer.android.com/reference/android/view/MotionEvent#constants_1
|
|
4
|
+
export var AndroidMotionEventAction;
|
|
5
|
+
(function (AndroidMotionEventAction) {
|
|
6
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Down"] = 0] = "Down";
|
|
7
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Up"] = 1] = "Up";
|
|
8
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Move"] = 2] = "Move";
|
|
9
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Cancel"] = 3] = "Cancel";
|
|
10
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Outside"] = 4] = "Outside";
|
|
11
|
+
AndroidMotionEventAction[AndroidMotionEventAction["PointerDown"] = 5] = "PointerDown";
|
|
12
|
+
AndroidMotionEventAction[AndroidMotionEventAction["PointerUp"] = 6] = "PointerUp";
|
|
13
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverMove"] = 7] = "HoverMove";
|
|
14
|
+
AndroidMotionEventAction[AndroidMotionEventAction["Scroll"] = 8] = "Scroll";
|
|
15
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverEnter"] = 9] = "HoverEnter";
|
|
16
|
+
AndroidMotionEventAction[AndroidMotionEventAction["HoverExit"] = 10] = "HoverExit";
|
|
17
|
+
AndroidMotionEventAction[AndroidMotionEventAction["ButtonPress"] = 11] = "ButtonPress";
|
|
18
|
+
AndroidMotionEventAction[AndroidMotionEventAction["ButtonRelease"] = 12] = "ButtonRelease";
|
|
19
|
+
})(AndroidMotionEventAction = AndroidMotionEventAction || (AndroidMotionEventAction = {}));
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
21
|
+
export var ScrcpyPointerId;
|
|
22
|
+
(function (ScrcpyPointerId) {
|
|
23
|
+
ScrcpyPointerId.Mouse = BigInt(-1);
|
|
24
|
+
ScrcpyPointerId.Finger = BigInt(-2);
|
|
25
|
+
ScrcpyPointerId.VirtualMouse = BigInt(-3);
|
|
26
|
+
ScrcpyPointerId.VirtualFinger = BigInt(-4);
|
|
27
|
+
})(ScrcpyPointerId = ScrcpyPointerId || (ScrcpyPointerId = {}));
|
|
28
|
+
export function clamp(value, min, max) {
|
|
29
|
+
if (value < min) {
|
|
30
|
+
return min;
|
|
31
|
+
}
|
|
32
|
+
if (value > max) {
|
|
33
|
+
return max;
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
export const ScrcpyFloatToUint16NumberType = {
|
|
38
|
+
size: 2,
|
|
39
|
+
signed: false,
|
|
40
|
+
deserialize(array, littleEndian) {
|
|
41
|
+
const value = NumberFieldType.Uint16.deserialize(array, littleEndian);
|
|
42
|
+
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/server/src/main/java/com/genymobile/scrcpy/Binary.java#L22
|
|
43
|
+
return value === 0xffff ? 1 : value / 0x10000;
|
|
44
|
+
},
|
|
45
|
+
serialize(dataView, offset, value, littleEndian) {
|
|
46
|
+
// https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/app/src/util/binary.h#L51
|
|
47
|
+
value = clamp(value, -1, 1);
|
|
48
|
+
value = value === 1 ? 0xffff : value * 0x10000;
|
|
49
|
+
NumberFieldType.Uint16.serialize(dataView, offset, value, littleEndian);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const ScrcpyFloatToUint16FieldDefinition = new NumberFieldDefinition(ScrcpyFloatToUint16NumberType);
|
|
53
|
+
export const ScrcpyInjectTouchControlMessage = new Struct()
|
|
54
|
+
.uint8("type", ScrcpyControlMessageType.InjectTouch)
|
|
55
|
+
.uint8("action", placeholder())
|
|
56
|
+
.uint64("pointerId")
|
|
57
|
+
.uint32("pointerX")
|
|
58
|
+
.uint32("pointerY")
|
|
59
|
+
.uint16("screenWidth")
|
|
60
|
+
.uint16("screenHeight")
|
|
61
|
+
.field("pressure", ScrcpyFloatToUint16FieldDefinition)
|
|
62
|
+
.uint32("buttons");
|
|
63
63
|
//# sourceMappingURL=inject-touch.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Struct from
|
|
2
|
-
import { ScrcpyControlMessageType } from
|
|
3
|
-
export declare const ScrcpyRotateDeviceControlMessage: Struct<{
|
|
4
|
-
type: ScrcpyControlMessageType.RotateDevice;
|
|
5
|
-
}, never, Record<never, never>, undefined>;
|
|
6
|
-
export type ScrcpyRotateDeviceControlMessage = typeof ScrcpyRotateDeviceControlMessage[
|
|
1
|
+
import Struct from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
export declare const ScrcpyRotateDeviceControlMessage: Struct<{
|
|
4
|
+
type: ScrcpyControlMessageType.RotateDevice;
|
|
5
|
+
}, never, Record<never, never>, undefined>;
|
|
6
|
+
export type ScrcpyRotateDeviceControlMessage = (typeof ScrcpyRotateDeviceControlMessage)["TInit"];
|
|
7
7
|
//# sourceMappingURL=rotate-device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rotate-device.d.ts","sourceRoot":"","sources":["../../src/control/rotate-device.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,eAAO,MAAM,gCAAgC;;
|
|
1
|
+
{"version":3,"file":"rotate-device.d.ts","sourceRoot":"","sources":["../../src/control/rotate-device.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,eAAO,MAAM,gCAAgC;;0CAG5C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GACxC,CAAC,OAAO,gCAAgC,CAAC,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import Struct from
|
|
2
|
-
import { ScrcpyControlMessageType } from
|
|
3
|
-
export const ScrcpyRotateDeviceControlMessage = new Struct()
|
|
4
|
-
.uint8('type', ScrcpyControlMessageType.RotateDevice);
|
|
1
|
+
import Struct from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
export const ScrcpyRotateDeviceControlMessage = new Struct().uint8("type", ScrcpyControlMessageType.RotateDevice);
|
|
5
4
|
//# sourceMappingURL=rotate-device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rotate-device.js","sourceRoot":"","sources":["../../src/control/rotate-device.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"rotate-device.js","sourceRoot":"","sources":["../../src/control/rotate-device.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAC9D,MAAM,EACN,wBAAwB,CAAC,YAAqB,CACjD,CAAC"}
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import type { Consumable, WritableStream } from "@yume-chan/stream-extra";
|
|
2
|
+
import type { ScrcpyOptions, ScrcpyOptionsInit1_16 } from "../options/index.js";
|
|
3
|
+
import type { AndroidKeyEventAction } from "./inject-keycode.js";
|
|
4
|
+
import { ScrcpyInjectKeyCodeControlMessage } from "./inject-keycode.js";
|
|
5
|
+
import type { ScrcpyInjectScrollControlMessage } from "./inject-scroll.js";
|
|
6
|
+
import { ScrcpyInjectTouchControlMessage } from "./inject-touch.js";
|
|
7
|
+
import type { AndroidScreenPowerMode } from "./set-screen-power-mode.js";
|
|
8
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
9
|
+
export declare class ScrcpyControlMessageSerializer {
|
|
10
|
+
private options;
|
|
11
|
+
/** Control message type values for current version of server */
|
|
12
|
+
private types;
|
|
13
|
+
private writer;
|
|
14
|
+
private scrollController;
|
|
15
|
+
constructor(stream: WritableStream<Consumable<Uint8Array>>, options: ScrcpyOptions<ScrcpyOptionsInit1_16>);
|
|
16
|
+
getActualMessageType(type: ScrcpyControlMessageType): number;
|
|
17
|
+
addMessageType<T extends {
|
|
18
|
+
type: ScrcpyControlMessageType;
|
|
19
|
+
}>(message: Omit<T, "type">, type: T["type"]): T;
|
|
20
|
+
private write;
|
|
21
|
+
injectKeyCode(message: Omit<ScrcpyInjectKeyCodeControlMessage, "type">): Promise<void>;
|
|
22
|
+
injectText(text: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* `pressure` is a float value between 0 and 1.
|
|
25
|
+
*/
|
|
26
|
+
injectTouch(message: Omit<ScrcpyInjectTouchControlMessage, "type">): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* `scrollX` and `scrollY` are float values between 0 and 1.
|
|
29
|
+
*/
|
|
30
|
+
injectScroll(message: Omit<ScrcpyInjectScrollControlMessage, "type">): Promise<void> | undefined;
|
|
31
|
+
backOrScreenOn(action: AndroidKeyEventAction): Promise<void>;
|
|
32
|
+
setScreenPowerMode(mode: AndroidScreenPowerMode): Promise<void>;
|
|
33
|
+
rotateDevice(): Promise<void>;
|
|
34
|
+
close(): Promise<void>;
|
|
35
|
+
}
|
|
34
36
|
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/control/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/control/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,cAAc,EAEjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EACR,aAAa,EACb,qBAAqB,EAExB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,qBAAa,8BAA8B;IACvC,OAAO,CAAC,OAAO,CAAuC;IACtD,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,MAAM,CAAsD;IACpE,OAAO,CAAC,gBAAgB,CAAyB;gBAG7C,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAC9C,OAAO,EAAE,aAAa,CAAC,qBAAqB,CAAC;IAS1C,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM;IAQ5D,cAAc,CAAC,CAAC,SAAS;QAAE,IAAI,EAAE,wBAAwB,CAAA;KAAE,EAC9D,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,EACxB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,GAChB,CAAC;YAKU,KAAK;IAIZ,aAAa,CAChB,OAAO,EAAE,IAAI,CAAC,iCAAiC,EAAE,MAAM,CAAC;IAYrD,UAAU,CAAC,IAAI,EAAE,MAAM;IAW9B;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,+BAA+B,EAAE,MAAM,CAAC;IAWzE;;OAEG;IACI,YAAY,CACf,OAAO,EAAE,IAAI,CAAC,gCAAgC,EAAE,MAAM,CAAC;IAa9C,cAAc,CAAC,MAAM,EAAE,qBAAqB;IAalD,kBAAkB,CAAC,IAAI,EAAE,sBAAsB;IAW/C,YAAY;IAUZ,KAAK;CAGf"}
|
|
@@ -1,79 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
1
|
+
import { ConsumableWritableStream } from "@yume-chan/stream-extra";
|
|
2
|
+
import { ScrcpyInjectKeyCodeControlMessage } from "./inject-keycode.js";
|
|
3
|
+
import { ScrcpyInjectTextControlMessage } from "./inject-text.js";
|
|
4
|
+
import { ScrcpyInjectTouchControlMessage } from "./inject-touch.js";
|
|
5
|
+
import { ScrcpyRotateDeviceControlMessage } from "./rotate-device.js";
|
|
6
|
+
import { ScrcpySetScreenPowerModeControlMessage } from "./set-screen-power-mode.js";
|
|
7
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
8
|
+
export class ScrcpyControlMessageSerializer {
|
|
9
|
+
options;
|
|
10
|
+
/** Control message type values for current version of server */
|
|
11
|
+
types;
|
|
12
|
+
writer;
|
|
13
|
+
scrollController;
|
|
14
|
+
constructor(stream, options) {
|
|
15
|
+
this.writer = stream.getWriter();
|
|
16
|
+
this.options = options;
|
|
17
|
+
this.types = options.getControlMessageTypes();
|
|
18
|
+
this.scrollController = options.getScrollController();
|
|
19
|
+
}
|
|
20
|
+
getActualMessageType(type) {
|
|
21
|
+
const value = this.types.indexOf(type);
|
|
22
|
+
if (value === -1) {
|
|
23
|
+
throw new Error("Not supported");
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
addMessageType(message, type) {
|
|
28
|
+
message.type = this.getActualMessageType(type);
|
|
29
|
+
return message;
|
|
30
|
+
}
|
|
31
|
+
async write(data) {
|
|
32
|
+
await ConsumableWritableStream.write(this.writer, data);
|
|
33
|
+
}
|
|
34
|
+
injectKeyCode(message) {
|
|
35
|
+
return this.write(ScrcpyInjectKeyCodeControlMessage.serialize(this.addMessageType(message, ScrcpyControlMessageType.InjectKeyCode)));
|
|
36
|
+
}
|
|
37
|
+
injectText(text) {
|
|
38
|
+
return this.write(ScrcpyInjectTextControlMessage.serialize({
|
|
39
|
+
text,
|
|
40
|
+
type: this.getActualMessageType(ScrcpyControlMessageType.InjectText),
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* `pressure` is a float value between 0 and 1.
|
|
45
|
+
*/
|
|
46
|
+
injectTouch(message) {
|
|
47
|
+
return this.write(ScrcpyInjectTouchControlMessage.serialize(this.addMessageType(message, ScrcpyControlMessageType.InjectTouch)));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `scrollX` and `scrollY` are float values between 0 and 1.
|
|
51
|
+
*/
|
|
52
|
+
injectScroll(message) {
|
|
53
|
+
const data = this.scrollController.serializeScrollMessage(this.addMessageType(message, ScrcpyControlMessageType.InjectScroll));
|
|
54
|
+
if (!data) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
return this.write(data);
|
|
58
|
+
}
|
|
59
|
+
async backOrScreenOn(action) {
|
|
60
|
+
const buffer = this.options.serializeBackOrScreenOnControlMessage({
|
|
61
|
+
action,
|
|
62
|
+
type: this.getActualMessageType(ScrcpyControlMessageType.BackOrScreenOn),
|
|
63
|
+
});
|
|
64
|
+
if (buffer) {
|
|
65
|
+
return await this.write(buffer);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
setScreenPowerMode(mode) {
|
|
69
|
+
return this.write(ScrcpySetScreenPowerModeControlMessage.serialize({
|
|
70
|
+
mode,
|
|
71
|
+
type: this.getActualMessageType(ScrcpyControlMessageType.SetScreenPowerMode),
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
rotateDevice() {
|
|
75
|
+
return this.write(ScrcpyRotateDeviceControlMessage.serialize({
|
|
76
|
+
type: this.getActualMessageType(ScrcpyControlMessageType.RotateDevice),
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
close() {
|
|
80
|
+
return this.writer.close();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
79
83
|
//# sourceMappingURL=serializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/control/serializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/control/serializer.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ScrcpySetClipboardControlMessage = ScrcpySetClipboardControlMessage1_21;
|
|
1
|
+
import type { ScrcpySetClipboardControlMessage1_21 } from "../options/index.js";
|
|
2
|
+
export type ScrcpySetClipboardControlMessage = ScrcpySetClipboardControlMessage1_21;
|
|
3
3
|
//# sourceMappingURL=set-clipboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-clipboard.d.ts","sourceRoot":"","sources":["../../src/control/set-clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"set-clipboard.d.ts","sourceRoot":"","sources":["../../src/control/set-clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,qBAAqB,CAAC;AAEhF,MAAM,MAAM,gCAAgC,GACxC,oCAAoC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=set-clipboard.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Struct from
|
|
2
|
-
import { ScrcpyControlMessageType } from
|
|
3
|
-
export declare enum AndroidScreenPowerMode {
|
|
4
|
-
Off = 0,
|
|
5
|
-
Normal = 2
|
|
6
|
-
}
|
|
7
|
-
export declare const ScrcpySetScreenPowerModeControlMessage: Struct<{
|
|
8
|
-
type: ScrcpyControlMessageType.SetScreenPowerMode;
|
|
9
|
-
mode: AndroidScreenPowerMode;
|
|
10
|
-
}, never, Record<never, never>, undefined>;
|
|
11
|
-
export type ScrcpySetScreenPowerModeControlMessage = typeof ScrcpySetScreenPowerModeControlMessage[
|
|
1
|
+
import Struct from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
export declare enum AndroidScreenPowerMode {
|
|
4
|
+
Off = 0,
|
|
5
|
+
Normal = 2
|
|
6
|
+
}
|
|
7
|
+
export declare const ScrcpySetScreenPowerModeControlMessage: Struct<{
|
|
8
|
+
type: ScrcpyControlMessageType.SetScreenPowerMode;
|
|
9
|
+
mode: AndroidScreenPowerMode;
|
|
10
|
+
}, never, Record<never, never>, undefined>;
|
|
11
|
+
export type ScrcpySetScreenPowerModeControlMessage = (typeof ScrcpySetScreenPowerModeControlMessage)["TInit"];
|
|
12
12
|
//# sourceMappingURL=set-screen-power-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-screen-power-mode.d.ts","sourceRoot":"","sources":["../../src/control/set-screen-power-mode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,oBAAY,sBAAsB;IAC9B,GAAG,IAAI;IACP,MAAM,IAAI;CACb;AAED,eAAO,MAAM,sCAAsC;;;
|
|
1
|
+
{"version":3,"file":"set-screen-power-mode.d.ts","sourceRoot":"","sources":["../../src/control/set-screen-power-mode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,oBAAY,sBAAsB;IAC9B,GAAG,IAAI;IACP,MAAM,IAAI;CACb;AAED,eAAO,MAAM,sCAAsC;;;0CAEM,CAAC;AAE1D,MAAM,MAAM,sCAAsC,GAC9C,CAAC,OAAO,sCAAsC,CAAC,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Struct, { placeholder } from
|
|
2
|
-
import { ScrcpyControlMessageType } from
|
|
3
|
-
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/view/SurfaceControl.java;l=659;drc=20303e05bf73796124ab70a279cf849b61b97905
|
|
4
|
-
export var AndroidScreenPowerMode;
|
|
5
|
-
(function (AndroidScreenPowerMode) {
|
|
6
|
-
AndroidScreenPowerMode[AndroidScreenPowerMode["Off"] = 0] = "Off";
|
|
7
|
-
AndroidScreenPowerMode[AndroidScreenPowerMode["Normal"] = 2] = "Normal";
|
|
8
|
-
})(AndroidScreenPowerMode = AndroidScreenPowerMode || (AndroidScreenPowerMode = {}));
|
|
9
|
-
export const ScrcpySetScreenPowerModeControlMessage = new Struct()
|
|
10
|
-
.uint8(
|
|
11
|
-
.uint8(
|
|
1
|
+
import Struct, { placeholder } from "@yume-chan/struct";
|
|
2
|
+
import { ScrcpyControlMessageType } from "./type.js";
|
|
3
|
+
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/view/SurfaceControl.java;l=659;drc=20303e05bf73796124ab70a279cf849b61b97905
|
|
4
|
+
export var AndroidScreenPowerMode;
|
|
5
|
+
(function (AndroidScreenPowerMode) {
|
|
6
|
+
AndroidScreenPowerMode[AndroidScreenPowerMode["Off"] = 0] = "Off";
|
|
7
|
+
AndroidScreenPowerMode[AndroidScreenPowerMode["Normal"] = 2] = "Normal";
|
|
8
|
+
})(AndroidScreenPowerMode = AndroidScreenPowerMode || (AndroidScreenPowerMode = {}));
|
|
9
|
+
export const ScrcpySetScreenPowerModeControlMessage = new Struct()
|
|
10
|
+
.uint8("type", ScrcpyControlMessageType.SetScreenPowerMode)
|
|
11
|
+
.uint8("mode", placeholder());
|
|
12
12
|
//# sourceMappingURL=set-screen-power-mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-screen-power-mode.js","sourceRoot":"","sources":["../../src/control/set-screen-power-mode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8KAA8K;AAC9K,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,iEAAO,CAAA;IACP,uEAAU,CAAA;AACd,CAAC,EAHW,sBAAsB,GAAtB,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAC,MAAM,sCAAsC,
|
|
1
|
+
{"version":3,"file":"set-screen-power-mode.js","sourceRoot":"","sources":["../../src/control/set-screen-power-mode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8KAA8K;AAC9K,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,iEAAO,CAAA;IACP,uEAAU,CAAA;AACd,CAAC,EAHW,sBAAsB,GAAtB,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,IAAI,MAAM,EAAE;KAC7D,KAAK,CAAC,MAAM,EAAE,wBAAwB,CAAC,kBAA2B,CAAC;KACnE,KAAK,CAAC,MAAM,EAAE,WAAW,EAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/control/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,eAAO,MAAM,mBAAmB;;0CAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple.js","sourceRoot":"","sources":["../../src/control/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC"}
|