@vue-dnd-kit/core 2.4.7 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/dist/devtools.cjs +2 -0
  3. package/dist/devtools.cjs.map +1 -0
  4. package/dist/devtools.d.cts +610 -0
  5. package/dist/devtools.d.ts +610 -0
  6. package/dist/devtools.js +569 -0
  7. package/dist/devtools.js.map +1 -0
  8. package/dist/index.cjs +12 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.cts +2425 -0
  11. package/dist/index.d.ts +2425 -2
  12. package/dist/index.js +5865 -0
  13. package/dist/index.js.map +1 -0
  14. package/package.json +59 -29
  15. package/dist/external/components/DnDProvider.vue.d.ts +0 -25
  16. package/dist/external/components/DragPreview.vue.d.ts +0 -89
  17. package/dist/external/composables/makeAutoScroll.d.ts +0 -14
  18. package/dist/external/composables/makeConstraintArea.d.ts +0 -7
  19. package/dist/external/composables/makeDraggable.d.ts +0 -24
  20. package/dist/external/composables/makeDroppable.d.ts +0 -21
  21. package/dist/external/composables/makeSelectionArea.d.ts +0 -15
  22. package/dist/external/composables/useDnDProvider.d.ts +0 -2
  23. package/dist/external/env.d.ts +0 -7
  24. package/dist/external/index.d.ts +0 -11
  25. package/dist/external/types/entities.d.ts +0 -208
  26. package/dist/external/types/index.d.ts +0 -5
  27. package/dist/external/types/operations.d.ts +0 -187
  28. package/dist/external/types/placement.d.ts +0 -34
  29. package/dist/external/types/pointer.d.ts +0 -10
  30. package/dist/external/types/provider.d.ts +0 -89
  31. package/dist/internal/composables/useDnDProviderEvents.d.ts +0 -2
  32. package/dist/internal/composables/useDnDProviderInternal.d.ts +0 -2
  33. package/dist/internal/composables/useDnDProviderState.d.ts +0 -4
  34. package/dist/internal/composables/useViewportAutoScroll.d.ts +0 -9
  35. package/dist/internal/logic/hover.d.ts +0 -6
  36. package/dist/internal/logic/keyboard.d.ts +0 -6
  37. package/dist/internal/logic/operations.d.ts +0 -35
  38. package/dist/internal/logic/payload.d.ts +0 -5
  39. package/dist/internal/logic/pointer.d.ts +0 -11
  40. package/dist/internal/logic/scroll.d.ts +0 -2
  41. package/dist/internal/sensors/default-collision.d.ts +0 -18
  42. package/dist/internal/sensors/index.d.ts +0 -2
  43. package/dist/internal/sensors/sensor.d.ts +0 -68
  44. package/dist/internal/sensors/steps.d.ts +0 -58
  45. package/dist/internal/types/auto-scroll.d.ts +0 -20
  46. package/dist/internal/types/observer.d.ts +0 -11
  47. package/dist/internal/types/provider.d.ts +0 -31
  48. package/dist/internal/utils/auto-scroll.d.ts +0 -13
  49. package/dist/internal/utils/constraints.d.ts +0 -43
  50. package/dist/internal/utils/disabled.d.ts +0 -9
  51. package/dist/internal/utils/dom.d.ts +0 -44
  52. package/dist/internal/utils/drag-activation.d.ts +0 -29
  53. package/dist/internal/utils/events.d.ts +0 -22
  54. package/dist/internal/utils/geometry.d.ts +0 -23
  55. package/dist/internal/utils/groups.d.ts +0 -23
  56. package/dist/internal/utils/hover.d.ts +0 -15
  57. package/dist/internal/utils/keyboard.d.ts +0 -5
  58. package/dist/internal/utils/namespaces.d.ts +0 -18
  59. package/dist/internal/utils/observer.d.ts +0 -15
  60. package/dist/internal/utils/placement.d.ts +0 -22
  61. package/dist/internal/utils/pointer.d.ts +0 -33
  62. package/dist/internal/utils/provider.d.ts +0 -12
  63. package/dist/internal/utils/selection.d.ts +0 -36
  64. package/dist/internal/utils/session.d.ts +0 -5
  65. package/dist/vite.svg +0 -1
  66. package/dist/vue-dnd-kit-core.cjs.js +0 -2
  67. package/dist/vue-dnd-kit-core.es.js +0 -1524
