import { UrlProvider } from 'partysocket/ws';
import { ISocketInitConfig, RoomMember, SocketStatusEnum, SendUpdateResponse, CommitResponse } from './types';
import { Awareness } from 'y-protocols/awareness.js';

interface ISocketClientConfig {
    wsUrl: UrlProvider;
    roomKey: string;
    ownerEdSecret?: string;
    contractAddress?: string;
    ownerAddress?: string;
    onCollaborationConnectCallback: (response: any) => void;
    roomInfo?: {
        documentTitle: string;
        portalAddress: string;
        commentKey: string;
    };
}
export declare class SocketClient {
    private _websocketUrl;
    private _machineEventHandler;
    private _onConnect;
    private _onDisconnection;
    private _onHandShakeError;
    private _sequenceCallbackMap;
    _webSocketStatus: SocketStatusEnum;
    private _webSocket;
    private _websocketServiceDid;
    private roomId;
    roomMembers: RoomMember[];
    private collaborationKeyPair;
    private ownerKeyPair?;
    private contractAddress?;
    private ownerUcan?;
    private collaborationUcan?;
    private ownerAddress?;
    private roomKey;
    private roomInfo?;
    private awareness;
    _onError: ISocketInitConfig['onError'] | null;
    _onCollaborationConnectCallback: ISocketClientConfig['onCollaborationConnectCallback'] | null;
    constructor(config: ISocketClientConfig);
    private _getSequenceIdCallback;
    private _removeSequenceIdFromMap;
    registerAwareness(awareness: Awareness): void;
    private _registerSequenceCallback;
    private _sendNetworkRequest;
    private _fetchRoomMembers;
    sendUpdate({ update }: {
        update: string;
    }): Promise<SendUpdateResponse>;
    commitUpdates({ updates, cid }: {
        updates: string[];
        cid: string;
    }): Promise<CommitResponse>;
    fetchLatestCommit(): Promise<any>;
    getUncommittedChanges(): Promise<any>;
    broadcastAwareness(awarenessUpdate: string): Promise<any>;
    disconnect: () => void;
    terminateSession: () => Promise<void>;
    private _buildRequest;
    private getCollaborationKeyPair;
    private getOwnerToken;
    private buildToken;
    private _handleHandShake;
    private _executeRequestCallback;
    private _dispatchEventHandler;
    private _onSessionTerminated;
    private _processMessage;
    private _clearSequenceCallbackMap;
    connectSocket(): Promise<void> | undefined;
    init(config: ISocketInitConfig): Promise<void>;
    private resetSocketClient;
}
export {};
