///
///
///
import crypto from 'crypto';
import EventEmitter from 'events';
import Client from './client.js';
import { HandshakeOptions, LibrespotSessionOptions } from '../utils/types.js';
interface ShannonObject {
nonce: number;
shannon?: Shannon;
}
interface Credentials {
username: string;
auth_type: number;
auth_data: Buffer;
device_id: string;
}
export default class LibrespotSession extends EventEmitter {
address?: string;
port?: number;
client?: Client;
diffie: crypto.DiffieHellmanGroup;
send: ShannonObject;
recv: ShannonObject;
destroyed: boolean;
handshakeOptions?: HandshakeOptions;
setupComplete: boolean;
deviceId: string;
attributes: {
[key: string]: string | number;
};
constructor(options: LibrespotSessionOptions);
close(): void;
setup(username: string, storedCredential: Buffer): Promise;
handshake(): Promise;
authenticate(credentials: Credentials): Promise;
startHandlerLoop(): Promise;
receiveCommand(): Promise<{
cmd: number;
payload: Buffer;
}>;
sendCommand(cmd: number, request: Uint8Array): void;
}
export {};