refactor(scrcpy): rewrite option classes to improve tree-shaking

This commit is contained in:
Simon Chan 2024-11-25 18:10:15 +08:00
parent db8466f6ee
commit 92472007db
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
218 changed files with 5412 additions and 2380 deletions

View file

@ -0,0 +1,23 @@
import type { StructInit } from "@yume-chan/struct";
import { struct, u32, u8 } from "@yume-chan/struct";
import type {
AndroidKeyCode,
AndroidKeyEventAction,
AndroidKeyEventMeta,
} from "../android/index.js";
export const ScrcpyInjectKeyCodeControlMessage = struct(
{
type: u8,
action: u8<AndroidKeyEventAction>(),
keyCode: u32<AndroidKeyCode>(),
repeat: u32,
metaState: u32<AndroidKeyEventMeta>(),
},
{ littleEndian: false },
);
export type ScrcpyInjectKeyCodeControlMessage = StructInit<
typeof ScrcpyInjectKeyCodeControlMessage
>;