UNPKG

hy-vue-gantt

Version:

Evolution of vue-ganttastic package

43 lines 1.83 kB
import { type GanttBarObject } from "../types/bar"; import type { GGanttChartConfig } from "../types/config"; import dayjs from "dayjs"; import type { UseRowsReturn } from "./useRows"; /** * Interface defining the result of a bar movement operation */ export interface MovementResult { success: boolean; affectedBars: Set<GanttBarObject>; } /** * Interface defining the API for bar movement operations */ export interface MovementAPI { moveBar: (bar: GanttBarObject, newStart: string, newEnd: string) => MovementResult; findOverlappingBars: (bar: GanttBarObject) => GanttBarObject[]; findConnectedBars: (bar: GanttBarObject) => GanttBarObject[]; getAllBars: () => GanttBarObject[]; } /** * Interface defining the dayjs helper functions required for bar movement */ interface DayjsHelper { toDayjs: (input: string | Date | GanttBarObject, startOrEnd?: "start" | "end") => dayjs.Dayjs; format: (input: string | Date | dayjs.Dayjs, pattern?: string | false) => string | Date; } /** * A composable that manages bar movement operations in the Gantt chart * Handles validation, collision detection, and connected bar movement * @param config - Gantt chart configuration * @param rowManager - Row management utilities * @param dayjsHelper - Date manipulation utilities * @returns MovementAPI object for managing bar movements */ export declare function useBarMovement(config: GGanttChartConfig, rowManager: UseRowsReturn, dayjsHelper: DayjsHelper): { moveBar: (bar: GanttBarObject, newStart: string, newEnd: string, initialMove?: boolean) => MovementResult; findOverlappingBars: (bar: GanttBarObject) => GanttBarObject[]; findConnectedBars: (bar: GanttBarObject) => GanttBarObject[]; getAllBars: () => GanttBarObject[]; }; export {}; //# sourceMappingURL=useBarMovement.d.ts.map