import { type SharedValue, type Define } from '@sigx/lynx'; export interface DragEndDetail { x: number; y: number; vx: number; vy: number; } /** * Edge-scroll configuration for ``. Either `true` for * default tuning, or an object overriding the defaults. */ export type EdgeScrollConfig = boolean | { /** Distance from viewport edge in pt where auto-scroll engages. Default 50. */ threshold?: number; /** Maximum scroll velocity in pt/sec at the edge. Default 800. */ maxSpeed?: number; }; export type DraggableProps = Define.Prop<'axis', 'x' | 'y' | 'both', false> & Define.Prop<'threshold', number, false> & Define.Prop<'snapBack', boolean, false> & Define.Prop<'minX', number, false> & Define.Prop<'maxX', number, false> & Define.Prop<'minY', number, false> & Define.Prop<'maxY', number, false> & Define.Prop<'translateX', SharedValue, false> & Define.Prop<'translateY', SharedValue, false> & Define.Prop<'edgeScroll', EdgeScrollConfig, false> & Define.Prop<'class', string, false> & Define.Prop<'style', Record, false> & Define.Slot<'default'> & Define.Event<'dragStart', { x: number; y: number; }> & Define.Event<'dragEnd', DragEndDetail>; /** * MT-thread draggable container, built on the native gesture arena via * `Gesture.Pan()`. The bound element's transform is driven by two * `useAnimatedStyle` bindings (one per axis) — the same primitive any user * could compose. The Pan onUpdate worklet writes to the SharedValues; the * bridge applies the transform on the next flush boundary, composing the * two bindings into a single `setStyleProperties({ transform })` call. * * Because the visible position is bridge-driven rather than written directly * by the worklet, external animation of `translateX`/`translateY` (e.g. * `withSpring(tx, 0)` to spring back to origin after release) moves the * element visually for free — the binding picks up whichever SV write * happened most recently, regardless of who wrote it. * * `dragStart` and `dragEnd` are dispatched to BG via `runOnBackground` (low * frequency, cross-thread is fine). * * Unlike the prior `bindtouch*`-based implementation, the native pan gesture * arena handles multi-touch correctly (secondary fingers don't cancel the * primary drag). * * **Scroll composition** (Phase 2.12.3): Lynx's `` doesn't * participate in the new gesture arena, so without coordination both pan * and scroll would fire concurrently. `` reads `useScrollContext` * at setup; if a parent `` is in scope, the BG-side dragStart/ * dragEnd flips `scrollCtx.dragging` automatically — the parent's * `enable-scroll` is gated on that signal, so the UIKit pan recognizer * yields for the duration of the drag. No consumer wiring required. * * **Edge-scroll** (Phase 2.13): pass `edgeScroll` to auto-scroll the parent * `` when the finger nears its viewport edge during a drag — * the standard drag-to-reorder pattern (Apple Mail, iOS Reminders). The * scroll axis follows `scrollOrientation` as published through the context. * Inside the threshold zone the scroll velocity ramps from 0 at the * threshold boundary to `maxSpeed` at the edge. Quietly no-ops if * `edgeScroll` is unset OR the Draggable isn't nested in a ScrollView. * * Note on the native event payload: Lynx's pan handler emits `pageX`/`pageY` * but no `translationX`/`velocityX` — we compute deltas and velocity from * pageX/pageY ourselves (same as the prior touch-based implementation). */ export declare const Draggable: import("@sigx/runtime-core").ComponentFactory import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null) | undefined; }>; //# sourceMappingURL=Draggable.d.ts.map