Packages@robojs/sync
DragResult<T, ClientData>
Interface: DragResult<T, ClientData>
Result returned by useSyncDrag hook.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends DragState | - |
ClientData | unknown |
Properties
| Property | Type | Description |
|---|---|---|
canInteract | boolean | Whether current client can interact (not locked by others) |
context | SyncContext<ClientData> | Sync context for client awareness |
dragHandlers | { onMouseDown: (e) => void; onTouchStart: (e) => void; } | Handlers to spread onto draggable element |
dragHandlers.onMouseDown | (e: MouseEvent<Element, MouseEvent>) => void | - |
dragHandlers.onTouchStart | (e: TouchEvent<Element>) => void | - |
isBeingDragged | boolean | Whether anyone is dragging (locked) |
isDragging | boolean | Whether current client is dragging |
lock | undefined | LockContext | Lock context for advanced usage |
setState | (update: Partial<T> | (prev) => T) => void | Update state (partial or updater function) |
state | T | Current state (may be interpolated for remote updates) |
