/** * Gantt Chart Wrapper Class * * A unified API for building, mutating, and querying Gantt charts. * Provides a fluent interface that wraps the GanttAST. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { GanttAST, GanttSection, GanttTask, GanttTaskStatus, GanttWeekday, GanttWeekendStart } from './types/gantt.js'; import type { RenderOptions } from './types/render-options.js'; /** * Options for adding a task */ export interface AddTaskOptions { /** Task ID */ id?: string; /** Task status (done, active, crit, milestone) */ status?: GanttTaskStatus; /** Start date or dependency */ start?: string; /** End date or duration */ end?: string; } /** * Query options for finding tasks */ export interface FindTasksQuery { /** Find tasks in this section */ section?: string; /** Find tasks with this status */ status?: GanttTaskStatus; /** Find tasks whose name contains this string */ nameContains?: string; /** Find tasks with this ID */ id?: string; } /** * A fluent wrapper for GanttAST that supports building, mutating, and querying. */ export declare class Gantt extends DiagramWrapper { private constructor(); /** * Create a new empty Gantt chart */ static create(): Gantt; /** * Create a Gantt wrapper from an existing AST */ static from(ast: GanttAST): Gantt; /** * Parse Mermaid syntax and create a Gantt wrapper */ static parse(text: string): Gantt; /** * Render to Mermaid syntax */ render(options?: RenderOptions): string; /** * Create a deep clone of this Gantt chart */ clone(): Gantt; get title(): string | undefined; set title(value: string | undefined); get dateFormat(): string | undefined; set dateFormat(value: string | undefined); get axisFormat(): string | undefined; set axisFormat(value: string | undefined); get sections(): GanttSection[]; get taskCount(): number; get sectionCount(): number; /** * Set the title */ setTitle(title: string): this; /** * Set the date format */ setDateFormat(format: string): this; /** * Set the axis format */ setAxisFormat(format: string): this; /** * Set the tick interval */ setTickInterval(interval: string): this; /** * Enable inclusive end dates */ enableInclusiveEndDates(): this; /** * Disable inclusive end dates */ disableInclusiveEndDates(): this; /** * Enable top axis */ enableTopAxis(): this; /** * Set excludes */ setExcludes(excludes: string): this; /** * Set includes */ setIncludes(includes: string): this; /** * Set today marker format */ setTodayMarker(marker: string): this; /** * Set the first day of the week */ setWeekday(day: GanttWeekday): this; /** * Set the weekend start day */ setWeekend(day: GanttWeekendStart): this; /** * Add a section */ addSection(name: string): this; /** * Get a section by name */ getSection(name: string): GanttSection | undefined; /** * Remove a section */ removeSection(name: string): this; /** * Rename a section */ renameSection(oldName: string, newName: string): this; /** * Add a task to a section (or to the root if no section specified) */ addTask(name: string, sectionName?: string, options?: AddTaskOptions): this; /** * Get a task by ID */ getTask(id: string): GanttTask | undefined; /** * Remove a task by ID */ removeTask(id: string): this; /** * Set task status */ setTaskStatus(id: string, status: GanttTaskStatus): this; /** * Set task as a milestone */ setMilestone(id: string): this; /** * Set task as critical */ setCritical(id: string): this; /** * Set task as done */ setDone(id: string): this; /** * Set task as active */ setActive(id: string): this; /** * Move a task to a different section */ moveTask(id: string, toSection: string): this; /** * Set a click callback for a task */ setClickCallback(taskId: string, callback: string, args?: string): this; /** * Set a link for a task */ setLink(taskId: string, href: string): this; /** * Get all tasks (from all sections and root) */ getAllTasks(): GanttTask[]; /** * Find tasks matching a query */ findTasks(query: FindTasksQuery): GanttTask[]; /** * Get tasks in a section */ getTasksInSection(sectionName: string): GanttTask[]; /** * Get critical tasks */ getCriticalTasks(): GanttTask[]; /** * Get milestones */ getMilestones(): GanttTask[]; } //# sourceMappingURL=gantt.d.ts.map