@@ -0,0 +1,610 @@
1
+ import { App } from 'vue';
2
+
3
+ /** What a function `accept` rule is asked with. */
4
+ declare interface AcceptContext {
5
+ /** The drag. */
6
+ active: Active;
7
+ /** Every dragged item. */
8
+ items: DragItem[];
9
+ /** The types of every dragged item, together. */
10
+ types: string[];
11
+ }
12
+
13
+ /** `'all'`: every dragged item must match; `'some'`: at least one (the rest can be rejected in `onBeforeDrop`). */
14
+ declare type AcceptMode = 'all' | 'some';
15
+
16
+ /** `'*'` or omitted accepts everything. Untyped items fit any string rule (v2 `groups: []` parity). */
17
+ declare type AcceptRule = '*' | string | string[] | ((context: AcceptContext) => boolean);
18
+
19
+ /** The running drag: the item it started from, and every item it carries. */
20
+ declare interface Active<T = unknown> {
21
+ /** Id of the item the drag started from. */
22
+ id: Key;
23
+ /** Every dragged id, the primary one first (multi-drag). */
24
+ ids: Key[];
25
+ /** Every dragged item, the primary one first. */
26
+ items: DragItem<T>[];
27
+ /** The `data` of the item the drag started from. */
28
+ data: unknown;
29
+ /** The `label` of the item the drag started from, what people call it. */
30
+ label?: string;
31
+ /** The normalized `type` of the item the drag started from; empty means it fits any drop target. */
32
+ type: string[];
33
+ /** Element the drag started from. It may get detached (virtual lists, cross-list moves). */
34
+ element: HTMLElement;
35
+ /** Layout rect of `element` at drag start. */
36
+ rect: Rect;
37
+ /** How the drag moves: `'pointer'` follows points, `'keyboard'` moves by items (`SensorActivation.type`). */
38
+ sensor: SensorType;
39
+ /**
40
+ * A drag from outside the page (files, a link, text, or items from another window of the
41
+ * app): what it carries. Its `items` are made for it (`element` is a stand-in).
42
+ */
43
+ external?: ExternalData;
44
+ /** The browser's own drag (`native`, or one from outside): the browser draws the dragged image, and there is no overlay. */
45
+ native?: boolean;
46
+ }
47
+
48
+ export declare interface ActiveSnapshot {
49
+ id: Key;
50
+ ids: Key[];
51
+ items: ItemSnapshot[];
52
+ type: string[];
53
+ sensor: SensorType;
54
+ element: Element;
55
+ /** Layout rect of `element` at drag start. */
56
+ rect: Rect;
57
+ }
58
+
59
+ /** Why a drag ended without a drop. */
60
+ export declare type CancelReason =
61
+ /** Escape, `cancel()`, the provider unmounted. */
62
+ 'cancelled'
63
+ /** An `onBeforeDrop` (a monitor's, the target's or a list's) returned `false`, or a list's `dropOutside: 'cancel'`. */
64
+ | 'rejected'
65
+ /** Dropped on a target whose `accept` rule refuses the items. */
66
+ | 'refused';
67
+
68
+ /**
69
+ * Overlay clone of the dragged element. Taken synchronously at drag start,
70
+ * before the placeholder re-renders, and detached from page-level side effects.
71
+ */
72
+ /**
73
+ * Where the clone will be shown (the overlay's parent): the styles it loses there are
74
+ * inlined. Backgrounds aren't guessed: a source without one of its own (a list row the
75
+ * list paints) gives a transparent clone, styled with `[data-dnd-overlay]` in CSS.
76
+ */
77
+ export declare interface CloneOptions {
78
+ container?: Element | null;
79
+ }
80
+
81
+ /**
82
+ * The overlay's clone of `source`: a copy that fills the overlay box, with the computed
83
+ * styles it would lose outside its list inlined (`snapshot.ts`), in a box that carries the
84
+ * custom properties it inherits. A table row comes in a table of its own.
85
+ */
86
+ export declare const clonePreview: (source: HTMLElement, options?: CloneOptions) => HTMLElement;
87
+
88
+ /**
89
+ * Connects the devtools (once per page; later calls return the same bridge). Providers
90
+ * set up from now on report to it, until `disconnect()`.
91
+ */
92
+ export declare function connectDevtools(): DevtoolsBridge;
93
+
94
+ /**
95
+ * A point or an offset, in px: a position from the viewport's top-left corner, or an offset
96
+ * from where the drag started (`delta`, `transform`).
97
+ */
98
+ declare interface Coordinates {
99
+ /** Horizontal, growing to the right. */
100
+ x: number;
101
+ /** Vertical, growing downward. */
102
+ y: number;
103
+ }
104
+
105
+ /**
106
+ * A deep copy of `source` that stays out of the page's way: no ids, no `data-dnd-*` marks,
107
+ * hidden from assistive tech, with what `cloneNode` leaves out (form state, canvas pixels).
108
+ * `source` may be detached (an item Vue just removed).
109
+ */
110
+ export declare const copyElement: (source: HTMLElement) => HTMLElement;
111
+
112
+ export declare interface DevtoolsBridge {
113
+ /** Providers set up since the bridge was connected (and still mounted), in setup order. */
114
+ providers(): DevtoolsProvider[];
115
+ /** Tells `listener` about providers and their events. Returns the unsubscribe. */
116
+ subscribe(listener: DevtoolsListener): () => void;
117
+ /** Removes the hook and forgets every provider (tests, hot reload). */
118
+ disconnect(): void;
119
+ }
120
+
121
+ export declare type DevtoolsEvent = (OfDrag & {
122
+ type: 'start';
123
+ active: ActiveSnapshot;
124
+ pointer: Coordinates;
125
+ /** The list the items come from. */
126
+ source: Key | null;
127
+ /** `null`: started without a sensor (`manager.start`). */
128
+ sensor: SensorSnapshot | null;
129
+ }) | (OfDrag & {
130
+ type: 'over';
131
+ over: OverSnapshot | null;
132
+ previous: Key | null;
133
+ })
134
+ /** The pointer moved (every frame of a drag): for live views, not for logs. */
135
+ | (OfDrag & {
136
+ type: 'move';
137
+ })
138
+ /** Released: the `onBeforeDrop` hooks decide. */
139
+ | (OfDrag & {
140
+ type: 'release';
141
+ over: OverSnapshot | null;
142
+ }) | (OfDrag & {
143
+ type: 'drop';
144
+ over: OverSnapshot | null;
145
+ /** False when dropped outside every drop target. */
146
+ dropped: boolean;
147
+ accepted: Key[];
148
+ rejected: Key[];
149
+ /** Milliseconds the `onBeforeDrop` hooks took. */
150
+ waited: number;
151
+ sortable: SortableDropSnapshot[];
152
+ }) | (OfDrag & {
153
+ type: 'cancel';
154
+ reason: CancelReason;
155
+ over: OverSnapshot | null;
156
+ /** Milliseconds the `onBeforeDrop` hooks took; `null` when the drag was cancelled before a drop. */
157
+ waited: number | null;
158
+ /** Drops a list prepared before it was rejected. */
159
+ sortable: SortableDropSnapshot[];
160
+ }) | {
161
+ type: 'status';
162
+ status: DnDStatus;
163
+ } | {
164
+ type: 'selection';
165
+ ids: Key[];
166
+ } | {
167
+ type: 'announcement';
168
+ text: string;
169
+ } | {
170
+ type: 'autoScroll';
171
+ scrolling: boolean;
172
+ }
173
+ /**
174
+ * The items of a list with `animateChanges` on changed, and no drag changed them: the list
175
+ * animates the change (its keys; a tree's visible rows).
176
+ */
177
+ | {
178
+ type: 'change';
179
+ group: string;
180
+ list: Key;
181
+ added: Key[];
182
+ removed: Key[];
183
+ reordered: boolean;
184
+ };
185
+
186
+ export declare interface DevtoolsListener {
187
+ added?(provider: DevtoolsProvider): void;
188
+ /** The provider unmounted. */
189
+ removed?(provider: DevtoolsProvider): void;
190
+ /** A listener with this handler makes the bridge follow the providers (until then they are only recorded). */
191
+ event?(provider: DevtoolsProvider, event: DevtoolsEvent): void;
192
+ }
193
+
194
+ /**
195
+ * Live overrides of a provider's option values, for the devtools' editing: development
196
+ * only, never written to the code, gone with the provider. An override applies where the
197
+ * library reads the option, and what read it re-reads it.
198
+ *
199
+ * Options: the provider's props; a list's or tree's options; a plain drop target's
200
+ * (`disabled`, `priority`, `accept`, `acceptMode`); a draggable's or sortable item's
201
+ * `disabled`, `keyboard` and `activation` (overriding what it computes from its list too).
202
+ */
203
+ export declare interface DevtoolsOverrides {
204
+ /** Overrides `option` of `target` with `value`: `false` when it can't (no such target or option, a frozen options object). */
205
+ set(target: OverrideTarget, option: string, value: unknown): boolean;
206
+ /** Removes the override of `option` of `target`, of every option of `target`, or (no target) every override. */
207
+ reset(target?: OverrideTarget, option?: string): void;
208
+ /** `option` of `target`; `undefined` when the target isn't mounted (or isn't one: a list's own drop target). */
209
+ read(target: OverrideTarget, option: string): OptionRead | undefined;
210
+ /** Every override set (its target may be unmounted: it applies again when it mounts). */
211
+ list(): OptionOverride[];
212
+ }
213
+
214
+ /** A provider as the devtools see it. */
215
+ export declare interface DevtoolsProvider {
216
+ /** Unique on the page: `provider-1`, … in the order providers were set up. */
217
+ readonly id: string;
218
+ /** `DnDProvider` and the component that renders it. */
219
+ readonly label: string;
220
+ /** The app the provider renders in. */
221
+ readonly app: App | null;
222
+ /**
223
+ * The provider's handle (`useDnDContext()`): with `provideDnDContext`, a sensor runs in
224
+ * it from outside its components (the drags of the devtools tab).
225
+ */
226
+ readonly context: DnDContext;
227
+ /** Everything the provider knows, now. */
228
+ snapshot(): ProviderSnapshot;
229
+ /** Cancels the current drag (or a press that is activating, a running rubber band). */
230
+ cancel(): void;
231
+ /** Empties the selection. */
232
+ clearSelection(): void;
233
+ /** Live overrides of its options (the devtools' editing). */
234
+ readonly overrides: DevtoolsOverrides;
235
+ }
236
+
237
+ /**
238
+ * A provider as `useDnDContext()` returns it, to hand to `provideDnDContext()`: another
239
+ * Vue app (e.g. one mounted in a shadow root) then works with the same provider. Opaque:
240
+ * it has no public members, so it never changes with the library's internals.
241
+ */
242
+ declare interface DnDContext {
243
+ readonly [dndContext]: true;
244
+ }
245
+
246
+ declare const dndContext: unique symbol;
247
+
248
+ /**
249
+ * What the provider is doing:
250
+ * - `'idle'`: nothing;
251
+ * - `'activating'`: a press waits for its activation constraint (a distance, a long press);
252
+ * - `'dragging'`: a drag runs;
253
+ * - `'dropping'`: a drop is decided (an async `onBeforeDrop`), or an overlay still lands;
254
+ * - `'selecting'`: a selection area draws its band.
255
+ */
256
+ declare type DnDStatus = 'idle' | 'activating' | 'dragging' | 'dropping' | 'selecting';
257
+
258
+ export declare interface DraggableSnapshot {
259
+ id: Key;
260
+ /** Normalized `type`; empty fits any drop target. */
261
+ type: string[];
262
+ disabled: boolean;
263
+ selected: boolean;
264
+ /** One of the dragged items. */
265
+ dragging: boolean;
266
+ element: Element | null;
267
+ /** Handle element or selector; `null` when the whole element is the handle. */
268
+ handle: Element | string | null;
269
+ data: unknown;
270
+ /** A sortable item: the list or tree it is in (`null` while it is in none, e.g. a copy). */
271
+ list: Key | null;
272
+ }
273
+
274
+ /** One dragged item: the one the drag started from, or another one of a multi-drag. */
275
+ declare interface DragItem<T = unknown> {
276
+ /** Id of its draggable (the key of a sortable item). */
277
+ id: Key;
278
+ /** Item object when the drag comes from a sortable list. */
279
+ item?: T;
280
+ /** Its `data` option. */
281
+ data: unknown;
282
+ /** Its `label`, what people call it. */
283
+ label?: string;
284
+ /** Normalized `type` of the draggable; empty means it fits any drop target. */
285
+ type: string[];
286
+ }
287
+
288
+ /**
289
+ * What a drop does: `'move'`, `'copy'` (the items stay, copies of them go in), `'swap'`
290
+ * (`behavior: 'swap'`: two items exchange places) or `'insert'` (a plain draggable goes into
291
+ * a list as the item its `createItem` made).
292
+ */
293
+ declare type DragMode = 'move' | 'copy' | 'swap' | 'insert';
294
+
295
+ /**
296
+ * What a drop outside every target does: `'placeholder'` keeps the items where their slot
297
+ * is, `'cancel'` sends them back, `'remove'` takes them out of their list.
298
+ */
299
+ declare type DropOutside = 'placeholder' | 'cancel' | 'remove';
300
+
301
+ export declare interface DroppableSnapshot {
302
+ id: Key;
303
+ /** The `accept` option as given (`undefined`: everything). Sortable lists accept by their group's rules. */
304
+ accept: AcceptRule | undefined;
305
+ acceptMode: AcceptMode;
306
+ priority: number;
307
+ disabled: boolean;
308
+ /** The drag is over it. */
309
+ over: boolean;
310
+ /** During a drag: whether it takes the dragged items. `null` while idle, or when it can't be told without side effects. */
311
+ accepting: boolean | null;
312
+ element: Element | null;
313
+ data: unknown;
314
+ /** A sortable list or tree (see `ListSnapshot`). */
315
+ sortable: boolean;
316
+ }
317
+
318
+ /**
319
+ * A drag from outside the page (`Active.external`, `DnDEvent.external`). While it is held
320
+ * the browser tells what it carries, not the data: the files, links and text come at the
321
+ * drop (`ready`).
322
+ */
323
+ declare interface ExternalData {
324
+ /** The MIME types it offers (`Files`, `text/uri-list`, `text/plain`, an app's own). */
325
+ types: readonly string[];
326
+ /** The MIME types of its files, one per file (`''` when the browser can't tell). */
327
+ fileTypes: readonly string[];
328
+ /** At the drop: the files the target takes (folders and refused files left out). */
329
+ files: readonly File[];
330
+ /** At the drop: its links (`text/uri-list`). */
331
+ urls: readonly string[];
332
+ /** At the drop: its plain text. */
333
+ text: string;
334
+ /** At the drop: its HTML. */
335
+ html: string;
336
+ /** At the drop: the data of any type it offers (`''` before, and for a type it doesn't offer). */
337
+ getData(type: string): string;
338
+ /** It was dropped: the data above is there. */
339
+ ready: boolean;
340
+ /**
341
+ * Items of the library dragged in from another window of the app (`native`): the name of
342
+ * their sortable group. The lists of that group take them as if they came from one of
343
+ * their own lists; `active.items` has them.
344
+ */
345
+ group?: string;
346
+ }
347
+
348
+ export declare interface GroupSnapshot {
349
+ name: string;
350
+ lists: ListSnapshot[];
351
+ session: SortableSessionSnapshot | null;
352
+ /** Insertion line of `placeholder: 'indicator'` lists. */
353
+ indicator: SortableIndicator | null;
354
+ }
355
+
356
+ export declare interface ItemSnapshot {
357
+ id: Key;
358
+ type: string[];
359
+ data: unknown;
360
+ /** Item object of a sortable list. */
361
+ item?: unknown;
362
+ }
363
+
364
+ /** An id or a key: of a draggable, a drop target, a list, an item of a list. */
365
+ declare type Key = string | number;
366
+
367
+ export declare interface ListSnapshot {
368
+ id: Key;
369
+ kind: 'list' | 'tree';
370
+ /** Name of its sortable group (`sortable:<id>` for a list without `group`). */
371
+ group: string;
372
+ strategy: SortableStrategy;
373
+ placeholder: SortablePlaceholder;
374
+ behavior: SortableBehavior;
375
+ multiple: MultipleMode;
376
+ pull: boolean | 'clone';
377
+ /** `sort: false` keeps the order of its own items. */
378
+ sort: boolean;
379
+ dropOutside: DropOutside;
380
+ acceptMode: AcceptMode;
381
+ disabled: boolean;
382
+ /** `items` can't be written (a getter, a readonly ref): drops are the user's to apply. */
383
+ controlled: boolean;
384
+ /** Items in the source (visible rows of a tree). */
385
+ count: number;
386
+ /** Keys of the source, in order. */
387
+ keys: Key[];
388
+ /** Draft order during a drag; `null` while idle. */
389
+ draft: Key[] | null;
390
+ element: Element | null;
391
+ over: boolean;
392
+ /** See `DroppableSnapshot.accepting`. */
393
+ accepting: boolean | null;
394
+ }
395
+
396
+ /**
397
+ * What the other selected items do in a multi-drag:
398
+ * - `'group'`: they leave their places and travel with the active item as contiguous
399
+ * placeholders, so while hovering the list already shows the result of the drop;
400
+ * - `'gaps'`: they stay in place until the drop;
401
+ * - `'stack'`: they collapse into the overlay.
402
+ *
403
+ * The default overlay shows the dragged items in a column along the list (`'group'`,
404
+ * `'gaps'`; a row in horizontal lists, a pile behind the active one in grids), or the active
405
+ * one with a count (`'stack'`).
406
+ */
407
+ declare type MultipleMode = 'group' | 'gaps' | 'stack';
408
+
409
+ declare interface OfDrag {
410
+ /** Drags of the provider, counted from 1: the events of one drag share it. */
411
+ drag: number;
412
+ }
413
+
414
+ export declare interface OptionOverride {
415
+ target: OverrideTarget;
416
+ option: string;
417
+ value: unknown;
418
+ }
419
+
420
+ /** An option as the library reads it, and as the code gives it. */
421
+ export declare interface OptionRead {
422
+ /** The value the library uses now (an override's, else the code's, refs and getters read). */
423
+ value: unknown;
424
+ /** The option as the code gives it (a ref or a getter as given), underneath any override. */
425
+ code: unknown;
426
+ overridden: boolean;
427
+ }
428
+
429
+ /** What an option override applies to: the provider, or one of its lists (trees too), draggables or drop targets by id. */
430
+ export declare type OverrideTarget = {
431
+ kind: 'provider';
432
+ } | {
433
+ kind: 'list' | 'draggable' | 'droppable';
434
+ id: Key;
435
+ };
436
+
437
+ export declare interface OverSnapshot {
438
+ id: Key;
439
+ accepted: boolean;
440
+ data: unknown;
441
+ element: Element;
442
+ rect: Rect;
443
+ }
444
+
445
+ export declare interface ProviderSnapshot {
446
+ status: DnDStatus;
447
+ /** The provider's props as given (`undefined`: the default). */
448
+ options: Record<string, unknown>;
449
+ draggables: DraggableSnapshot[];
450
+ /** Drop targets, the droppables of sortable lists included (`sortable: true`). */
451
+ droppables: DroppableSnapshot[];
452
+ groups: GroupSnapshot[];
453
+ selection: Key[];
454
+ session: SessionSnapshot;
455
+ }
456
+
457
+ /** A box in px, in viewport coordinates, as `getBoundingClientRect()` gives it. */
458
+ declare interface Rect {
459
+ /** Its top edge, from the top of the viewport. */
460
+ top: number;
461
+ /** Its left edge, from the left of the viewport. */
462
+ left: number;
463
+ /** Its width. */
464
+ width: number;
465
+ /** Its height. */
466
+ height: number;
467
+ /** Its right edge, from the left of the viewport: `left + width`. */
468
+ right: number;
469
+ /** Its bottom edge, from the top of the viewport: `top + height`. */
470
+ bottom: number;
471
+ }
472
+
473
+ /** The sensor that started a drag. */
474
+ export declare interface SensorSnapshot {
475
+ /** Its `name` (`'pointer'`, `'keyboard'` for the built-in ones); `undefined` when it has none. */
476
+ name: string | undefined;
477
+ /** Started by touch. */
478
+ touch: boolean;
479
+ }
480
+
481
+ /**
482
+ * How a drag moves, whichever sensor drives it (`SensorActivation.type`): `'pointer'`
483
+ * follows points, `'keyboard'` moves by items.
484
+ */
485
+ declare type SensorType = 'pointer' | 'keyboard';
486
+
487
+ export declare interface SessionSnapshot {
488
+ status: DnDStatus;
489
+ active: ActiveSnapshot | null;
490
+ over: OverSnapshot | null;
491
+ /** Pointer after modifiers. */
492
+ pointer: Coordinates | null;
493
+ /** Offset of the overlay from the drag start, after modifiers. */
494
+ transform: Coordinates;
495
+ /** What a drop would do. */
496
+ mode: DragMode;
497
+ /** Key whose element the overlay lands on, when it isn't the active id (copies, created items). */
498
+ landingKey: Key | null;
499
+ /** Multi-drag: slot key → dragged id that lands there. */
500
+ landings: [Key, Key][];
501
+ /** Size of the overlay box (`overlayFit`). */
502
+ fitSize: Size | null;
503
+ /** Whether the drag has an overlay (without one the element itself moves). */
504
+ overlay: boolean;
505
+ /** The overlay box while it is shown (what the user sees dragged). */
506
+ overlayElement: HTMLElement | null;
507
+ /** Ids with a clone taken at pickup, in drop order. */
508
+ previews: Key[];
509
+ /** The drop is decided; only the overlay animation is left. */
510
+ settling: boolean;
511
+ /** What a decided drop lands on. */
512
+ dropTarget: OverSnapshot | null;
513
+ autoScrolling: boolean;
514
+ /** Progress of a press that is activating, 0–1. */
515
+ activation: number;
516
+ /** Last text of the live region. */
517
+ announcement: string;
518
+ }
519
+
520
+ /** A width and a height, in px. */
521
+ declare interface Size {
522
+ /** Width in px. */
523
+ width: number;
524
+ /** Height in px. */
525
+ height: number;
526
+ }
527
+
528
+ /** What hovering an item does: `'sort'` makes room (the items between shift), `'swap'` exchanges the two items. */
529
+ declare type SortableBehavior = 'sort' | 'swap';
530
+
531
+ /** A drop on a sortable list or tree, as its `SortableDropEvent` told it. */
532
+ export declare interface SortableDropSnapshot {
533
+ group: string;
534
+ keys: Key[];
535
+ accepted: Key[];
536
+ rejected: Key[];
537
+ from: {
538
+ list: Key | null;
539
+ index: number;
540
+ };
541
+ to: {
542
+ list: Key;
543
+ index: number;
544
+ };
545
+ sameList: boolean;
546
+ mode: DragMode;
547
+ /** `mode: 'swap'`: the exchanged item. */
548
+ partner?: Key;
549
+ /** The new items of every list the drop changes. */
550
+ result: ReadonlyMap<Key, unknown[]>;
551
+ /** `preventDefault()` was called: the drop wasn't written. */
552
+ defaultPrevented: boolean;
553
+ }
554
+
555
+ /** Where the drop goes with `placeholder: 'indicator'`: the list doesn't move, you draw the line. */
556
+ declare interface SortableIndicator {
557
+ /** Id of the list (or tree) the drop goes into. */
558
+ list: Key;
559
+ /** Insertion position in the list as rendered. */
560
+ index: number;
561
+ /** Item the indicator is attached to; `null` in an empty list. */
562
+ key: Key | null;
563
+ /**
564
+ * Side of `key` the line goes on. `'inside'` (trees): the middle of a row that takes
565
+ * the dragged nodes is hovered, the drop goes into it as its first child. `'swap'`
566
+ * (`behavior: 'swap'`): `key` is the item the drop exchanges with; mark the item itself.
567
+ */
568
+ side: 'before' | 'after' | 'inside' | 'swap';
569
+ /** Trees: depth the dropped nodes get (roots are 0), e.g. to indent the line. */
570
+ depth?: number;
571
+ /** Trees: parent the dropped nodes get, `null` at the root level. */
572
+ parentKey?: Key | null;
573
+ }
574
+
575
+ /**
576
+ * How a drag shows where it goes: `'item'`, the dragged item's slot moves through the list;
577
+ * `'indicator'`, the list stays as it is and `indicator` says where the drop goes (you draw the line).
578
+ */
579
+ declare type SortablePlaceholder = 'item' | 'indicator';
580
+
581
+ /** A sortable group's drag session. */
582
+ export declare interface SortableSessionSnapshot {
583
+ activeKey: Key;
584
+ /** Dragged key the slot stands for (a tree node the active one rides in). */
585
+ lead: Key;
586
+ /** Every moved key, the lead included. */
587
+ keys: Key[];
588
+ /** Where the lead started; `list` is `null` for a plain draggable from outside. */
589
+ origin: {
590
+ list: Key | null;
591
+ index: number;
592
+ };
593
+ /** Key holding the slot in the drafts: the lead, its copy or a created item. */
594
+ slot: Key;
595
+ /** List whose draft holds the slot. */
596
+ list: Key | null;
597
+ /** What the slot is: the dragged item (`move`), its copy or an item made for a plain draggable. */
598
+ kind: 'move' | 'copy' | 'insert';
599
+ /** Keys travelling with the slot (multi-drag `'group'`). */
600
+ block: Key[];
601
+ /** Item the active one is exchanged with (`behavior: 'swap'`). */
602
+ swap: Key | null;
603
+ /** A trash zone or `dropOutside: 'remove'` takes the items out of their lists. */
604
+ removed: boolean;
605
+ }
606
+
607
+ /** How a list lays out its items: a column (`'vertical'`), a row (`'horizontal'`) or a grid that wraps (`'grid'`). */
608
+ declare type SortableStrategy = 'vertical' | 'horizontal' | 'grid';
609
+
610
+ export { }