mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-06 03:50:18 +02:00
feat(struct): new API full rewrite
This commit is contained in:
parent
a29268426d
commit
d50a170ab8
89 changed files with 1487 additions and 5512 deletions
|
@ -1,19 +1,18 @@
|
|||
import type { ReadableStream } from "@yume-chan/stream-extra";
|
||||
import { PushReadableStream } from "@yume-chan/stream-extra";
|
||||
import Struct from "@yume-chan/struct";
|
||||
import type { StructValue } from "@yume-chan/struct";
|
||||
import { buffer, Struct, u32 } from "@yume-chan/struct";
|
||||
|
||||
import { AdbSyncRequestId, adbSyncWriteRequest } from "./request.js";
|
||||
import { AdbSyncResponseId, adbSyncReadResponses } from "./response.js";
|
||||
import { adbSyncReadResponses, AdbSyncResponseId } from "./response.js";
|
||||
import type { AdbSyncSocket } from "./socket.js";
|
||||
|
||||
export const AdbSyncDataResponse =
|
||||
/* #__PURE__ */
|
||||
new Struct({ littleEndian: true })
|
||||
.uint32("dataLength")
|
||||
.uint8Array("data", { lengthField: "dataLength" });
|
||||
export const AdbSyncDataResponse = new Struct(
|
||||
{ data: buffer(u32) },
|
||||
{ littleEndian: true },
|
||||
);
|
||||
|
||||
export type AdbSyncDataResponse =
|
||||
(typeof AdbSyncDataResponse)["TDeserializeResult"];
|
||||
export type AdbSyncDataResponse = StructValue<typeof AdbSyncDataResponse>;
|
||||
|
||||
export async function* adbSyncPullGenerator(
|
||||
socket: AdbSyncSocket,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue