Skip to content

Commit

Permalink
fix(scrcpy): fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Aug 26, 2023
1 parent af90a5b commit 76c020b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions libraries/scrcpy/src/control/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion libraries/scrcpy/src/options/1_16/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

1 comment on commit 76c020b

@vercel
Copy link

@vercel vercel bot commented on 76c020b Aug 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.