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

This commit is contained in:
Simon Chan 2024-11-27 14:43:33 +08:00
parent 92472007db
commit cc5d52912e
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
63 changed files with 595 additions and 325 deletions

View file

@ -54,6 +54,10 @@ export class ScrcpyOptions2_3 implements ScrcpyOptions<Init> {
constructor(init: Init) {
this.value = { ...Defaults, ...init };
if (this.value.videoSource === "camera") {
this.value.control = false;
}
if (this.value.control && this.value.clipboardAutosync) {
this.#clipboard = new ClipboardStream();
this.#ackClipboardHandler = new AckClipboardHandler();