// @ts-nocheck
import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";

export declare class CrdtElement {
    /**
     * Update data for a specific CRDT document
     * @param id Document ID
     * @param state State data as Uint8Array or number array
     */
    updateData: (updateDataQuery: CrdtUpdateDataQuery) => Promise<any>;

    /**
     * Subscribe to data changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle data changes
     * @returns Unsubscribe function
     */
    onDataChange: (onDataChangeQuery: CrdtOnDataChangeQuery) => () => void;

    /**
     * Get data for a specific CRDT document
     * @param id Document ID
     */
    getData: (getDataQuery: CrdtGetDataQuery) => Promise<any>;

    /**
     * Subscribe to state changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle state changes
     * @returns Unsubscribe function
     */
    onStateChange: (onStateChangeQuery: CrdtOnStateChangeQuery) => () => void;

    /**
     * Update state for a specific CRDT document
     * @param id Document ID
     * @param state State data as Uint8Array or number array
     */
    updateState: (updateStateQuery: CrdtUpdateStateQuery) => Promise<any>;

    /**
     * Register a user for synchronization on a specific CRDT document
     * @param id Document ID
     */
    registerSyncUser: (registerSyncUserQuery: CrdtRegisterSyncUserQuery) => Promise<void>;

    /**
     * Subscribe to registered user changes for a specific CRDT document
     */
    onRegisteredUserChange: (onRegisteredUserChangeQuery: CrdtOnRegisteredUserChangeQuery) => () => void;

    /**
     * Set presence for a specific CRDT document
     * @param id Document ID
     */
    setPresence: (setPresenceQuery: CrdtSetPresenceQuery) => Promise<void>;

    /**
     * Subscribe to presence changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle presence changes
     * @returns Unsubscribe function
     */
    onPresenceChange: (onPresenceChangeQuery: CrdtOnPresenceChangeQuery) => () => void;

    /**
     * Store a version of a specific CRDT document
     * @param id Document ID
     * @param versionId Version ID
     * @param versionName Version name
     * @param state State data as Uint8Array or number array
     */
    saveVersion: (saveVersionQuery: CrdtSaveVersionQuery) => Promise<any>;

    /**
     * Get a version of a specific CRDT document
     * @param id Document ID
     * @param versionId Version ID
     */
    getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;

    constructor();

    /**
     * Update data for a specific CRDT document
     * @param id Document ID
     * @param state State data as Uint8Array or number array
     */
    private _updateData;

    /**
     * Subscribe to data changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle data changes
     * @returns Unsubscribe function
     */
    private _onDataChange;

    /**
     * Get data for a specific CRDT document
     * @param id Document ID
     */
    private _getData;

    /**
     * Subscribe to state changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle state changes
     * @returns Unsubscribe function
     */
    private _onStateChange;

    /**
     * Update state for a specific CRDT document
     * @param id Document ID
     * @param state State data as Uint8Array or number array
     */
    private _updateState;

    /**
     * Register a user for synchronization on a specific CRDT document
     * @param id Document ID
     */
    private _registerSyncUser;

    /**
     * Subscribe to registered user changes for a specific CRDT document
     */
    private _onRegisteredUserChange;

    /**
     * Set presence for a specific CRDT document
     * @param id Document ID
     */
    private _setPresence;

    /**
     * Subscribe to presence changes for a specific CRDT document
     * @param id Document ID
     * @param callback Callback function to handle presence changes
     * @returns Unsubscribe function
     */
    private _onPresenceChange;

    /**
     * Store a version of a specific CRDT document
     * @param id Document ID
     * @param versionId Version ID
     * @param versionName Version name
     * @param state State data as Uint8Array or number array
     */
    private _saveVersion;

    /**
     * Get a version of a specific CRDT document
     * @param id Document ID
     * @param versionId Version ID
     */
    private _getVersion;

    /**
     * Get all versions of a specific CRDT document
     * @param id Document ID
     */
    private _getVersions;
}