UNPKG

anon-identity

Version:

Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure

47 lines 1.68 kB
import { CommunicationChannel, MessageEnvelope } from '../types'; export interface DirectChannelOptions { deliveryDelay?: number; reliability?: number; enableLogging?: boolean; } /** * Direct communication channel for same-process agent communication * Useful for testing and same-application agent interactions */ export declare class DirectChannel implements CommunicationChannel { id: string; type: 'direct'; isConnected: boolean; private static channels; private messageHandlers; private options; constructor(id: string, options?: DirectChannelOptions); connect(): Promise<void>; disconnect(): Promise<void>; send(envelope: MessageEnvelope): Promise<void>; onMessage(handler: (envelope: MessageEnvelope) => void): void; removeMessageHandler(handler: (envelope: MessageEnvelope) => void): void; private deliverMessage; private findChannelForAgent; static getChannel(id: string): DirectChannel | undefined; static getAllChannels(): DirectChannel[]; static getConnectedChannels(): DirectChannel[]; static createChannelPair(id1: string, id2: string): [DirectChannel, DirectChannel]; static broadcastToAll(envelope: MessageEnvelope, excludeId?: string): Promise<number>; getStats(): { id: string; connected: boolean; handlerCount: number; options: DirectChannelOptions; }; static getGlobalStats(): { totalChannels: number; connectedChannels: number; channels: Array<{ id: string; connected: boolean; handlerCount: number; }>; }; } //# sourceMappingURL=direct-channel.d.ts.map