/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type CellCoord, type DragEventValue, type DragPayload } from "@elaraai/east-ui-components"; import { type CalendarCommands, type CalendarPlacement, type CalendarSource } from "./actions.js"; import { type CalendarItem, type CalendarValue } from "./model.js"; /** The views hand drop coordinates to this single grammar adapter. */ export interface CalendarDrag { surface: string; grab: (item: CalendarItem, instant: Date) => void; adjust: (instant: Date, payload: DragPayload | undefined) => Date; wholeDay: (day: Date, payload?: DragPayload) => Date; readTime: (slot: string) => Date | undefined; enabled: boolean; run: (event: DragEventValue, checkOnly: boolean) => string | undefined; preview: (coord: CellCoord, payload: DragPayload) => CalendarPlacement | undefined; /** A drag's words where it rests: why a drop there is refused, if it is, the event's name, and the instant it lands at in the locale's date and time. */ caption: (coord: CellCoord, payload: DragPayload, allowed: boolean) => string; create: (start: Date, end: Date, resource: CalendarItem["resource"]) => void; } interface DragArgs { value: CalendarValue; key: string; commands: CalendarCommands | undefined; narrow: boolean; items: readonly CalendarItem[]; backlog: readonly CalendarItem[]; selection: readonly CalendarItem[]; /** The Backlog a page at a time (#1424): what a card it listed is, by its id — where a drag of it finds its event. */ served?: { served(id: string): CalendarItem | undefined; } | undefined; /** The templates the rail shows, by their card's id: what a drop or a drawn event is made from (#1343). */ templates: ReadonlyMap; activeTemplate: string | undefined; onError: (message: string | undefined) => void; } /** * No layer is registered in narrow or read-only mode. The same object while its surface and whether it takes a drag hold * (#1398, CL9; #1594), each of its answers read from the verdicts as they stand: what the views draw with it — a row that * draws nothing again as a drop lands on another — asks the verdicts of now, and draws again for none of their moves. */ export declare function useCalendarDrag(args: DragArgs): CalendarDrag; /** One canonical continuous cell coordinate. */ export declare function calendarCoord(surface: string, start: Date, resource: CalendarItem["resource"], event?: string): CellCoord; export {}; //# sourceMappingURL=drag.d.ts.map