first commit
This commit is contained in:
commit
b6256abbfb
397 files changed
+537630
No files matched your search
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
import { EventEmitter } from "node:events";
|
||||
import type { LocoClientConfig, LocoCommand, LocoPacketHeader } from "../types/index.js";
|
||||
export interface LocoSocketEvents {
|
||||
packet: [header: LocoPacketHeader, body: Record<string, unknown>];
|
||||
error: [error: Error];
|
||||
close: [];
|
||||
connected: [];
|
||||
}
|
||||
export interface LocoSocketOptions {
|
||||
/**
|
||||
* When true, packets are sent/received as plain LOCO over TLS
|
||||
* (no RSA handshake, no AES encryption). Used for booking server.
|
||||
*/
|
||||
plaintext?: boolean;
|
||||
}
|
||||
export declare class LocoSocket extends EventEmitter<LocoSocketEvents> {
|
||||
private socket;
|
||||
private aesKey;
|
||||
private encryptedReader;
|
||||
private plainReader;
|
||||
private packetId;
|
||||
private config;
|
||||
private plaintext;
|
||||
/** Map of pending request id -> resolve callback */
|
||||
private pending;
|
||||
constructor(config: LocoClientConfig, options?: LocoSocketOptions);
|
||||
/** Connect to the LOCO server. Performs RSA handshake unless in plaintext mode. */
|
||||
connect(): Promise<void>;
|
||||
/** Send a LOCO command and return a promise that resolves with the server's response. */
|
||||
request(command: LocoCommand, body: Record<string, unknown>): Promise<{
|
||||
header: LocoPacketHeader;
|
||||
body: Record<string, unknown>;
|
||||
}>;
|
||||
/** Send a LOCO command without waiting for a specific response. */
|
||||
send(command: LocoCommand, body: Record<string, unknown>): number;
|
||||
disconnect(): void;
|
||||
get sessionKey(): Buffer;
|
||||
}
|
||||
//# sourceMappingURL=socket.d.ts.map
|
||||
Reference in new issue
Block a user