import { type ReactNode } from "react"; import { type StyleProp, type ViewStyle } from "../../style/index.js"; import { type DragDropSkin } from "./drag-drop.styles.js"; export interface DropEvent { /** The dragged item's id. */ id: string; /** The dragged item's `data`. */ data: T; /** The source zone id. */ from: string; /** The target zone id (equals `from` for a within-zone reorder). */ to: string; /** The insertion index within the target zone, 0..count. */ index: number; } export interface DragDropProviderProps { children: ReactNode; /** Outer layout composition only (width/flex within a parent), never a restyle hook. The * provider wraps the whole draggable surface and hosts the floating drag ghost. */ style?: StyleProp; /** E2E hook forwarded to the root element. */ testID?: string; } export interface DropZoneProps { /** Stable id for this drop target, used in the drop event and for keyboard navigation. */ id: string; /** Accessible name announced when a drag hovers or drops here (e.g. the column title). */ label: string; /** Fired on THIS zone when an item is dropped into it (from any zone, including itself). */ onDrop?: (e: DropEvent) => void; /** Lay the items out in a row so the insertion axis is horizontal (default is a vertical column). */ horizontal?: boolean; /** Refuse drops: the zone is skipped by hit-testing and the keyboard cursor, and never highlights. */ disabled?: boolean; children?: ReactNode; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; /** E2E hook forwarded to the root element. */ testID?: string; } export interface DraggableProps { /** Stable id for this item (unique within the provider). */ id: string; /** Arbitrary payload handed back in the drop event. */ data: T; /** Accessible name of the item, used in drag announcements (falls back to `id`). */ label?: string; /** Disable dragging: the grip inside becomes inert. */ disabled?: boolean; /** Custom floating drag preview; defaults to the item's own `children`. */ preview?: ReactNode; children?: ReactNode; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; /** E2E hook forwarded to the root element. */ testID?: string; } export interface DragHandleProps { /** Accessible name for the grip (e.g. "Reorder Rotate webhook secrets"). */ label?: string; /** E2E hook forwarded to the root element. */ testID?: string; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; } /** Build the DragDrop family from a platform skin. */ export declare function createDragDrop(skin: DragDropSkin): { DragDropProvider: ({ children, style, testID }: DragDropProviderProps) => import("react").JSX.Element; DropZone: ({ id, label, onDrop, horizontal, disabled, children, style, testID }: DropZoneProps) => import("react").JSX.Element; Draggable: ({ id, data, label, disabled, preview, children, style, testID }: DraggableProps) => import("react").JSX.Element; DragHandle: ({ label, testID, style }: DragHandleProps) => import("react").JSX.Element; }; /** * KIT-INTERNAL: true while a pointer drag is in flight under the nearest DragDropProvider * (keyboard drags do not count: nothing follows the finger, so nothing needs freezing). * Composers that put DropZones inside a ScrollView (Board's horizontal lanes) read this to * freeze scrolling for the duration of the drag: the measured zone rects are captured at grab * time, so a scroll mid-drag would divorce the hit-testing from what is on screen. The context * is module-scoped, so this works with every platform's createDragDrop family. Deliberately NOT * re-exported from the platform entry files: it is not part of the public API. */ export declare function useDragActive(): boolean; //# sourceMappingURL=drag-drop.shared.d.ts.map