import { Signal } from "@web-udp/protocol" ; export enum ConnectionState { CLOSED , OPENED } export interface Connection { state : ConnectionState ; send ( mixed ) : void ; close ( ) : void ; closed : Signal ; errors : Signal < { error : string ; } > ; messages : Signal ; metadata : any ; } export interface ConnectionProvider { create ( pid , options ? ) : Promise < Connection > ; close ( pid ) : void ; } export interface ConnectionOptions { binaryType ? : "arraybuffer" | "blob" ; metadata ? : any ; UNSAFE_ordered ? : boolean ; maxPacketLifeTime ? : number ; maxRetransmits ? : number ; } export type PortRange = { min : number ; max : number ; } ;