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

Unverified Commit dbcfd34c authored by Simon Chan's avatar Simon Chan
Browse files

feat(adb): add `AdbServerClient.prototype.createAdb()`

as a shorthand for `createTransport` and `new Adb`
parent 798b136f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
---
"@yume-chan/adb": patch
---

Add `AdbServerClient.prototype.createAdb()` as a shorthand for `createTransport` and `new Adb`
+6 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import type {
import { AbortController } from "@yume-chan/stream-extra";

import type { AdbIncomingSocketHandler, AdbSocket, Closeable } from "../adb.js";
import { Adb } from "../adb.js";
import { AdbBanner } from "../banner.js";
import type { DeviceObserver as DeviceObserverBase } from "../device-observer.js";
import type { AdbFeature } from "../features.js";
@@ -466,6 +467,11 @@ export class AdbServerClient {

        return transport;
    }

    async createAdb(device: AdbServerClient.DeviceSelector) {
        const transport = await this.createTransport(device);
        return new Adb(transport);
    }
}

export async function raceSignal<T>(