@eightkk/vue-weave 0.0.0-stage → 1.0.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 (81) hide show
  1. package/CHANGELOG.md +517 -0
  2. package/CONTRIBUTING.md +123 -0
  3. package/LICENSE +21 -0
  4. package/README.ja.md +275 -0
  5. package/README.md +272 -2
  6. package/THIRD_PARTY_NOTICES.md +25 -0
  7. package/dist/core-BH5rTsKp.js +13606 -0
  8. package/dist/core.js +1 -0
  9. package/dist/index.js +8022 -0
  10. package/dist/style.css +2 -0
  11. package/dist/types/components/GanttChart.vue.d.ts +339 -0
  12. package/dist/types/components/NetworkGraph.vue.d.ts +252 -0
  13. package/dist/types/components/types.d.ts +27 -0
  14. package/dist/types/composables/useAsyncGraphLayout.d.ts +163 -0
  15. package/dist/types/composables/useEditHistory.d.ts +13 -0
  16. package/dist/types/composables/useEditTransaction.d.ts +46 -0
  17. package/dist/types/composables/useLinkedSelection.d.ts +118 -0
  18. package/dist/types/composables/useTimelineView.d.ts +24 -0
  19. package/dist/types/composables/useWindowedData.d.ts +83 -0
  20. package/dist/types/core/actuals.d.ts +170 -0
  21. package/dist/types/core/calendarFormat.d.ts +65 -0
  22. package/dist/types/core/editTransaction.d.ts +96 -0
  23. package/dist/types/core/exportSvg.d.ts +236 -0
  24. package/dist/types/core/fieldEditing.d.ts +114 -0
  25. package/dist/types/core/graph.d.ts +196 -0
  26. package/dist/types/core/graphAlgorithms.d.ts +51 -0
  27. package/dist/types/core/graphAnalysis.d.ts +96 -0
  28. package/dist/types/core/graphCollapse.d.ts +62 -0
  29. package/dist/types/core/graphCrossings.d.ts +25 -0
  30. package/dist/types/core/graphEditing.d.ts +52 -0
  31. package/dist/types/core/graphExpansion.d.ts +71 -0
  32. package/dist/types/core/graphFlow.d.ts +184 -0
  33. package/dist/types/core/graphForce.d.ts +29 -0
  34. package/dist/types/core/graphGeometry.d.ts +31 -0
  35. package/dist/types/core/graphIncremental.d.ts +93 -0
  36. package/dist/types/core/graphLasso.d.ts +15 -0
  37. package/dist/types/core/graphLayoutRequests.d.ts +218 -0
  38. package/dist/types/core/graphLayouts.d.ts +81 -0
  39. package/dist/types/core/graphObstacleRouting.d.ts +68 -0
  40. package/dist/types/core/graphPortRules.d.ts +111 -0
  41. package/dist/types/core/graphRouting.d.ts +84 -0
  42. package/dist/types/core/graphSnapping.d.ts +34 -0
  43. package/dist/types/core/graphSpatial.d.ts +49 -0
  44. package/dist/types/core/graphSwimlanes.d.ts +77 -0
  45. package/dist/types/core/graphTraversal.d.ts +51 -0
  46. package/dist/types/core/graphView.d.ts +73 -0
  47. package/dist/types/core/index.d.ts +75 -0
  48. package/dist/types/core/interchange.d.ts +6 -0
  49. package/dist/types/core/interchangeCsv.d.ts +75 -0
  50. package/dist/types/core/interchangeICalendar.d.ts +111 -0
  51. package/dist/types/core/interchangeMsProject.d.ts +339 -0
  52. package/dist/types/core/leveling.d.ts +57 -0
  53. package/dist/types/core/pert.d.ts +62 -0
  54. package/dist/types/core/placement.d.ts +100 -0
  55. package/dist/types/core/planComparison.d.ts +275 -0
  56. package/dist/types/core/resourceLoad.d.ts +65 -0
  57. package/dist/types/core/resourceTimeline.d.ts +179 -0
  58. package/dist/types/core/rowHierarchy.d.ts +25 -0
  59. package/dist/types/core/scheduleDiagnostics.d.ts +37 -0
  60. package/dist/types/core/scheduleModel.d.ts +187 -0
  61. package/dist/types/core/scheduleTrace.d.ts +118 -0
  62. package/dist/types/core/scheduling.d.ts +194 -0
  63. package/dist/types/core/snapshot.d.ts +388 -0
  64. package/dist/types/core/statusDate.d.ts +36 -0
  65. package/dist/types/core/timeRangeTargets.d.ts +67 -0
  66. package/dist/types/core/timeline.d.ts +194 -0
  67. package/dist/types/core/timelineView.d.ts +101 -0
  68. package/dist/types/core/types.d.ts +783 -0
  69. package/dist/types/core/viewBindings.d.ts +112 -0
  70. package/dist/types/core/windowedData.d.ts +255 -0
  71. package/dist/types/core/workCalendar.d.ts +41 -0
  72. package/dist/types/core/workingTimeScale.d.ts +33 -0
  73. package/dist/types/index.d.ts +52 -0
  74. package/docs/api.md +1989 -0
  75. package/docs/architecture.md +112 -0
  76. package/docs/code-of-conduct.md +24 -0
  77. package/docs/integration.md +931 -0
  78. package/docs/scheduling.md +586 -0
  79. package/docs/security.md +26 -0
  80. package/docs/third-party-licenses.md +33 -0
  81. package/package.json +79 -4
