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

    Interface UseAnnotationSyncResult

    interface UseAnnotationSyncResult {
        appendPoints: (id: string, points: Point[]) => void;
        beginStroke: (
            color: string,
            width: number,
            aspectRatio: number,
            firstPoint: Point,
        ) => string;
        canClearAll: boolean;
        canDraw: boolean;
        canSetDrawingLock: boolean;
        clearAll: () => void;
        clearMine: () => void;
        drawingLocked: boolean;
        endStroke: (id: string) => void;
        setDrawingLocked: (locked: boolean) => void;
        strokes: ReadonlyMap<string, Stroke>;
    }
    Index

    Properties

    appendPoints: (id: string, points: Point[]) => void

    Append normalised points to an in-progress stroke.

    beginStroke: (
        color: string,
        width: number,
        aspectRatio: number,
        firstPoint: Point,
    ) => string

    Begin a new local stroke. Returns the new stroke's id. Use the id with appendPoints and endStroke to extend / commit it.

    aspectRatio is the source content aspect ratio at the moment the stroke begins (reported by useVideoContentRect).

    canClearAll: boolean

    True when this caller is allowed to clear-all.

    canDraw: boolean

    True when this caller is allowed to draw.

    canSetDrawingLock: boolean

    True when this caller is the room owner — drives whether the toolbar shows the lock toggle.

    clearAll: () => void

    Remove every stroke. Gated by clearAllPermission.

    clearMine: () => void

    Remove only this caller's strokes.

    drawingLocked: boolean

    When true, drawing is locked to the room owner only. Synced across all peers via the data-channel — when one owner toggles the lock, every peer's canDraw updates accordingly.

    endStroke: (id: string) => void

    Commit the stroke (final pointer-up).

    setDrawingLocked: (locked: boolean) => void

    Toggle the room-wide drawing lock. Only the room owner can call this — non-owners see no-op (and the toolbar should hide the toggle for them via canSetDrawingLock).

    strokes: ReadonlyMap<string, Stroke>

    Live stroke set keyed by stroke id.