import { SyncMachineContext, SyncMachinEvent } from '../types';
import { SocketClient } from '../socketClient';

import * as awarenessProtocol from 'y-protocols/awareness';
export declare const initAwarenessHandler: (context: SyncMachineContext) => {
    awareness: awarenessProtocol.Awareness;
    _awarenessUpdateHandler: ({ added, updated, removed, }: {
        added: number[];
        updated: number[];
        removed: number[];
    }) => void;
};
export declare const updateConnectionStateHandler: (context: SyncMachineContext) => {
    isConnected: boolean;
};
export declare const websocketInitializer: (context: SyncMachineContext, event: SyncMachinEvent) => {
    socketClient: SocketClient;
    initialUpdate: any;
    roomKey: any;
    roomId: any;
    isOwner: any;
    isEns: any;
    wsUrl: any;
    onCollaborationCommit: (file: File) => Promise<string>;
    onFetchCommitContent: (cid: string) => Promise<any>;
    onSessionTerminated: () => void;
    onUnMergedUpdates: (state: boolean) => void;
    onLocalUpdate: ((updatedDocContent: import('../../types').Data["editorJSONData"], updateChunk: string) => void) | undefined;
};
export declare const yjsUpdateHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
    uncommittedUpdatesIdList?: undefined;
} | {
    uncommittedUpdatesIdList: any[];
};
export declare const roomMemberUpdateHandler: (context: SyncMachineContext) => {
    roomMembers: import('../types').RoomMember[];
};
export declare const stateResetHandler: () => {
    roomMembers: never[];
    isConnected: boolean;
    awareness: null;
    _awarenessUpdateHandler: null;
    socketClient: null;
};
export declare const registerUpdateHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
    uncommittedUpdatesIdList?: undefined;
} | {
    uncommittedUpdatesIdList: any[];
};
export declare const removeLastProcessedUpdate: (context: SyncMachineContext, event: SyncMachinEvent) => {
    updateQueue: Uint8Array<ArrayBufferLike>[];
};
export declare const clearUncommitedUpdatesHandler: () => {
    uncommittedUpdatesIdList: never[];
};
export declare const addUpdateToQueueHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
    updateQueue: any[];
};
export declare const updateConnectionReadyStateHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    isReady: any;
};
export declare const setNewDocFlagHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    isNewDoc: any;
};
export declare const commitUncommittedIdsHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    uncommittedUpdatesIdList: any;
};
export declare const setConnectionActiveStateHandler: (context: SyncMachineContext) => {
    isConnected: boolean;
};
export declare const setMachineReadyStateHandler: () => {
    isReady: boolean;
};
export declare const addRemoteContentToQueueHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
    contentTobeAppliedQueue: any[];
};
export declare const applyContentsFromRemote: (context: SyncMachineContext) => {
    contentTobeAppliedQueue?: undefined;
} | {
    contentTobeAppliedQueue: never[];
};
export declare const clearErrorCountHandler: () => {
    errorCount: number;
    errorMessage: string;
};
export declare const updateErrorCountHandler: (context: SyncMachineContext) => {
    errorCount: number;
};
export declare const setCommitMessageErrorHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const setUpdateErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const setConnectionErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const setIpfsQueryErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const setInitialCommitErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const setInitialUpdateErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
    errorMessage: string;
};
export declare const disconnectedStateHandler: () => {
    socketClient: null;
    roomMembers: never[];
    isConnected: boolean;
    awareness: null;
    _awarenessUpdateHandler: null;
    uncommittedUpdatesIdList: never[];
    updateQueue: never[];
};
export declare const handleDisconnectionDueToError: (_context: SyncMachineContext, _event: SyncMachinEvent) => {
    socketClient: null;
    roomId: string;
    roomMembers: never[];
    isConnected: boolean;
    awareness: null;
    _awarenessUpdateHandler: null;
    roomKey: string;
    wsUrl: string;
    uncommittedUpdatesIdList: never[];
    updateQueue: never[];
    isOwner: boolean;
    isReady: boolean;
    isNewDoc: boolean;
    contentTobeAppliedQueue: never[];
    initialUpdate: null;
    errorCount: number;
    errorMessage: string;
};
export declare const terminateSessionHandler: (context: SyncMachineContext) => {
    socketClient: null;
    roomId: string;
    roomMembers: never[];
    isConnected: boolean;
    awareness: null;
    _awarenessUpdateHandler: null;
    roomKey: string;
    wsUrl: string;
    uncommittedUpdatesIdList: never[];
    updateQueue: never[];
    isOwner: boolean;
    isReady: boolean;
    isNewDoc: boolean;
    contentTobeAppliedQueue: never[];
    initialUpdate: null;
    errorCount: number;
    errorMessage: string;
};
export declare const setDocumentDecryptionStateHandler: (_: SyncMachineContext, event: SyncMachinEvent) => {
    initalDocumentDecryptionState: any;
};
