/**
* Drag & Drop system for Calendar events.
* Uses native Pointer Events API — no external DnD library needed.
*/
import type { Attachment } from 'svelte/attachments';
import type { CalendarEvent } from './calendar.types.js';
export interface DragState {
active: boolean;
event: CalendarEvent | null;
originDate: Date | null;
ghostEl: HTMLElement | null;
}
export declare function createDragState(): DragState;
export interface DraggableEventOptions {
event: CalendarEvent;
disabled?: boolean;
onDragStart?: () => void;
onDragEnd?: (targetDate: Date | null) => void;
}
/**
* Svelte attachment that makes a calendar event element draggable.
* Uses Pointer Events for cross-device support (touch + mouse).
*
* Usage: `
`
*/
export declare function draggableEvent(opts: DraggableEventOptions): Attachment;
export interface ResizableEventOptions {
/** The event being resized. */
event: CalendarEvent;
/**
* The box that spans exactly `startHour`…`endHour` — the event's own day
* column (`[data-day-column]` in CalendarTimeGrid), which is what pixels are
* mapped to minutes against.
*
* Explicitly NOT the scroll port: since #96 that port also carries the week's
* pinned head/all-day strip above the hours, so neither its top edge nor its
* height is the day. Its height is read from `getBoundingClientRect()` rather
* than `scrollHeight` for the same reason a column beats the port — an event
* dragged past the bottom edge grows the scrollable overflow and would move
* the denominator mid-gesture.
*/
dayColumnEl: HTMLElement;
/** The event block element whose height changes during resize. */
eventEl: HTMLElement;
/** Start hour of the time grid. */
startHour: number;
/** End hour of the time grid (exclusive). */
endHour: number;
/** Snap interval in minutes. @default 15 */
snapMinutes?: number;
/** Minimum event duration in minutes. @default 15 */
minDuration?: number;
/** Whether resize is disabled. */
disabled?: boolean;
/** Callback when resize completes. */
onResizeEnd?: (event: CalendarEvent, newEnd: Date) => void;
}
/**
* Svelte attachment for the resize handle at the bottom of a time-grid event.
* Drag the handle up/down to change the event's duration, snapping to
* a configurable grid (default 15 minutes).
*/
export declare function resizableEvent(opts: ResizableEventOptions): Attachment;