/// <reference types="node" />
import { ClientInterface, SocketDataCallback, WrappedClient } from "pocket-sockets";
/**
 * Wrap an already connected and handshooked socket client as encrypted.
 *
 */
export declare class EncryptedClient extends WrappedClient {
    protected outgoingKey: Buffer;
    protected outgoingNonce: Buffer;
    protected incomingKey: Buffer;
    protected incomingNonce: Buffer;
    protected peerPublicKey: Buffer;
    protected handlers: {
        [type: string]: ((data?: any) => void)[];
    };
    protected incomingData: Buffer;
    constructor(client: ClientInterface, outgoingKey: Buffer, outgoingNonce: Buffer, incomingKey: Buffer, incomingNonce: Buffer, peerPublicKey: Buffer);
    init(): Promise<void>;
    unRead(data: Buffer): void;
    getPeerPublicKey(): Buffer;
    protected decryptData(): void;
    send(data: Buffer): void;
    onData(fn: SocketDataCallback): void;
    offData(fn: SocketDataCallback): void;
    protected handleOnData: (data: Buffer | string) => Promise<void>;
    protected hookEvent(type: string, callback: (...args: any[]) => void): void;
    protected unhookEvent(type: string, callback: (...args: any[]) => void): void;
    protected triggerEvent(type: string, ...args: any[]): void;
}
