export type UapActionInteractionStateValue = 'uap-action-start' | 'uap-action-end'; export type DndInteractionStateValue = 'dnd-start' | 'dnd-active' | 'dnd-end'; export type InteractionState = null | UapActionInteractionStateValue | DndInteractionStateValue; export type StateTransitionCallbacks = { type: 'onDndStart'; payload: PointerEvent; metadata?: T; } | { type: 'onDndActive'; payload: PointerEvent; } | { type: 'onDndEnd'; } | { type: 'onUapActionStart'; metadata?: T; } | { type: 'onUapActionEnd'; }; export interface DragHandleInteractionState { value: InteractionState; eventData?: PointerEvent; metadata?: T; transitionCallbacks?: StateTransitionCallbacks[]; } export interface UseDragHandleInteractionStateProps { onDndStartAction?: (event: PointerEvent, metadata?: T) => void; onDndActiveAction?: (event: PointerEvent) => void; onDndEndAction?: () => void; onUapActionStartAction?: (metadata?: T) => void; onUapActionEndAction?: () => void; } interface DefaultActionPayload { nativeEvent: PointerEvent; } interface PointerDownActionPayload extends DefaultActionPayload { metadata?: T; } interface KeyDownActionPayload { key: string; metadata?: T; } export type Action = { type: 'POINTER_DOWN'; payload: PointerDownActionPayload; } | { type: 'POINTER_MOVE'; payload: DefaultActionPayload; } | { type: 'POINTER_UP'; payload: DefaultActionPayload; } | { type: 'POINTER_CANCEL'; } | { type: 'KEY_DOWN'; payload: KeyDownActionPayload; } | { type: 'FOCUS'; } | { type: 'BLUR'; } | { type: 'RESET_TO_IDLE'; } | { type: 'CLEAR_CALLBACKS'; }; export {};