import {Ice} from 'ice'; import '../Ice/ObjectAdapterF'; import '../Ice/Identity'; import '../Ice/Endpoint'; declare module './Ice.ns' { namespace Ice { type CompressBatchName = 'Yes' | 'No' | 'BasedOnProxy'; /** * The batch compression option when flushing queued batch requests. */ class CompressBatch< Name extends CompressBatchName = CompressBatchName > extends Ice.EnumBase { /** * Compress the batch requests. */ static Yes: CompressBatch<'Yes'>; /** * Don't compress the batch requests. */ static No: CompressBatch<'No'>; /** * Compress the batch requests if at least one request was * made on a compressed proxy. */ static BasedOnProxy: CompressBatch<'BasedOnProxy'>; } /** * Base class providing access to the connection details. * */ class ConnectionInfo { constructor( underlying?: ConnectionInfo | null, incoming?: boolean, adapterName?: string, connectionId?: string, ); /** * The information of the underyling transport or null if there's * no underlying transport. */ underlying: ConnectionInfo | null; /** * Whether or not the connection is an incoming or outgoing * connection. */ incoming: boolean; /** * The name of the adapter associated with the connection. */ adapterName: string; /** * The connection id. */ connectionId: string; } /** * An application can implement this interface to receive notifications when * a connection closes. * * @see Connection#setCloseCallback */ interface CloseCallback { /** * This method is called by the the connection when the connection * is closed. If the callback needs more information about the closure, * it can call {@link Connection#throwException}. * * @param con The connection that closed. */ closed(con: Connection): void; } /** * An application can implement this interface to receive notifications when * a connection receives a heartbeat message. * * @see Connection#setHeartbeatCallback */ interface HeartbeatCallback { /** * This method is called by the the connection when a heartbeat is * received from the peer. * * @param con The connection on which a heartbeat was received. */ heartbeat(con: Connection): void; } type ACMCloseName = | 'CloseOff' | 'CloseOnIdle' | 'CloseOnInvocation' | 'CloseOnInvocationAndIdle' | 'CloseOnIdleForceful'; class ACMClose< Name extends ACMCloseName = ACMCloseName > extends Ice.EnumBase { static CloseOff: ACMClose<'CloseOff'>; static CloseOnIdle: ACMClose<'CloseOnIdle'>; static CloseOnInvocation: ACMClose<'CloseOnInvocation'>; static CloseOnInvocationAndIdle: ACMClose<'CloseOnInvocationAndIdle'>; static CloseOnIdleForceful: ACMClose<'CloseOnIdleForceful'>; } type ACMHeartbeatName = | 'HeartbeatOff' | 'HeartbeatOnDispatch' | 'HeartbeatOnIdle' | 'HeartbeatAlways'; class ACMHeartbeat< Name extends ACMHeartbeatName = ACMHeartbeatName > extends Ice.EnumBase { static HeartbeatOff: ACMHeartbeat<'HeartbeatOff'>; static HeartbeatOnDispatch: ACMHeartbeat<'HeartbeatOnDispatch'>; static HeartbeatOnIdle: ACMHeartbeat<'HeartbeatOnIdle'>; static HeartbeatAlways: ACMHeartbeat<'HeartbeatAlways'>; } class ACM implements Ice.Struct { constructor(timeout?: number, close?: ACMClose, heartbeat?: ACMHeartbeat); timeout: number; close: ACMClose; heartbeat: ACMHeartbeat; clone(): this; equals(other: this): boolean; hashCode(): number; } type ConnectionCloseName = | 'Forcefully' | 'Gracefully' | 'GracefullyWithWait'; /** * Determines the behavior when manually closing a connection. */ class ConnectionClose< Name extends ConnectionCloseName = ConnectionCloseName > extends Ice.EnumBase { /** * Close the connection immediately without sending a close connection protocol message to the peer * and waiting for the peer to acknowledge it. */ static Forcefully: ConnectionClose<'Forcefully'>; /** * Close the connection by notifying the peer but do not wait for pending outgoing invocations to complete. * On the server side, the connection will not be closed until all incoming invocations have completed. */ static Gracefully: ConnectionClose<'Gracefully'>; /** * Wait for all pending invocations to complete before closing the connection. */ static GracefullyWithWait: ConnectionClose<'GracefullyWithWait'>; } /** * Provides access to the connection details of an IP connection */ class IPConnectionInfo extends ConnectionInfo { constructor( underlying?: ConnectionInfo | null, incoming?: boolean, adapterName?: string, connectionId?: string, localAddress?: string, localPort?: number, remoteAddress?: string, remotePort?: number, ); localAddress: string; localPort: number; remoteAddress: string; remotePort: number; } /** * Provides access to the connection details of a TCP connection */ class TCPConnectionInfo extends IPConnectionInfo { constructor( underlying?: ConnectionInfo | null, incoming?: boolean, adapterName?: string, connectionId?: string, localAddress?: string, localPort?: number, remoteAddress?: string, remotePort?: number, rcvSize?: number, sndSize?: number, ); /** * The connection buffer receive size. */ rcvSize: number; /** * The connection buffer send size. */ sndSize: number; } /** * Provides access to the connection details of a UDP connection */ class UDPConnectionInfo extends IPConnectionInfo { constructor( underlying?: ConnectionInfo | null, incoming?: boolean, adapterName?: string, connectionId?: string, localAddress?: string, localPort?: number, remoteAddress?: string, remotePort?: number, mcastAddress?: string, mcastPort?: number, rcvSize?: number, sndSize?: number, ); /** * The multicast address. */ mcastAddress: string; /** * The multicast port. */ mcastPort: number; /** * The connection buffer receive size. */ rcvSize: number; /** * The connection buffer send size. */ sndSize: number; } type HeaderDict = Map; const HeaderDict: { new (entries?: ReadonlyArray<[string, string]>): HeaderDict; }; /** * Provides access to the connection details of a WebSocket connection */ class WSConnectionInfo extends ConnectionInfo { constructor( underlying?: ConnectionInfo | null, incoming?: boolean, adapterName?: string, connectionId?: string, headers?: HeaderDict, ); headers: HeaderDict; } } } export {Ice} from './Ice.ns';