/** * Draggable attachment factory for `{@attach ...}` (Svelte 5.29+). * * Prefer this over `use:draggable` when targeting **components** that spread * props onto a root element. On plain HTML elements both APIs work. * * @module attachments/draggable */ import type { Attachment } from 'svelte/attachments'; import type { DraggableOptions } from '../types/index.js'; /** * Creates a draggable [attachment](https://svelte.dev/docs/svelte/@attach). * * Pass options directly, or a **getter** so each attach evaluation reads fresh * options (recommended when `dragData` / callbacks change). Svelte re-runs the * `{@attach ...}` expression when reactive dependencies change, which remounts * the attachment with the latest options. * * @typeParam T - Payload type for `dragData` * * @example * ```svelte * * *
* {task.title} *
* * ({ container: 'list', dragData: task }))}> * {task.title} * * ``` * * @example * Explicit generic when inference is not enough: * ```svelte *
(() => ({ container: 'list', dragData: task }))}> * ``` */ export declare function attachDraggable(options: DraggableOptions | (() => DraggableOptions)): Attachment;