anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
34 lines • 1.13 kB
TypeScript
import { CommunicationChannel, MessageEnvelope } from '../types';
export interface WebSocketChannelOptions {
url?: string;
reconnectInterval?: number;
maxReconnectAttempts?: number;
heartbeatInterval?: number;
messageTimeout?: number;
}
export declare class WebSocketChannel implements CommunicationChannel {
id: string;
type: 'websocket';
isConnected: boolean;
private ws?;
private messageHandlers;
private reconnectAttempts;
private heartbeatTimer?;
private options;
constructor(id: string, options?: WebSocketChannelOptions);
connect(): Promise<void>;
disconnect(): Promise<void>;
send(envelope: MessageEnvelope): Promise<void>;
onMessage(handler: (envelope: MessageEnvelope) => void): void;
removeMessageHandler(handler: (envelope: MessageEnvelope) => void): void;
private handleIncomingMessage;
private startHeartbeat;
private stopHeartbeat;
private attemptReconnect;
getConnectionState(): {
connected: boolean;
reconnectAttempts: number;
url: string;
};
}
//# sourceMappingURL=websocket-channel.d.ts.map