mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-05 19:42:15 +02:00
feat(adb): add AdbServerClient.prototype.createAdb()
as a shorthand for `createTransport` and `new Adb`
This commit is contained in:
parent
798b136f40
commit
dbcfd34c03
2 changed files with 11 additions and 0 deletions
|
@ -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>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue