@toclocoinc/lattice-grid 1.58.0 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +3 -3
  2. package/docs/API.html +1773 -73
  3. package/docs/api-detail.html +321 -5
  4. package/lattice-grid.d.ts +281 -2842
  5. package/lattice-grid.esm.min.js +879 -148
  6. package/lattice-grid.min.cjs +879 -148
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +879 -148
  9. package/modules/ai.d.ts +401 -0
  10. package/modules/ai.esm.min.js +25 -6
  11. package/modules/ai.min.cjs +25 -6
  12. package/modules/ai.min.js +25 -6
  13. package/modules/angular.d.ts +31 -0
  14. package/modules/angular.esm.min.js +3 -2
  15. package/modules/angular.min.cjs +3 -2
  16. package/modules/angular.min.js +3 -2
  17. package/modules/chart-alluvial.d.ts +18 -0
  18. package/modules/chart-alluvial.esm.min.js +1 -1
  19. package/modules/chart-arc.d.ts +18 -0
  20. package/modules/chart-arc.esm.min.js +1 -1
  21. package/modules/chart-bubblemap.d.ts +18 -0
  22. package/modules/chart-bubblemap.esm.min.js +1 -1
  23. package/modules/chart-bump.d.ts +12 -0
  24. package/modules/chart-bump.esm.min.js +1 -1
  25. package/modules/chart-calendar.d.ts +12 -0
  26. package/modules/chart-calendar.esm.min.js +1 -1
  27. package/modules/chart-decomposition.d.ts +20 -0
  28. package/modules/chart-decomposition.esm.min.js +1 -1
  29. package/modules/chart-diverging.d.ts +12 -0
  30. package/modules/chart-diverging.esm.min.js +1 -1
  31. package/modules/chart-dumbbell.d.ts +18 -0
  32. package/modules/chart-dumbbell.esm.min.js +1 -1
  33. package/modules/chart-fan.d.ts +18 -0
  34. package/modules/chart-fan.esm.min.js +1 -1
  35. package/modules/chart-hexbin.d.ts +18 -0
  36. package/modules/chart-hexbin.esm.min.js +1 -1
  37. package/modules/chart-hexmap.d.ts +18 -0
  38. package/modules/chart-hexmap.esm.min.js +1 -1
  39. package/modules/chart-icicle.d.ts +12 -0
  40. package/modules/chart-icicle.esm.min.js +1 -1
  41. package/modules/chart-parallel.d.ts +19 -0
  42. package/modules/chart-parallel.esm.min.js +1 -1
  43. package/modules/chart-ridgeline.d.ts +14 -0
  44. package/modules/chart-ridgeline.esm.min.js +1 -1
  45. package/modules/chart-roc.d.ts +20 -0
  46. package/modules/chart-roc.esm.min.js +1 -1
  47. package/modules/chart-slope.d.ts +12 -0
  48. package/modules/chart-slope.esm.min.js +1 -1
  49. package/modules/chart-splom.d.ts +19 -0
  50. package/modules/chart-splom.esm.min.js +1 -1
  51. package/modules/chart-waffle.d.ts +12 -0
  52. package/modules/chart-waffle.esm.min.js +1 -1
  53. package/modules/charts.d.ts +122 -0
  54. package/modules/charts.esm.min.js +4 -4
  55. package/modules/charts.min.cjs +4 -4
  56. package/modules/charts.min.js +4 -4
  57. package/modules/data-router.d.ts +91 -0
  58. package/modules/data-router.esm.min.js +109 -17
  59. package/modules/data-router.min.cjs +109 -17
  60. package/modules/data-router.min.js +109 -17
  61. package/modules/devtools.d.ts +28 -0
  62. package/modules/devtools.esm.min.js +2 -2
  63. package/modules/devtools.min.cjs +2 -2
  64. package/modules/devtools.min.js +2 -2
  65. package/modules/dhtmlx-compat.d.ts +19 -0
  66. package/modules/dhtmlx-compat.esm.min.js +4 -4
  67. package/modules/dhtmlx-compat.min.cjs +4 -4
  68. package/modules/dhtmlx-compat.min.js +4 -4
  69. package/modules/gantt.d.ts +515 -0
  70. package/modules/gantt.esm.min.js +109 -33
  71. package/modules/gantt.min.cjs +109 -33
  72. package/modules/gantt.min.js +109 -33
  73. package/modules/htmx.d.ts +176 -0
  74. package/modules/htmx.esm.min.js +879 -148
  75. package/modules/htmx.min.cjs +879 -148
  76. package/modules/htmx.min.js +879 -148
  77. package/modules/kanban.d.ts +492 -0
  78. package/modules/kanban.esm.min.js +4 -4
  79. package/modules/kanban.min.cjs +4 -4
  80. package/modules/kanban.min.js +4 -4
  81. package/modules/kpi.d.ts +255 -0
  82. package/modules/kpi.esm.min.js +40 -7
  83. package/modules/kpi.min.cjs +40 -7
  84. package/modules/kpi.min.js +40 -7
  85. package/modules/layout.d.ts +332 -0
  86. package/modules/layout.esm.min.js +59 -6
  87. package/modules/layout.min.cjs +59 -6
  88. package/modules/layout.min.js +59 -6
  89. package/modules/mock-socket.d.ts +114 -0
  90. package/modules/mock-socket.esm.min.js +2 -2
  91. package/modules/mock-socket.min.cjs +2 -2
  92. package/modules/mock-socket.min.js +2 -2
  93. package/modules/react.d.ts +25 -0
  94. package/modules/react.esm.min.js +3 -2
  95. package/modules/react.min.cjs +3 -2
  96. package/modules/react.min.js +3 -2
  97. package/modules/svelte.d.ts +26 -0
  98. package/modules/svelte.esm.min.js +3 -2
  99. package/modules/svelte.min.cjs +3 -2
  100. package/modules/svelte.min.js +3 -2
  101. package/modules/tabs.d.ts +133 -0
  102. package/modules/tabs.esm.min.js +411 -9
  103. package/modules/tabs.min.cjs +411 -9
  104. package/modules/tabs.min.js +411 -9
  105. package/modules/vue.d.ts +24 -0
  106. package/modules/vue.esm.min.js +3 -2
  107. package/modules/vue.min.cjs +3 -2
  108. package/modules/vue.min.js +3 -2
  109. package/modules/webcomponent.d.ts +47 -0
  110. package/modules/webcomponent.esm.min.js +879 -148
  111. package/modules/webcomponent.min.cjs +879 -148
  112. package/modules/webcomponent.min.js +879 -148
  113. package/package.json +2 -2
@@ -0,0 +1,515 @@
1
+ /*!
2
+ * Lattice Grid 1.60.0, gantt module type declarations
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ /** One of the four dependency link types (finish-to-start, start-to-start, finish-to-finish, start-to-finish). */
7
+ export type GanttLinkType = 'FS' | 'SS' | 'FF' | 'SF';
8
+
9
+ /** A scheduling constraint: pin the start, pin the finish, or schedule as late as possible. */
10
+ export type GanttConstraintType =
11
+ | 'must-start-on' | 'must-finish-on' | 'as-late-as-possible' | 'MSO' | 'MFO' | 'ALAP';
12
+
13
+ /** A working-time calendar: a Monday–Friday preset, or explicit working weekdays and holidays. */
14
+ export type GanttCalendar =
15
+ | 'weekends'
16
+ | { workdays?: number[]; holidays?: Array<string | number | Date> };
17
+
18
+ /**
19
+ * A task in a Gantt plan. Give a `duration` or a `start`+`end` (a day-number,
20
+ * ISO date string or `Date`; one is derived from the other). `milestone: true`
21
+ * (or `duration: 0`) is a zero-duration point. `parent` nests a task under a
22
+ * summary, whose window and progress are DERIVED from its children.
23
+ * `baselineStart`/`baselineEnd` (host-stored) drive planned-vs-actual variance;
24
+ * `constraint` pins or pulls the task; `assignee` and `height` feed the split
25
+ * view's grid panel.
26
+ */
27
+ export interface GanttTask {
28
+ id: string | number;
29
+ name?: string;
30
+ start?: number | string | Date;
31
+ end?: number | string | Date;
32
+ duration?: number;
33
+ percentComplete?: number;
34
+ milestone?: boolean;
35
+ parent?: string | number;
36
+ baselineStart?: number | string | Date;
37
+ baselineEnd?: number | string | Date;
38
+ baseline?: { start?: number | string | Date; end?: number | string | Date };
39
+ constraint?: GanttConstraintType;
40
+ constraintDate?: number | string | Date;
41
+ assignee?: string | string[];
42
+ assignees?: string[];
43
+ owner?: string;
44
+ /**
45
+ * Explicit resource assignments with fractional units (BACKLOG-0000948):
46
+ * `units` is a multiplier where 1 is a full-time booking. Use this when a
47
+ * task books a resource at less (or more) than 100%; a bare `assignee` is
48
+ * `units: 1`.
49
+ */
50
+ assignments?: Array<{ resource?: string; name?: string; id?: string; units?: number }>;
51
+ /** Leveling priority: a higher value is delayed last (default 0). */
52
+ priority?: number;
53
+ /** An explicit row height (px) for the split view; applied to both panels. */
54
+ height?: number;
55
+ /**
56
+ * The budgeted cost (BAC) for earned-value analysis (BACKLOG-0000958). When
57
+ * omitted the task's duration is used as the budget, giving schedule-only EVM.
58
+ */
59
+ cost?: number;
60
+ /**
61
+ * The actual cost incurred (ACWP) for earned-value analysis
62
+ * (BACKLOG-0000958). Left out, the task's cost variance/CPI are `null`.
63
+ */
64
+ actualCost?: number;
65
+ }
66
+
67
+ /**
68
+ * Resource capacities for over-allocation detection and leveling
69
+ * (BACKLOG-0000948): either a list of resources with a capacity (max
70
+ * concurrent units, default 1) or a name→capacity map.
71
+ */
72
+ export type GanttResourceSpec =
73
+ | Array<{ id?: string; name?: string; resource?: string; capacity?: number; maxUnits?: number; max?: number; units?: number }>
74
+ | Record<string, number>;
75
+
76
+ /**
77
+ * A typed dependency between two tasks (by id), with optional lag/lead. `type`
78
+ * defaults to `'FS'`; either endpoint may be a leaf or a summary.
79
+ *
80
+ * `type` also accepts the MS Project string shorthand — `'FS+2'`, `'SS-1'`
81
+ * (BACKLOG-0001072). It is normalised to the structured form on the way in, so
82
+ * `gantt.dependencies` always reads back `{ type, lag }` and there is no second
83
+ * internal representation. Giving both a shorthand lag and a conflicting `lag`
84
+ * field warns; the explicit field wins.
85
+ */
86
+ export interface GanttDependency {
87
+ from: string | number;
88
+ to: string | number;
89
+ type?: GanttLinkType | `${GanttLinkType}${'+' | '-'}${number}`;
90
+ lag?: number;
91
+ }
92
+
93
+ /** The computed CPM values for one task (a leaf is scheduled, a summary derived). */
94
+ interface GanttScheduledTask {
95
+ id: string;
96
+ name: string;
97
+ duration: number;
98
+ es: number;
99
+ ef: number;
100
+ ls: number;
101
+ lf: number;
102
+ totalFloat: number;
103
+ critical: boolean;
104
+ percentComplete: number | null;
105
+ parent: string | null;
106
+ isSummary: boolean;
107
+ isMilestone: boolean;
108
+ children: string[];
109
+ /** The planned (baseline) window, present only when the task carries a baseline. */
110
+ baselineStart?: number | null;
111
+ baselineEnd?: number | null;
112
+ /** Variance vs the baseline (actual − planned, day-numbers); a positive value is a slip. */
113
+ startVariance?: number | null;
114
+ finishVariance?: number | null;
115
+ durationVariance?: number | null;
116
+ }
117
+
118
+ /** An unhonourable scheduling constraint, reported rather than obeyed. */
119
+ interface GanttConflict {
120
+ id: string;
121
+ type: string;
122
+ at: number | null;
123
+ earliestFeasible: number;
124
+ }
125
+
126
+ /** A CPM schedule result: per-task dates/float and the critical path, or an error. */
127
+ interface GanttSchedule {
128
+ ok: boolean;
129
+ error?: { code: string; message: string; cycle?: string[] };
130
+ tasks?: Map<string, GanttScheduledTask>;
131
+ order?: string[];
132
+ critical?: string[];
133
+ criticalPaths?: string[][];
134
+ projectStart?: number;
135
+ projectFinish?: number;
136
+ projectDuration?: number;
137
+ /** Constraints a predecessor made infeasible (empty when all are satisfied). */
138
+ conflicts?: GanttConflict[];
139
+ /** Whether a working-time calendar was applied. */
140
+ calendar?: boolean;
141
+ /** The resource over-allocations for this schedule (BACKLOG-0000948). */
142
+ overAllocations?: GanttOverAllocation[];
143
+ /** The full resource-load report for this schedule (BACKLOG-0000948). */
144
+ resourceLoad?: GanttResourceLoad;
145
+ }
146
+
147
+ /** One contiguous load segment for a resource: how many units are booked over a span. */
148
+ interface GanttResourceSegment {
149
+ start: number;
150
+ end: number;
151
+ load: number;
152
+ taskIds: string[];
153
+ }
154
+
155
+ /** A resource booked beyond its capacity across concurrent tasks (BACKLOG-0000948). */
156
+ interface GanttOverAllocation {
157
+ resource: string;
158
+ capacity: number;
159
+ start: number;
160
+ end: number;
161
+ load: number;
162
+ taskIds: string[];
163
+ }
164
+
165
+ /** The per-resource load and the over-allocations across a schedule (BACKLOG-0000948). */
166
+ interface GanttResourceLoad {
167
+ ok: boolean;
168
+ resources: Array<{ resource: string; capacity: number; peak: number; segments: GanttResourceSegment[] }>;
169
+ overAllocations: GanttOverAllocation[];
170
+ byResource: Map<string, { capacity: number; peak: number; segments: GanttResourceSegment[] }>;
171
+ }
172
+
173
+ /** The result of resource leveling: the shifted tasks and what moved (BACKLOG-0000948). */
174
+ interface GanttLevelResult {
175
+ ok: boolean;
176
+ resolved?: boolean;
177
+ tasks?: GanttTask[];
178
+ schedule?: GanttSchedule;
179
+ moves?: Array<{ id: string; from: number; to: number; delay: number }>;
180
+ remaining?: GanttOverAllocation[];
181
+ error?: { code: string; message: string };
182
+ }
183
+
184
+ /** A placement violation flagged by `findViolations`. */
185
+ interface GanttViolation {
186
+ id: string;
187
+ placedStart: number;
188
+ earliestStart: number;
189
+ by: number;
190
+ }
191
+
192
+ /** The four link types, in documented order. */
193
+ export const LINK_TYPES: readonly GanttLinkType[];
194
+
195
+ /** Error codes the scheduler reports (rather than throwing) on bad input. */
196
+ export const SCHEDULE_ERROR: Record<string, string>;
197
+
198
+ /**
199
+ * Compute the CPM schedule for a set of tasks and dependencies: forward and
200
+ * backward passes over the leaf tasks honouring FS/SS/FF/SF + lag, slack/float
201
+ * and the zero-float critical path, with summaries derived from their children,
202
+ * milestones scheduled as points, and dependency cycles refused (never looped).
203
+ */
204
+ export function computeSchedule(tasks: GanttTask[], deps?: GanttDependency[], options?: { projectStart?: number | string | Date; deadline?: number | string | Date; calendar?: GanttCalendar | null }): GanttSchedule;
205
+
206
+ /** The tasks placed earlier than their earliest feasible start (manual validation). */
207
+ export function findViolations(tasks: GanttTask[], schedule: GanttSchedule): GanttViolation[];
208
+
209
+ /** Format an engine day-number as an ISO calendar date (`YYYY-MM-DD`, UTC). */
210
+ export function toISODate(day: number): string | null;
211
+
212
+ /** Earned-value metrics for one task or the whole project (BACKLOG-0000958). */
213
+ interface GanttEarnedValueRow {
214
+ id: string;
215
+ name: string;
216
+ isSummary: boolean;
217
+ isMilestone: boolean;
218
+ percentComplete: number | null;
219
+ /** Whether a baseline (not the fallback scheduled window) drove PV. */
220
+ hasBaseline: boolean;
221
+ /** Whether any actual cost fed AC (else AC/CV/CPI are null). */
222
+ hasActualCost: boolean;
223
+ /** Budget at completion (the task's cost, or its duration when no cost). */
224
+ bac: number;
225
+ /** Planned Value (BCWS): budgeted cost of the work scheduled by the status date. */
226
+ pv: number;
227
+ /** Earned Value (BCWP): budgeted cost of the work performed (BAC × %complete). */
228
+ ev: number;
229
+ /** Actual Cost (ACWP): what the work performed actually cost, or null. */
230
+ ac: number | null;
231
+ /** Schedule Variance (EV − PV); positive is ahead of schedule. */
232
+ sv: number;
233
+ /** Cost Variance (EV − AC); positive is under budget; null without AC. */
234
+ cv: number | null;
235
+ /** Schedule Performance Index (EV / PV); null when PV is zero. */
236
+ spi: number | null;
237
+ /** Cost Performance Index (EV / AC); null without AC or when AC is zero. */
238
+ cpi: number | null;
239
+ }
240
+
241
+ /** The earned-value result at a status date (BACKLOG-0000958). */
242
+ interface GanttEarnedValue {
243
+ ok: boolean;
244
+ error?: { code: string; message: string };
245
+ /** The status date the metrics were evaluated at (day-number). */
246
+ statusDate?: number;
247
+ /** Every task keyed by id (leaf, summary and derived). */
248
+ byTask?: Map<string, GanttEarnedValueRow>;
249
+ /** The same rows in schedule order. */
250
+ rows?: GanttEarnedValueRow[];
251
+ /** The project total, rolled up as money sums of the leaves. */
252
+ project?: GanttEarnedValueRow;
253
+ }
254
+
255
+ /**
256
+ * Compute earned-value management (EVM) metrics for a scheduled plan at a
257
+ * status date (BACKLOG-0000958): PV/BCWS from the baseline, EV/BCWP from
258
+ * %complete, AC/ACWP from the per-task `actualCost`, and the derived SV/CV and
259
+ * SPI/CPI — per leaf, rolled up to summaries and the project. The math is
260
+ * implemented locally in the module (no core-compute dependency).
261
+ */
262
+ export function computeEarnedValue(
263
+ tasks: GanttTask[],
264
+ schedule: GanttSchedule,
265
+ options?: { statusDate?: number | string | Date; costField?: string; actualCostField?: string },
266
+ ): GanttEarnedValue;
267
+
268
+ /** A headless Gantt controller: holds the model, recomputes on edits, emits changes. */
269
+ interface Gantt {
270
+ readonly tasks: GanttTask[];
271
+ readonly dependencies: GanttDependency[];
272
+ readonly schedule: GanttSchedule | null;
273
+ readonly critical: string[];
274
+ /** Constraints the latest schedule could not honour (empty when all are satisfied). */
275
+ readonly conflicts: GanttConflict[];
276
+ readonly autoSchedule: boolean;
277
+ readonly grid: unknown;
278
+ /** The over-allocations from the latest schedule (BACKLOG-0000948). */
279
+ readonly overAllocations: GanttOverAllocation[];
280
+ /** The latest resource-load report, or null before a successful schedule (BACKLOG-0000948). */
281
+ readonly resourceLoad: GanttResourceLoad | null;
282
+ setTasks(tasks: GanttTask[]): GanttSchedule;
283
+ setDependencies(deps: GanttDependency[]): GanttSchedule;
284
+ applyEdit(patch: { id: string | number; start?: number; end?: number; duration?: number }, editOpts?: { writeBack?: boolean }): GanttSchedule;
285
+ compute(): GanttSchedule;
286
+ findViolations(): GanttViolation[];
287
+ /**
288
+ * Compute the resource load and over-allocations on demand (BACKLOG-0000948),
289
+ * optionally overriding the capacities for this call.
290
+ */
291
+ resources(loadOpts?: { resources?: GanttResourceSpec; defaultCapacity?: number }): GanttResourceLoad;
292
+ /**
293
+ * Resolve resource over-allocation by shifting tasks later — resource
294
+ * leveling (BACKLOG-0000948). Honours the CPM dependencies and the
295
+ * working-time calendar. Mutates the model unless `{ dryRun: true }`; with
296
+ * `{ writeBack: true }` and a bound grid the moved tasks are pushed through
297
+ * the grid's edit surface.
298
+ */
299
+ level(levelOpts?: {
300
+ dryRun?: boolean;
301
+ writeBack?: boolean;
302
+ priorityField?: string;
303
+ maxIterations?: number;
304
+ resources?: GanttResourceSpec;
305
+ defaultCapacity?: number;
306
+ }): GanttLevelResult;
307
+ /** Export the scheduled tasks as CSV; `{ dates: true }` writes ISO dates. */
308
+ toCSV(csvOpts?: { dates?: boolean }): string;
309
+ /**
310
+ * Export the current plan as Microsoft Project (MSPDI) XML (BACKLOG-0000950):
311
+ * tasks, dependencies, constraints, baseline, resources and assignments, plus
312
+ * the working-time calendar, serialised with the computed schedule.
313
+ */
314
+ toMSPDI(xmlOpts?: { hoursPerDay?: number; projectName?: string }): string;
315
+ /**
316
+ * The live consumer surface, mirroring `grid.rows.apply`, so a Data Router
317
+ * can drive the Gantt like any other view. Keyed by the controller's rowKey.
318
+ */
319
+ readonly rows: {
320
+ apply(change: { add?: GanttTask[]; update?: GanttTask[]; remove?: Array<string | GanttTask> }): {
321
+ added: GanttTask[]; updated: GanttTask[]; removed: string[];
322
+ };
323
+ };
324
+ on(event: 'schedule' | 'error', fn: (payload: unknown) => void): () => void;
325
+ off(event: 'schedule' | 'error', fn: (payload: unknown) => void): void;
326
+ /**
327
+ * Render the plan into a container as an SVG timeline (bars, dependency
328
+ * arrows, critical-path highlight, today line, non-working shading,
329
+ * milestones, progress). The view redraws when the schedule recomputes.
330
+ */
331
+ mount(container: unknown, options?: {
332
+ /**
333
+ * The plot width. `'container'` (the default) measures the element it was
334
+ * mounted into and keeps following it, so a plan in a tab, drawer,
335
+ * accordion or split pane fits without the host writing a
336
+ * `ResizeObserver` (BACKLOG-0001079); a container with no box yet holds a
337
+ * 720px fallback rather than drawing at zero. A number is honoured
338
+ * exactly and installs no observer. Ignored under `zoom`, which warns.
339
+ */
340
+ width?: number | 'container';
341
+ rowHeight?: number;
342
+ labelWidth?: number;
343
+ rowLabels?: boolean;
344
+ showArrows?: boolean;
345
+ showCritical?: boolean;
346
+ showProgress?: boolean;
347
+ dateAxis?: boolean;
348
+ /**
349
+ * The today line, as a plan day-number or a calendar date. A date is
350
+ * converted into plan space through `projectEpoch` (BACKLOG-0001079), so
351
+ * "put the line on the real today" is expressible for a relative plan.
352
+ */
353
+ today?: number | string | Date;
354
+ /**
355
+ * The calendar date plan day 0 stands for (BACKLOG-0001079).
356
+ *
357
+ * Display-only: axis ticks, bar labels, tooltips, screen-reader text and
358
+ * the built-in `'weekends'` shading move with it; the schedule, `getState`
359
+ * and the CSV/MSPDI exports do not. Without it, the engine's contract makes
360
+ * day 0 the Unix epoch, which is why a plan written as day offsets renders
361
+ * as January 1970. A host-supplied `nonWorking` function still receives raw
362
+ * plan days.
363
+ */
364
+ projectEpoch?: number | string | Date | null;
365
+ nonWorking?: 'weekends' | ((day: number) => boolean);
366
+ label?: 'name' | 'percent' | 'dates' | 'none' | ((task: GanttScheduledTask) => string);
367
+ /** Whether bars can be dragged to move/resize (default true). */
368
+ editable?: boolean;
369
+ /** Pixels from a bar's right edge that begin a resize rather than a move. */
370
+ resizeZone?: number;
371
+ /** Time-scale zoom: a level, or raw pixels-per-day. Omit to fit the width. */
372
+ zoom?: 'day' | 'week' | 'month' | 'quarter' | number;
373
+ /** Scroll so the today line is in view after drawing. */
374
+ scrollToToday?: boolean;
375
+ /** Show a hover tooltip (dates/duration/%/slack); default true. */
376
+ tooltip?: boolean;
377
+ /** Group tasks into swimlanes by a task property name or `fn(task)`. */
378
+ groupBy?: string | ((task: GanttTask) => unknown);
379
+ /** Keyboard editing + focusable bars + ARIA announcements (default true). */
380
+ keyboard?: boolean;
381
+ /** Days a keyboard arrow moves/resizes a task (default 1). */
382
+ moveStep?: number;
383
+ }): unknown;
384
+ /**
385
+ * Mount the JOINED split view (BACKLOG-0000938): one continuous, row-aligned
386
+ * surface with a left task-grid panel (Task Name tree with expand/collapse,
387
+ * assignee avatars, a circular % ring, plus any host columns) and the right
388
+ * timeline, sharing a single vertical scroll so every grid row lines up
389
+ * exactly with its bar row. The timeline scrolls horizontally on its own.
390
+ * Composes the controller's schedule; makes no change to grid core.
391
+ */
392
+ mountSplit(container: unknown, options?: {
393
+ height?: number;
394
+ rowHeight?: number;
395
+ headerHeight?: number;
396
+ gridWidth?: number;
397
+ indent?: number;
398
+ zoom?: 'day' | 'week' | 'month' | 'quarter' | number;
399
+ today?: number;
400
+ nonWorking?: 'weekends' | ((day: number) => boolean);
401
+ calendar?: GanttCalendar | null;
402
+ showArrows?: boolean;
403
+ showProgress?: boolean;
404
+ showBaseline?: boolean;
405
+ barLabel?: 'name' | 'percent' | 'dates' | 'none' | ((task: GanttScheduledTask) => string);
406
+ /**
407
+ * Surface earned-value metrics in `kind: 'evm'` columns (BACKLOG-0000958).
408
+ * `true` computes EVM at the today line (or the project finish); an object
409
+ * overrides the status date and the cost field names.
410
+ */
411
+ evm?: boolean | { statusDate?: number | string | Date; costField?: string; actualCostField?: string };
412
+ columns?: Array<{ key: string; title?: string; width?: number; kind?: 'name' | 'assignee' | 'progress' | 'evm'; metric?: 'bac' | 'pv' | 'ev' | 'ac' | 'sv' | 'cv' | 'spi' | 'cpi'; digits?: number; render?: (task: GanttScheduledTask, ctx: { rawTask: GanttTask; depth: number }) => unknown }>;
413
+ }): unknown;
414
+ /**
415
+ * Capture a baseline (planned) snapshot of the current schedule as HOST data
416
+ * (this does not mutate the tasks). Store it and feed it back as
417
+ * `baselineStart`/`baselineEnd` task fields to get variance and ghost bars.
418
+ */
419
+ captureBaseline(): Array<{ id: string; baselineStart: number; baselineEnd: number; baselineDuration: number }>;
420
+ /**
421
+ * Compute earned-value (EVM) metrics for the current plan at a status date
422
+ * (BACKLOG-0000958): PV/EV/AC and the derived SV/CV/SPI/CPI per task, rolled
423
+ * up to summaries and the project. Budget (BAC) is the task's `cost`, or its
424
+ * duration when no cost is given; AC comes from `actualCost`.
425
+ */
426
+ earnedValue(evmOpts?: { statusDate?: number | string | Date; costField?: string; actualCostField?: string }): GanttEarnedValue;
427
+ /** Detach the mounted view, if any. The host still owns the container. */
428
+ unmount(): void;
429
+ /** The mounted view, or null. */
430
+ readonly view: unknown;
431
+ destroy(): void;
432
+ }
433
+
434
+ /**
435
+ * Create a Gantt controller over a task list and a dependency list. Computes
436
+ * the CPM schedule immediately and again on every `setTasks`/`setDependencies`/
437
+ * `applyEdit`, emitting `schedule` on success and `error` on a cycle or bad
438
+ * input. `grid` is stored for the write-back binding; `autoSchedule` requests
439
+ * dependent cascading.
440
+ */
441
+ export function createGantt(opts?: {
442
+ tasks?: GanttTask[];
443
+ dependencies?: GanttDependency[];
444
+ /** The schedule anchor: a day-number, ISO date string or Date. It only sets the floor a task with no predecessor starts on; it does not change how the schedule is computed. */
445
+ projectStart?: number | string | Date;
446
+ /** A project deadline (a day-number, ISO string or Date); tasks that cannot meet it get negative float. */
447
+ deadline?: number | string | Date;
448
+ /** A working-time calendar: skip weekends/holidays, durations in working days. */
449
+ calendar?: GanttCalendar | null;
450
+ /** Resource capacities for over-allocation detection and leveling (BACKLOG-0000948). */
451
+ resources?: GanttResourceSpec;
452
+ /** The capacity for a resource with none stated (default 1 = one full-time booking). */
453
+ defaultCapacity?: number;
454
+ autoSchedule?: boolean;
455
+ grid?: unknown;
456
+ /** Map task fields to grid column ids to enable drag write-back. */
457
+ columns?: { start?: string; end?: string; duration?: string };
458
+ /** Task identity for the live `rows.apply` surface (a field or fn); default 'id'. */
459
+ rowKey?: string | ((row: GanttTask) => unknown);
460
+ /**
461
+ * The host's own names for the task properties the scheduler reads, so a
462
+ * plan can be fed as it already exists rather than renamed for the Gantt:
463
+ * `{ id: 'taskId', start: 'startDate', name: 'jobName' }`. Each value is a
464
+ * field name or a reader `(row) => value`; anything unmapped reads its
465
+ * canonical name. The vocabulary is `id`, `name`, `start`, `end`,
466
+ * `duration`, `milestone`, `percentComplete`, `parent`, `baselineStart`,
467
+ * `baselineEnd`, `constraint`, `constraintDate`.
468
+ *
469
+ * `rowKey` also reaches the scheduler now: a task with no `id` of its own
470
+ * is identified by whatever `rowKey` names, which it previously was not —
471
+ * such a plan was keyed correctly by `rows.apply` and then refused to
472
+ * schedule.
473
+ *
474
+ * This is a READ mapping. `applyEdit` and `level()` write the canonical
475
+ * property, so each says so rather than writing where nothing reads;
476
+ * `assignee`, `cost` and `actualCost` belong to the resource and
477
+ * earned-value layers and are not mapped.
478
+ */
479
+ fields?: Record<string, string | ((row: GanttTask) => unknown)>;
480
+ /** Auto-mount into this element at construction. */
481
+ element?: unknown;
482
+ }): Gantt;
483
+ export default createGantt;
484
+
485
+ /** The model {@link importMSPDI} returns and {@link exportMSPDI} takes. */
486
+ interface GanttMSPDIModel {
487
+ tasks: GanttTask[];
488
+ dependencies?: GanttDependency[];
489
+ resources?: GanttResourceSpec;
490
+ projectStart?: number | string | Date;
491
+ calendar?: GanttCalendar | null;
492
+ schedule?: GanttSchedule;
493
+ }
494
+
495
+ /**
496
+ * Import a Microsoft Project (MSPDI) XML document (BACKLOG-0000950) into the
497
+ * module's model: the task tree, typed dependencies with lag, constraints,
498
+ * baseline, %complete, resources with capacity, the resource assignments, and
499
+ * the working-time calendar. The result is ready to pass to {@link createGantt}.
500
+ */
501
+ export function importMSPDI(xml: string, opts?: { hoursPerDay?: number }): {
502
+ ok: boolean;
503
+ error?: string;
504
+ tasks: GanttTask[];
505
+ dependencies: GanttDependency[];
506
+ resources: Array<{ id: string; name: string; capacity: number }>;
507
+ projectStart?: number;
508
+ calendar?: null | { workdays: number[]; holidays: number[] };
509
+ };
510
+
511
+ /**
512
+ * Export a Gantt model to Microsoft Project (MSPDI) XML (BACKLOG-0000950). A
513
+ * scheduled model may be passed so start/finish dates are the computed ones.
514
+ */
515
+ export function exportMSPDI(model: GanttMSPDIModel, opts?: { hoursPerDay?: number; projectName?: string }): string;