/// <reference types="node" />
/// <reference types="node" />
import type { Socket } from "net";
import type { ENIPState } from "../enip/states";
import { CIPPacket } from "../enip/cip/path";
export type ENIPDataVector = Record<number, VectorFunction>;
/**
 * This function handles packet of its assignated service
 * @returns if it returns undefined, the client will send an error packet
 */
type VectorFunction = (data: CIPPacket) => Buffer | undefined;
export declare class Client {
    private socket;
    private events;
    private dataVector;
    state: ENIPState;
    constructor(socket: Socket, vector: ENIPDataVector);
    /** Ignore empty packets */
    private handlePacket;
    /** Send a response computed by Vector function */
    private sendReponse;
    /**
     * Writes Ethernet/IP Data to Socket as an Unconnected Message
     * or a Transport Class 1 Datagram
     */
    write(data: Buffer, connected?: boolean, timeout?: number): Promise<boolean>;
    /**
     * Socket data event handler
     */
    private handleData;
    /**
     * Sends Unregister Session Command and Destroys Underlying TCP Socket
     * @deprecated
     */
    destroy(_error?: Error): void;
    /**
     * Sends an UnregisterSession command
     */
    close(): void;
    /**
     * Handle socket close
     */
    private handleClose;
}
export {};
