/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { DateTimeType, StringType, StructType } from "@elaraai/east"; import { type CellCoord, type DragEventValue, type DragPayload, type Formatters } from "@elaraai/east-ui-components"; import { type Context, type Place, type PlacedDuties, type RosterValue, type Week, type WeekState } from "./model.js"; import type { RosterCommands } from "./actions.js"; /** A person's week, as a drop names it (#1406, §11): the person's key and the week's first day. */ export declare const PersonWeekRefType: StructType<{ readonly person: StringType; readonly start: DateTimeType; }>; /** * A place's drop coordinate (#1548): `row` its group, printed, and `slot` the place, printed — a group's shift on a * day, or the shift on the day in no group's band. * * @param surface - The Roster's surface * @param place - The place: its day, its group or none, and its shift * @param event - The duty the coordinate names, if any * @returns The coordinate */ export declare function rosterCoord(surface: string, place: Place, event?: string): CellCoord; /** * A person-week drop target's coordinate (#1406, §11): `row` the person's key, `slot` the East-printed `{ person, start }`. * * @param surface - The Roster's surface * @param person - The person's key * @param start - The week's first day * @returns The coordinate */ export declare function rosterPersonWeekCoord(surface: string, person: string, start: Date): CellCoord; /** * A person's week, read from a drop's slot. * * @param slot - The slot's text * @returns The person and the week's first day; `undefined` for a slot naming a shift */ export declare function readPersonWeek(slot: string): { person: string; start: Date; } | undefined; /** Whether a drag's payload is a card of the Patterns tab. */ export declare function isPatternCard(payload: DragPayload, storageKey: string): boolean; /** * One adapter from the shared drag grammar to the same commands as explicit actions. It is the same object while the * week, its commands and the configuration hold (#1398, CL9): what the grid draws with it draws again only as they * change. */ export declare function useRosterDrag({ value, commands, week, duties, weeks, context, storageKey, narrow, start, format, onError }: { value: RosterValue; commands: RosterCommands; week: Week; duties: PlacedDuties; weeks: readonly WeekState[]; context: Context; storageKey: string; narrow: boolean; start: Date; format: Formatters; onError: (error: string | undefined) => void; }): { enabled: boolean; surface: string; run: (event: DragEventValue, checkOnly: boolean) => string | undefined; caption: (coord: CellCoord, payload: DragPayload, allowed: boolean) => string; preview: (coord: CellCoord, payload: DragPayload, allowed: boolean) => { label: string; tone: "info" | "warning" | "danger"; }; name: (coord: CellCoord) => string; start: Date; }; export type RosterDrag = ReturnType; //# sourceMappingURL=drag.d.ts.map