@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
49 lines • 1.6 kB
TypeScript
import { Buffer } from 'node:buffer';
/**
* adb Protocol is a 4 byte prefixed message.
* the 4 fisrt byte can be on of the 10 predefined Code, of a 4-hexa string indicating the message len.
*/
export default class Protocol {
static OKAY: string;
static FAIL: string;
static STAT: string;
static STA2: string;
static LIST: string;
static LIS2: string;
static DENT: string;
static DNT2: string;
static RECV: string;
static DATA: string;
static DONE: string;
static SEND: string;
static QUIT: string;
static bOKAY: Buffer<ArrayBuffer>;
static bFAIL: Buffer<ArrayBuffer>;
static bSTAT: Buffer<ArrayBuffer>;
static bSTA2: Buffer<ArrayBuffer>;
static bLIST: Buffer<ArrayBuffer>;
static bLIS2: Buffer<ArrayBuffer>;
static bDENT: Buffer<ArrayBuffer>;
static bRECV: Buffer<ArrayBuffer>;
static bDATA: Buffer<ArrayBuffer>;
static bDONE: Buffer<ArrayBuffer>;
static bSEND: Buffer<ArrayBuffer>;
static bQUIT: Buffer<ArrayBuffer>;
/**
* parse a 4 char string
*/
static decodeLength(length: string): number;
/**
*
* @param length message len
* @returns message len as a 4 char string
*/
static encodeLength(length: number): string;
/**
* prefix a chunk with it's len stored in a 4 char hexa string, so data len can not exceed 0Xffff
* @param data string or buffer to send.
* @returns data as a Buffer prefixed by a 4 char Base16 length chunk
*/
static encodeData(data: Buffer | string): Buffer;
}
//# sourceMappingURL=protocol.d.ts.map