Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 76c020b4 authored by Simon Chan's avatar Simon Chan
Browse files

fix(scrcpy): fix typing

parent af90a5bc
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -27,25 +27,25 @@ export class ScrcpyControlMessageWriter {
        this.#serializer = new ScrcpyControlMessageSerializer(options);
    }

    async #write(message: Uint8Array) {
    async write(message: Uint8Array) {
        await ConsumableWritableStream.write(this.#writer, message);
    }

    async injectKeyCode(
        message: Omit<ScrcpyInjectKeyCodeControlMessage, "type">,
    ) {
        await this.#write(this.#serializer.injectKeyCode(message));
        await this.write(this.#serializer.injectKeyCode(message));
    }

    async injectText(text: string) {
        await this.#write(this.#serializer.injectText(text));
        await this.write(this.#serializer.injectText(text));
    }

    /**
     * `pressure` is a float value between 0 and 1.
     */
    async injectTouch(message: Omit<ScrcpyInjectTouchControlMessage, "type">) {
        await this.#write(this.#serializer.injectTouch(message));
        await this.write(this.#serializer.injectTouch(message));
    }

    /**
@@ -56,23 +56,23 @@ export class ScrcpyControlMessageWriter {
    ) {
        const data = this.#serializer.injectScroll(message);
        if (data) {
            await this.#write(data);
            await this.write(data);
        }
    }

    async backOrScreenOn(action: AndroidKeyEventAction) {
        const data = this.#serializer.backOrScreenOn(action);
        if (data) {
            await this.#write(data);
            await this.write(data);
        }
    }

    async setScreenPowerMode(mode: AndroidScreenPowerMode) {
        await this.#write(this.#serializer.setScreenPowerMode(mode));
        await this.write(this.#serializer.setScreenPowerMode(mode));
    }

    async rotateDevice() {
        await this.#write(this.#serializer.rotateDevice());
        await this.write(this.#serializer.rotateDevice());
    }

    releaseLock() {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ export class ScrcpyOptions1_16 implements ScrcpyOptions<ScrcpyOptionsInit1_16> {
        maxFps: 0,
        lockVideoOrientation: ScrcpyVideoOrientation1_16.Unlocked,
        tunnelForward: false,
        crop: undefined,
        crop: "",
        sendFrameMeta: true,
        control: true,
        displayId: 0,