import { type RemoteInfo, type Socket, type SocketType } from "dgram"; import { type AddressInfo } from "net"; import { type Address, type InterfaceAddresses } from "./network"; export declare class UdpTransport implements Transport { private socketType; private options; readonly type = "udp"; readonly socket: Socket; rinfo?: Partial>; onData: (data: Buffer, addr: Address) => void; private constructor(); static init(type: SocketType, options?: { portRange?: [number, number]; port?: number; interfaceAddresses?: InterfaceAddresses; }): Promise; private init; send: (data: Buffer, addr?: Address) => Promise; get address(): AddressInfo; get host(): string; get port(): number; close: () => Promise; } export declare class TcpTransport implements Transport { private addr; readonly type = "tcp"; private connecting; private client; onData: (data: Buffer, addr: Address) => void; closed: boolean; private constructor(); private connect; private init; static init(addr: Address): Promise; get address(): AddressInfo; send: (data: Buffer, addr?: Address) => Promise; close: () => Promise; } export interface Transport { type: string; address: AddressInfo; onData: (data: Buffer, addr: Address) => void; send: (data: Buffer, addr?: Address) => Promise; close: () => Promise; }