/**
 * Drag Types
 *
 * Type definitions extracted from useNodeDrag.ts for reuse.
 */

import type { NodeId, NodePosition, UINodeProperties } from '../core/types';
import type { HeldKeysState } from '../gestures/types';

/**
 * Memo passed through the drag gesture lifecycle.
 */
export type DragMemo = {
	initialPositions: Map<NodeId, { x: number; y: number }>;
	gestureInstance: number;
};

/**
 * Options for the useNodeDrag hook.
 */
export interface UseNodeDragOptions {
	/** Callback to persist node position to database */
	onPersist?: (nodeId: NodeId, graphId: string, uiProperties: UINodeProperties) => Promise<void>;
	/** Callback when persist fails */
	onPersistError?: (nodeId: NodeId, error: Error) => void;
	/** Debounce time for query invalidation (ms) */
	invalidationDebounceMs?: number;
	/** Snapshot of currently held keyboard keys */
	heldKeys?: HeldKeysState;
}