@@ -0,0 +1,388 @@
1
+ import type { GraphEdge, GraphNodeSize, GraphPoint } from './graph.js';
2
+ import type { LevelResourcesInput } from './leveling.js';
3
+ import type { ScheduleResult } from './scheduling.js';
4
+ import type { TimeRange } from './timeline.js';
5
+ import type { ChartTone, GraphLayoutFunction, NetworkGroup, NetworkNode, TimelineBar, TimelineColumn, TimelineDependency, TimelineRow } from './types.js';
6
+ /** A value that survives `JSON.stringify` and `JSON.parse` unchanged. */
7
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
8
+ readonly [key: string]: JsonValue;
9
+ };
10
+ export type SnapshotKind = 'graph' | 'timeline' | 'planning';
11
+ export type SnapshotDiagnosticSeverity = 'error' | 'warning';
12
+ /**
13
+ * `syntax`: not JSON. `version`: unsupported or unmigratable schema version. `structure`: a missing, mistyped,
14
+ * out-of-range or unknown field. `reference`: an ID that names nothing. `duplicate`: an ID, Map entry or assignment pair
15
+ * listed twice. `number`: NaN or Infinity. `json`: a value that is not JSON and has no codec. `codec` and `registry`:
16
+ * a codec or registered name that is not available. `migration`: a migration failed. The `schedule-*` codes are
17
+ * warnings about a plan that is valid input but cannot be scheduled.
18
+ */
19
+ export type SnapshotDiagnosticCode = 'syntax' | 'version' | 'migration' | 'structure' | 'reference' | 'duplicate' | 'number' | 'json' | 'codec' | 'registry' | 'schedule-cycle' | 'schedule-infeasible';
20
+ export interface SnapshotDiagnostic {
21
+ severity: SnapshotDiagnosticSeverity;
22
+ code: SnapshotDiagnosticCode;
23
+ /** Where the finding is, for example `data.positions[2]`. Empty for the whole document. */
24
+ path: string;
25
+ message: string;
26
+ }
27
+ /**
28
+ * Stores values that JSON cannot represent (Date, BigInt, Map...) in application data. The stored form is
29
+ * `{ "$codec": id, "version": n, "value": ... }`. Serializing needs `matches` and `encode`; restoring needs `decode`.
30
+ */
31
+ export interface SnapshotCodec<T = any> {
32
+ id: string;
33
+ /** Version written with each value, passed to `decode` on restore. Defaults to 1. */
34
+ version?: number;
35
+ matches?: (value: unknown) => boolean;
36
+ encode?: (value: T) => JsonValue;
37
+ decode?: (value: JsonValue, version: number) => T;
38
+ }
39
+ export interface SnapshotMetadata {
40
+ title?: string;
41
+ /** ISO 8601 date and time. Pass it yourself; nothing reads the clock, so a fixed value gives reproducible output. */
42
+ savedAt?: string;
43
+ /** A reference to the source the snapshot was taken from. It is not the current version of any server. */
44
+ sourceVersion?: string;
45
+ }
46
+ export interface GraphSnapshotData {
47
+ nodes: readonly NetworkNode[];
48
+ edges: readonly GraphEdge[];
49
+ groups?: readonly NetworkGroup[];
50
+ /** Saved node positions as `[nodeId, point]` entries. */
51
+ positions?: readonly (readonly [string, GraphPoint])[];
52
+ /** Saved node sizes as `[nodeId, size]` entries. */
53
+ sizes?: readonly (readonly [string, GraphNodeSize])[];
54
+ }
55
+ export interface TimelineSnapshotData {
56
+ rows: readonly TimelineRow[];
57
+ bars: readonly TimelineBar[];
58
+ dependencies?: readonly TimelineDependency[];
59
+ range?: TimeRange;
60
+ /** Omitted means epoch milliseconds. Otherwise the ID of the unit and the time of its zero. */
61
+ timeUnit?: {
62
+ id: string;
63
+ origin?: number;
64
+ };
65
+ }
66
+ /** A task shown on a resource row. Each placement needs the assignment of the same task and resource. */
67
+ export interface PlanningPlacement {
68
+ taskId: string;
69
+ resourceId: string;
70
+ }
71
+ /** Display name, kind and application data of a task, kept by task ID. */
72
+ export interface PlanningTaskDisplay {
73
+ taskId: string;
74
+ label?: string;
75
+ detail?: string;
76
+ tone?: ChartTone;
77
+ data?: unknown;
78
+ }
79
+ /** The input of `levelResources`, plus the placement state and display attributes of the tasks. */
80
+ export interface PlanningSnapshotData extends LevelResourcesInput {
81
+ placements?: readonly PlanningPlacement[];
82
+ display?: readonly PlanningTaskDisplay[];
83
+ }
84
+ /** A graph camera that does not depend on the container size: the graph point at the viewport center and the scale. */
85
+ export interface GraphCameraTarget {
86
+ center: GraphPoint;
87
+ scale: number;
88
+ }
89
+ export interface GraphSnapshotView {
90
+ camera?: GraphCameraTarget;
91
+ collapsedGroupIds?: readonly string[];
92
+ /** A registered layout and its declarative options. */
93
+ layout?: {
94
+ id: string;
95
+ options?: {
96
+ readonly [key: string]: JsonValue;
97
+ };
98
+ };
99
+ }
100
+ export interface SnapshotColumnState {
101
+ /** The column ID; `'$label'` is the row label column. */
102
+ id: string;
103
+ /** The registry name that supplies the column's functions. Defaults to `id`. */
104
+ registryId?: string;
105
+ /** Defaults to true. */
106
+ visible?: boolean;
107
+ width?: number;
108
+ editorId?: string;
109
+ rendererId?: string;
110
+ }
111
+ export interface SnapshotSortRule {
112
+ columnId: string;
113
+ direction: 'asc' | 'desc';
114
+ /** A registered comparator. Omitted means the default comparison. */
115
+ comparatorId?: string;
116
+ }
117
+ export interface TimelineSnapshotView {
118
+ window?: TimeRange;
119
+ scroll?: {
120
+ time?: number;
121
+ rowId?: string;
122
+ };
123
+ zoom?: {
124
+ zoom: number;
125
+ preset?: string;
126
+ };
127
+ /** Columns in display order. */
128
+ columns?: readonly SnapshotColumnState[];
129
+ search?: {
130
+ query: string;
131
+ columnIds?: readonly string[];
132
+ };
133
+ sort?: readonly SnapshotSortRule[];
134
+ collapsedRowIds?: readonly string[];
135
+ }
136
+ interface SnapshotBase {
137
+ schemaVersion: 1;
138
+ libraryVersion?: string;
139
+ metadata?: SnapshotMetadata;
140
+ extensions?: {
141
+ readonly [namespace: string]: JsonValue;
142
+ };
143
+ }
144
+ export interface GraphSnapshotV1 extends SnapshotBase {
145
+ kind: 'graph';
146
+ data: GraphSnapshotData;
147
+ view?: {
148
+ graph?: GraphSnapshotView;
149
+ };
150
+ }
151
+ export interface TimelineSnapshotV1 extends SnapshotBase {
152
+ kind: 'timeline';
153
+ data: TimelineSnapshotData;
154
+ view?: {
155
+ timeline?: TimelineSnapshotView;
156
+ };
157
+ }
158
+ export interface PlanningSnapshotV1 extends SnapshotBase {
159
+ kind: 'planning';
160
+ data: PlanningSnapshotData;
161
+ view?: {
162
+ timeline?: TimelineSnapshotView;
163
+ };
164
+ }
165
+ /** The stored form of a snapshot, as written by `serializeWeaveSnapshot` and returned by `parseWeaveSnapshot`. */
166
+ export type WeaveSnapshotV1 = GraphSnapshotV1 | TimelineSnapshotV1 | PlanningSnapshotV1;
167
+ export interface GraphSnapshotInput {
168
+ kind: 'graph';
169
+ data: Omit<GraphSnapshotData, 'positions' | 'sizes'> & {
170
+ positions?: ReadonlyMap<string, GraphPoint>;
171
+ sizes?: ReadonlyMap<string, GraphNodeSize>;
172
+ };
173
+ view?: {
174
+ graph?: Omit<GraphSnapshotView, 'collapsedGroupIds'> & {
175
+ collapsedGroupIds?: ReadonlySet<string>;
176
+ };
177
+ };
178
+ metadata?: SnapshotMetadata;
179
+ extensions?: {
180
+ readonly [namespace: string]: unknown;
181
+ };
182
+ }
183
+ export interface TimelineSnapshotInput {
184
+ kind: 'timeline';
185
+ data: TimelineSnapshotData;
186
+ view?: {
187
+ timeline?: Omit<TimelineSnapshotView, 'collapsedRowIds'> & {
188
+ collapsedRowIds?: ReadonlySet<string>;
189
+ };
190
+ };
191
+ metadata?: SnapshotMetadata;
192
+ extensions?: {
193
+ readonly [namespace: string]: unknown;
194
+ };
195
+ }
196
+ export interface PlanningSnapshotInput {
197
+ kind: 'planning';
198
+ data: PlanningSnapshotData;
199
+ view?: {
200
+ timeline?: Omit<TimelineSnapshotView, 'collapsedRowIds'> & {
201
+ collapsedRowIds?: ReadonlySet<string>;
202
+ };
203
+ };
204
+ metadata?: SnapshotMetadata;
205
+ extensions?: {
206
+ readonly [namespace: string]: unknown;
207
+ };
208
+ }
209
+ /** What `serializeWeaveSnapshot` takes: Maps and Sets where the stored form has entries and arrays. */
210
+ export type WeaveSnapshotInput = GraphSnapshotInput | TimelineSnapshotInput | PlanningSnapshotInput;
211
+ /** Thrown by `serializeWeaveSnapshot` for input that cannot be stored. */
212
+ export declare class WeaveSnapshotError extends Error {
213
+ readonly diagnostics: readonly SnapshotDiagnostic[];
214
+ constructor(diagnostics: readonly SnapshotDiagnostic[]);
215
+ }
216
+ export interface SerializeWeaveSnapshotOptions {
217
+ /** Codecs for application data that is not JSON. */
218
+ codecs?: readonly SnapshotCodec[];
219
+ /** Recorded as `libraryVersion`. The core does not know the package version, so the caller supplies it. */
220
+ libraryVersion?: string;
221
+ /** Indentation of the JSON text, as in `JSON.stringify`. Defaults to compact output. */
222
+ space?: number | string;
223
+ }
224
+ /**
225
+ * Convert `input` to the stored form, validate it and return the JSON text. Output is deterministic: key order is fixed
226
+ * for the document and kept for your own records, Sets are written sorted, and nothing reads the clock (set
227
+ * `metadata.savedAt` yourself). Throws `WeaveSnapshotError` for NaN or Infinity, functions and other non-JSON values
228
+ * without a codec, duplicate IDs, unknown references and every other violation `parseWeaveSnapshot` reports; nothing is
229
+ * silently dropped. Does not mutate `input`.
230
+ */
231
+ export declare function serializeWeaveSnapshot(input: WeaveSnapshotInput, options?: SerializeWeaveSnapshotOptions): string;
232
+ /**
233
+ * Upgrades a document of an older schema version to the next one. It receives the parsed JSON and returns the migrated
234
+ * document, whose `schemaVersion` must be higher.
235
+ */
236
+ export type SnapshotMigration = (document: {
237
+ readonly [key: string]: JsonValue;
238
+ }) => unknown;
239
+ export interface ParseWeaveSnapshotOptions {
240
+ /**
241
+ * Migrations by the schema version they start from. The parser applies them one after another until the document
242
+ * reaches the current version (1). There is no global registry; pass what your application needs. Without a migration
243
+ * for a document's version, parsing fails.
244
+ */
245
+ migrations?: Readonly<Record<number, SnapshotMigration>>;
246
+ }
247
+ export type ParseWeaveSnapshotResult = {
248
+ ok: true;
249
+ snapshot: WeaveSnapshotV1;
250
+ diagnostics: readonly SnapshotDiagnostic[];
251
+ } | {
252
+ ok: false;
253
+ diagnostics: readonly SnapshotDiagnostic[];
254
+ };
255
+ /**
256
+ * Check JSON text and return a typed snapshot. Checks, in order: JSON syntax, schema version (applying the supplied
257
+ * migrations), field types and ranges, duplicate IDs, references, scheduling input of planning data, and references of
258
+ * the saved view. Codec values stay encoded and registry names stay unresolved; `restoreWeaveSnapshot` does both. A
259
+ * snapshot is returned only when there is no error; warnings (for example a dependency cycle in a plan) come with it.
260
+ * Never throws for bad input. Repeated JSON keys are read as the last one, as `JSON.parse` does.
261
+ */
262
+ export declare function parseWeaveSnapshot(text: string, options?: ParseWeaveSnapshotOptions): ParseWeaveSnapshotResult;
263
+ export type SnapshotLayoutFactory = (options: {
264
+ readonly [key: string]: JsonValue;
265
+ } | undefined) => GraphLayoutFunction;
266
+ /** What a registered column supplies. `width` is the default when the snapshot has none. */
267
+ export type SnapshotColumnDefinition = Omit<TimelineColumn, 'id' | 'width'> & {
268
+ width?: number;
269
+ };
270
+ /** Application-side names that a snapshot refers to. Functions are never stored in JSON. */
271
+ export interface WeaveSnapshotRegistry {
272
+ codecs?: readonly SnapshotCodec[];
273
+ layouts?: Readonly<Record<string, SnapshotLayoutFactory>>;
274
+ /** Column functions by column ID (or `registryId`). Columns not named by the snapshot are appended, visible. */
275
+ columns?: Readonly<Record<string, SnapshotColumnDefinition>>;
276
+ editors?: Readonly<Record<string, unknown>>;
277
+ renderers?: Readonly<Record<string, unknown>>;
278
+ comparators?: Readonly<Record<string, (a: unknown, b: unknown) => number>>;
279
+ /**
280
+ * What to do when a layout, column, editor, renderer or comparator name is not registered. `'fail'` (the default)
281
+ * fails the restore. `'fallback'` keeps a warning and drops the item, so the default display is used. A missing codec
282
+ * always fails.
283
+ */
284
+ onMissing?: 'fail' | 'fallback';
285
+ }
286
+ export interface RestoredColumn {
287
+ id: string;
288
+ visible: boolean;
289
+ width: number;
290
+ /** Absent for the label column. */
291
+ column?: TimelineColumn;
292
+ editor?: unknown;
293
+ renderer?: unknown;
294
+ }
295
+ export interface RestoredSortRule {
296
+ columnId: string;
297
+ direction: 'asc' | 'desc';
298
+ comparator?: (a: unknown, b: unknown) => number;
299
+ }
300
+ export interface RestoredGraphView {
301
+ camera?: GraphCameraTarget;
302
+ collapsedGroupIds: Set<string>;
303
+ layout?: {
304
+ id: string;
305
+ options?: {
306
+ readonly [key: string]: JsonValue;
307
+ };
308
+ fn: GraphLayoutFunction;
309
+ };
310
+ }
311
+ export interface RestoredTimelineView {
312
+ window?: TimeRange;
313
+ scroll?: {
314
+ time?: number;
315
+ rowId?: string;
316
+ };
317
+ zoom?: {
318
+ zoom: number;
319
+ preset?: string;
320
+ };
321
+ /** Present when the snapshot recorded columns. */
322
+ columns?: RestoredColumn[];
323
+ search?: {
324
+ query: string;
325
+ columnIds?: string[];
326
+ };
327
+ sort: RestoredSortRule[];
328
+ collapsedRowIds: Set<string>;
329
+ }
330
+ interface RestoredBase {
331
+ metadata?: SnapshotMetadata;
332
+ libraryVersion?: string;
333
+ extensions?: {
334
+ [namespace: string]: unknown;
335
+ };
336
+ }
337
+ export interface RestoredGraphSnapshot extends RestoredBase {
338
+ kind: 'graph';
339
+ nodes: NetworkNode[];
340
+ edges: GraphEdge[];
341
+ groups: NetworkGroup[];
342
+ positions: Map<string, GraphPoint>;
343
+ sizes: Map<string, GraphNodeSize>;
344
+ view?: RestoredGraphView;
345
+ }
346
+ export interface RestoredTimelineSnapshot extends RestoredBase {
347
+ kind: 'timeline';
348
+ rows: TimelineRow[];
349
+ bars: TimelineBar[];
350
+ dependencies: TimelineDependency[];
351
+ range?: TimeRange;
352
+ timeUnit?: {
353
+ id: string;
354
+ origin?: number;
355
+ };
356
+ view?: RestoredTimelineView;
357
+ }
358
+ export interface RestoredPlanningSnapshot extends RestoredBase {
359
+ kind: 'planning';
360
+ /** Pass it to `scheduleTasks`, `levelResources` and `calculateResourceLoad`. */
361
+ input: LevelResourcesInput;
362
+ placements: PlanningPlacement[];
363
+ display: PlanningTaskDisplay[];
364
+ /** `scheduleTasks(input)`, computed during the restore. A cycle or infeasible plan is a result, not a failure. */
365
+ schedule: ScheduleResult;
366
+ view?: RestoredTimelineView;
367
+ }
368
+ export type RestoredWeaveSnapshot = RestoredGraphSnapshot | RestoredTimelineSnapshot | RestoredPlanningSnapshot;
369
+ export type RestoreWeaveSnapshotResult = {
370
+ ok: true;
371
+ snapshot: RestoredWeaveSnapshot;
372
+ diagnostics: readonly SnapshotDiagnostic[];
373
+ } | {
374
+ ok: false;
375
+ diagnostics: readonly SnapshotDiagnostic[];
376
+ };
377
+ /**
378
+ * Turn a snapshot into live values: Maps and Sets, codec values decoded, registered layouts and column functions
379
+ * resolved. The snapshot is validated again, so a hand-built object is checked like parsed text. The result is
380
+ * all-or-nothing: on any error (an unknown codec, a missing required registration, an invalid reference) `ok` is false
381
+ * and no partial value is returned, so the current screen can stay as it is. Warnings come with a successful result.
382
+ * Does not mutate `snapshot` or `registry`.
383
+ *
384
+ * Apply a graph in this order: accept `nodes`, `edges`, `groups`, `positions`, `sizes` and `view.collapsedGroupIds`,
385
+ * wait for the DOM update (`nextTick`), then set the camera from `view.camera`.
386
+ */
387
+ export declare function restoreWeaveSnapshot(snapshot: WeaveSnapshotV1, registry?: WeaveSnapshotRegistry): RestoreWeaveSnapshotResult;
388
+ export {};
@@ -0,0 +1,36 @@
1
+ import { type ScheduleInput, type ScheduleResult } from './scheduling.js';
2
+ /**
3
+ * Reschedule a plan whose tasks have reported progress at a status date. The current dates are those of
4
+ * `scheduleTasks(input)`; when that fails, its failure is returned. Progress is the completed share of each task's
5
+ * working duration, from 0 to 1, and a task without an entry has progress 0. The rules:
6
+ *
7
+ * - Progress 1: the task keeps its current dates, even after the status date.
8
+ * - Progress between 0 and 1: the done work is `progress × duration` rounded down to whole quanta. It stays where it
9
+ * is, from the current start; when that would carry it past the status date (the task is ahead of plan or started
10
+ * early), it is placed instead so that it ends at the status date. The remaining work is scheduled at or after the
11
+ * status date on the task's calendar, so the task is split when time remains between the two parts; the result
12
+ * reports both parts in `work`. A task whose done work rounds down to zero, and a milestone, is treated as not
13
+ * started.
14
+ * - Progress 0: the task starts no earlier than the status date (in addition to its own bounds).
15
+ *
16
+ * A started or finished task is pinned at its start: `startNoEarlierThan`, `startNoLaterThan`, `fixedStart` and
17
+ * `mode` no longer apply, because its start has happened, and neither do incoming FS and SS dependencies, which bound
18
+ * the start. Incoming FF and SF dependencies, with their lag, still bound the finish of a partly done task: when its
19
+ * remaining work would finish too early, the remaining work resumes later, and the gap after the done work grows.
20
+ * A finished task ignores every incoming dependency. Finish bounds and outgoing dependencies still apply, so
21
+ * successors follow the new finish. A kept link that cannot be met, for example because the required finish lies
22
+ * after a `finishNoLaterThan`, the deadline or the horizon, makes the plan infeasible, and the failure names the
23
+ * link. Unstarted tasks keep every bound and dependency; a `fixedStart` before the status date then makes the plan
24
+ * infeasible, which is returned as such. Returns the result of scheduling the adjusted plan; the dependencies that
25
+ * no longer apply are left out of it, so they never appear in `criticalDependencyIds`. The input is not modified.
26
+ *
27
+ * Manual tasks keep their manual dates whatever their progress, and inactive tasks stay inactive; progress entries of
28
+ * both are accepted and have no effect. Summary tasks roll up from their subtasks; their progress entries are accepted
29
+ * and have no effect. A started subtask no longer inherits the start bounds of its summaries (links into a summary
30
+ * and its `startNoEarlierThan`), for the same reason as its own.
31
+ *
32
+ * Throws a RangeError for a status date that is not finite, outside `input.range` or not aligned with the quantum,
33
+ * a progress value outside 0..1 or a done share that does not fit before the status date, and an Error for a progress
34
+ * that is not a Map and a progress entry of an unknown task.
35
+ */
36
+ export declare function rescheduleFromStatusDate(input: ScheduleInput, statusDate: number, progress: ReadonlyMap<string, number>): ScheduleResult;
@@ -0,0 +1,67 @@
1
+ import type { GraphEdge } from './graph.js';
2
+ import { type GraphTraversalOptions } from './graphTraversal.js';
3
+ import type { TimeRange } from './timeline.js';
4
+ import type { TimelineBar } from './types.js';
5
+ import { type EntityRef, type ViewBindingIndex, type ViewTarget } from './viewBindings.js';
6
+ export interface TimelineBarsInRangeOptions {
7
+ /** Only bars in these rows are considered. Unknown row IDs match nothing. Default: every row. */
8
+ rowIds?: Iterable<string>;
9
+ }
10
+ /** The parts of a bar that `timelineBarsInRange` reads. */
11
+ export type TimelineBarActivity = Pick<TimelineBar, 'id' | 'rowId' | 'start' | 'end' | 'segments'>;
12
+ /**
13
+ * Returns the bars that are worked on in the half-open time range `[range.start, range.end)`, in input order. A bar with
14
+ * `segments` is active only when one of its work segments overlaps the range, so a pause (a gap between segments) that
15
+ * covers the whole range does not count; any other bar is active when its interval overlaps the range. A milestone
16
+ * (`start === end`) at time t is active when `range.start <= t < range.end`. An empty range (`start === end`) is an
17
+ * instant t: it matches work with `start <= t < end` and milestones at exactly t. `options.rowIds` restricts the result
18
+ * to bars of those rows. The times are not inferred from anything else, such as a graph. Throws RangeError for a range
19
+ * or bar time that is not finite or ends before it starts, and for invalid segments. The inputs are not modified.
20
+ */
21
+ export declare function timelineBarsInRange<B extends TimelineBarActivity>(bars: readonly B[], range: TimeRange, options?: TimelineBarsInRangeOptions): B[];
22
+ export interface TimeRangeTargetsOptions {
23
+ /**
24
+ * The graph to walk from the graph nodes of the active entities, for example the graph shown by NetworkGraph. Without
25
+ * it, or without `traversal`, nothing is related.
26
+ */
27
+ graph?: {
28
+ nodes: readonly {
29
+ id: string;
30
+ }[];
31
+ edges: readonly GraphEdge[];
32
+ };
33
+ /**
34
+ * How to find related entities, as for `traverseGraph`: `{ direction: 'forward' }` for all successors, `'backward'` for
35
+ * all predecessors, `'both'` for both, and `{ direction: 'both', maxHops: 1 }` for direct neighbours. `maxHops` limits
36
+ * the depth. Omit it to relate nothing.
37
+ */
38
+ traversal?: GraphTraversalOptions;
39
+ }
40
+ export interface TimeRangeTargets {
41
+ /** The given bar IDs, deduplicated, in input order. */
42
+ activeBarIds: string[];
43
+ /** Entities bound to the active bars, in discovery order. */
44
+ activeEntities: EntityRef[];
45
+ /**
46
+ * The active bars and every target bound to the active entities, without repeats. An active entity's targets in other
47
+ * views (its node, its load range, its other bars) are active too.
48
+ */
49
+ activeTargets: ViewTarget[];
50
+ /** Entities reached by the traversal that are not active, in discovery order. */
51
+ relatedEntities: EntityRef[];
52
+ /**
53
+ * Graph nodes and edges reached by the traversal and the targets bound to the related entities, without the active
54
+ * targets. Reached graph items with no binding are included as graph targets.
55
+ */
56
+ relatedTargets: ViewTarget[];
57
+ /** Active bar IDs that no binding reaches. They are still in `activeTargets`, but link to nothing. */
58
+ unknownBarIds: string[];
59
+ }
60
+ /**
61
+ * Turns active bars (for example from `timelineBarsInRange`) into the entities and view targets they stand for through
62
+ * `index`, and optionally walks `options.graph` from the active entities' graph nodes to find related entities. The two
63
+ * results stay apart: `active*` is what was worked on in the range, `related*` what the traversal reached besides. The
64
+ * walk is iterative and terminates on cycles. Throws like `traverseGraph` for invalid traversal options or graph edges.
65
+ * The inputs are not modified.
66
+ */
67
+ export declare function resolveTimeRangeTargets(index: ViewBindingIndex, barIds: Iterable<string>, options?: TimeRangeTargetsOptions): TimeRangeTargets;