Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseWhiteboardSyncResult

    Sync hook return type

    interface UseWhiteboardSyncResult {
        activeUsers: Record<string, ActiveUser>;
        broadcastUpdate: (
            payload: Omit<WhiteboardPayload, "fileId" | "userId">,
        ) => void;
        connected: boolean;
        isOwner: boolean;
        ownerPresent: boolean;
        readOnly: boolean;
        requestState: () => void;
        sendState: (targetUserId: string) => void;
        throttledBroadcastUpdate: (
            payload: Omit<WhiteboardPayload, "fileId" | "userId">,
        ) => void & { cancel: () => void };
    }
    Index

    Properties

    activeUsers: Record<string, ActiveUser>

    Active users in the whiteboard

    broadcastUpdate: (payload: Omit<WhiteboardPayload, "fileId" | "userId">) => void

    Broadcast a whiteboard update

    connected: boolean

    Whether connected to room

    isOwner: boolean

    Whether the current user is the owner

    ownerPresent: boolean

    Whether owner is present (for non-owners)

    readOnly: boolean

    Whether in read-only mode

    requestState: () => void

    Request full state from owner

    sendState: (targetUserId: string) => void

    Send full state to a specific user

    throttledBroadcastUpdate: (
        payload: Omit<WhiteboardPayload, "fileId" | "userId">,
    ) => void & { cancel: () => void }

    Throttled version of broadcastUpdate for high-frequency events. Limits broadcasts to once per broadcastThrottleInterval (default 50ms = 20 updates/sec). Includes a cancel() method to cancel pending broadcasts.