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

    Interface UseAnnotationSyncOptions

    interface UseAnnotationSyncOptions {
        active?: boolean;
        clearAllPermission?: AnnotationPermission;
        isOwner: boolean;
        isSharer: boolean;
        localUserId: string;
        permission?: AnnotationPermission;
        shareId: string;
    }
    Index

    Properties

    active?: boolean

    Whether this share session is currently active. Defaults to true for back-compat with consumers that don't pass it.

    Lifecycle: when this flips from true to false, the hook drops its stroke set and the drawing-locked state — a screen share that has ended must not leave stale annotations behind. The local clear is enough because every peer flips this independently when they observe the share stopping (via useScreenSharingParticipants), so no broadcast is needed; everyone resets in lock-step.

    Snapshot exchange is also gated on this flag, so an inactive layer neither requests nor responds to snapshots — that prevents a peer who hasn't yet observed the new share from answering with empty state and starving the requester.

    clearAllPermission?: AnnotationPermission

    Defaults to 'sharer-only'.

    isOwner: boolean

    Whether this client is the room owner — gates clearAllPermission if set to 'owner-only'.

    isSharer: boolean

    Whether this client owns the screen share shareId is associated with.

    localUserId: string

    This client's user id (for stroke attribution).

    Defaults to 'everyone'.

    shareId: string

    Stable id keying the annotation state — typically the screen-sharer's user id. Two concurrent shares get two distinct shareIds and don't cross-talk.