Skip to content

Module Extensions

HTMLRevoGridElementEventMap (Extended from global)

ts
interface HTMLRevoGridElementEventMap {
  [GANTT_DEPENDENCY_HOVER_EVENT]: GanttDependencyInteractionDetail;
  [GANTT_DEPENDENCY_SELECT_EVENT]: GanttDependencyInteractionDetail;
  [GANTT_TASK_CREATE_EVENT]: GanttCreateTaskOptions | undefined;
  [GANTT_TASK_INDENT_EVENT]: GanttTaskHierarchyActionDetail | undefined;
  [GANTT_TASK_OUTDENT_EVENT]: GanttTaskHierarchyActionDetail | undefined;
  [GANTT_ZOOM_IN_EVENT]: undefined;
  [GANTT_ZOOM_OUT_EVENT]: undefined;
  [GANTT_ZOOM_SET_LEVEL_EVENT]: GanttZoomSetLevelDetail;
  [GANTT_PANEL_RESIZE_EVENT]: GanttPanelResizeEventDetail;
  [GANTT_BEFORE_TASK_CHANGE_EVENT]: GanttBeforeTaskChangeDetail;
  [GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT]: GanttBeforeDependencyChangeDetail;
  [GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT]: GanttBeforeAssignmentChangeDetail
}

HTMLRevoGridElement (Extended from global)

ts
interface HTMLRevoGridElement {
  gantt?: GanttPluginConfig;
  ganttDependencies?: readonly DependencyEntity[];
  ganttCalendars?: readonly CalendarEntity[];
  ganttResources?: readonly ResourceEntity[];
  ganttAssignments?: readonly AssignmentEntity[];
  ganttBaselines?: readonly BaselineSnapshot[];
  hideColumns?: readonly string[] | string
}

Plugin API

EntityId

Opaque string identifier used across all Gantt entities.

ts
/** Opaque string identifier used across all Gantt entities. */
export type EntityId =  string;

TaskId

Unique identifier for a task within a project.

ts
/** Unique identifier for a task within a project. */
export type TaskId =  EntityId;

DependencyId

Unique identifier for a dependency link between two tasks.

ts
/** Unique identifier for a dependency link between two tasks. */
export type DependencyId =  EntityId;

ResourceId

Unique identifier for a resource (person or equipment).

ts
/** Unique identifier for a resource (person or equipment). */
export type ResourceId =  EntityId;

AssignmentId

Unique identifier for a task–resource assignment.

ts
/** Unique identifier for a task–resource assignment. */
export type AssignmentId =  EntityId;

CalendarId

Unique identifier for a working calendar.

ts
/** Unique identifier for a working calendar. */
export type CalendarId =  EntityId;

BaselineId

Unique identifier for a baseline snapshot.

ts
/** Unique identifier for a baseline snapshot. */
export type BaselineId =  EntityId;

ISODateString

ISO 8601 date string in YYYY-MM-DD format.

ts
/** ISO 8601 date string in `YYYY-MM-DD` format. */
export type ISODateString =  `${number}-${number}-${number}`;

ISODateTimeString

ISO 8601 date-time string in YYYY-MM-DDThh:mm:ssZ format.

ts
/** ISO 8601 date-time string in `YYYY-MM-DDThh:mm:ssZ` format. */
export type ISODateTimeString =  `${number}-${number}-${number}T${string}`;

TaskType

Determines how a task is treated by the scheduling engine.

  • 'summary' — a parent task whose dates roll up from its children.
  • 'task' — a regular schedulable work item with its own duration.
  • 'milestone' — a zero-duration marker for a key date or deliverable.
ts
/**
 * Determines how a task is treated by the scheduling engine.
 * - `'summary'` — a parent task whose dates roll up from its children.
 * - `'task'` — a regular schedulable work item with its own duration.
 * - `'milestone'` — a zero-duration marker for a key date or deliverable.
 */
export type TaskType =  'summary' | 'task' | 'milestone';

TaskStatus

Tracks the current execution state of a task.

  • 'not-started' — work has not begun.
  • 'in-progress' — work is actively underway.
  • 'done' — work is complete.
  • 'blocked' — work is stalled by an external factor.
ts
/**
 * Tracks the current execution state of a task.
 * - `'not-started'` — work has not begun.
 * - `'in-progress'` — work is actively underway.
 * - `'done'` — work is complete.
 * - `'blocked'` — work is stalled by an external factor.
 */
export type TaskStatus =  'not-started' | 'in-progress' | 'done' | 'blocked';

DependencyType

Defines the logical relationship between a predecessor and successor task.

  • 'finish-to-start' (FS) — successor starts after predecessor finishes.
  • 'start-to-start' (SS) — successor starts when predecessor starts.
  • 'finish-to-finish' (FF) — successor finishes when predecessor finishes.
  • 'start-to-finish' (SF) — successor finishes when predecessor starts.
ts
/**
 * Defines the logical relationship between a predecessor and successor task.
 * - `'finish-to-start'` (FS) — successor starts after predecessor finishes.
 * - `'start-to-start'` (SS) — successor starts when predecessor starts.
 * - `'finish-to-finish'` (FF) — successor finishes when predecessor finishes.
 * - `'start-to-finish'` (SF) — successor finishes when predecessor starts.
 */
export type DependencyType = 
  | 'finish-to-start'
  | 'start-to-start'
  | 'finish-to-finish'
  | 'start-to-finish';

TaskConstraintType

Scheduling constraint applied to a task's start or finish date. The scheduler engine honours these constraints when computing the schedule.

ts
/**
 * Scheduling constraint applied to a task's start or finish date.
 * The scheduler engine honours these constraints when computing the schedule.
 */
export type TaskConstraintType = 
  | 'start-no-earlier-than'
  | 'start-no-later-than'
  | 'finish-no-earlier-than'
  | 'finish-no-later-than'
  | 'must-start-on'
  | 'must-finish-on';

TaskEntity

Represents a single task (work item) in the Gantt project. Tasks form a tree structure via {@link parentId} and are the primary data source for the Gantt timeline.

ts
interface TaskEntity {
  /** Unique task identifier. */
    readonly id: TaskId;
  /** Project this task belongs to. */
    readonly projectId: EntityId;
  /** Parent task id, or `null` for root-level tasks. */
    readonly parentId: TaskId | null;
  /** Work Breakdown Structure code (e.g. `"1.2.3"`). */
    readonly wbsCode: string;
  /** Human-readable task name. */
    readonly name: string;
  /** Determines scheduling behaviour — see {@link TaskType}. */
    readonly type: TaskType;
  /** Current execution state — see {@link TaskStatus}. */
    readonly status: TaskStatus;
  /** Planned start date (inclusive). */
    readonly startDate: ISODateString;
  /** Planned end date (inclusive). */
    readonly endDate: ISODateString;
  /** Duration in calendar days between start and end (inclusive). */
    readonly durationDays: number;
  /** When `true`, the scheduler will not auto-schedule this task. */
    readonly manuallyScheduled?: boolean;
  /** When `true`, the task is excluded from scheduling and critical-path analysis. */
    readonly inactive?: boolean;
  /** Optional scheduling constraint type — see {@link TaskConstraintType}. */
    readonly constraintType?: TaskConstraintType;
  /** Date associated with the scheduling constraint. */
    readonly constraintDate?: ISODateString;
  /** Deadline date — tasks finishing after this date are flagged. */
    readonly deadlineDate?: ISODateString;
  /** Completion percentage (0–100). */
    readonly progressPercent: number;
  /** Calendar governing working days and holidays for this task. */
    readonly calendarId: CalendarId;
  /** Whether this task lies on the critical path. */
    readonly isCritical: boolean;
  /** Optional free-text notes attached to the task. */
    readonly notes?: string;
  /** Arbitrary tags for categorisation or filtering. */
    readonly tags: readonly string[]
}

DependencyEntity

A directed link between two tasks that constrains their scheduling order. The scheduler uses dependencies to compute task start/end dates.

ts
interface DependencyEntity {
  /** Unique dependency identifier. */
    readonly id: DependencyId;
  /** The task that must complete (or start) first. */
    readonly predecessorTaskId: TaskId;
  /** The task whose schedule depends on the predecessor. */
    readonly successorTaskId: TaskId;
  /** Relationship type — see {@link DependencyType}. */
    readonly type: DependencyType;
  /** Lead (negative) or lag (positive) in calendar days applied to the link. */
    readonly lagDays: number
}

ResourceEntity

A person, team, or piece of equipment that can be assigned to tasks.

ts
interface ResourceEntity {
  /** Unique resource identifier. */
    readonly id: ResourceId;
  /** Display name of the resource. */
    readonly name: string;
  /** Role or job title. */
    readonly role: string;
  /** Working calendar for this resource. */
    readonly calendarId: CalendarId;
  /** Maximum allocation capacity (1.0 = 100 %). */
    readonly allocationCapacity: number;
  /** Cost per hour in the project currency. */
    readonly hourlyCost: number
}

AssignmentEntity

Links a {@link ResourceEntity} to a {@link TaskEntity}, representing the resource's involvement in that task.

ts
interface AssignmentEntity {
  /** Unique assignment identifier. */
    readonly id: AssignmentId;
  /** The task this assignment belongs to. */
    readonly taskId: TaskId;
  /** The resource assigned to the task. */
    readonly resourceId: ResourceId;
  /** Allocation units (1.0 = 100 % of the resource's capacity). */
    readonly allocationUnits: number;
  /** Description of what the resource is responsible for. */
    readonly responsibility: string
}

CalendarEntity

Defines the working schedule for tasks and resources. The scheduler uses calendars to determine which days count towards task duration.

ts
interface CalendarEntity {
  /** Unique calendar identifier. */
    readonly id: CalendarId;
  /** Display name (e.g. `"Standard"`, `"Night Shift"`). */
    readonly name: string;
  /** IANA time zone (e.g. `"America/New_York"`). */
    readonly timeZone: string;
  /** ISO weekday numbers that are working days (1 = Monday … 7 = Sunday). */
    readonly workingDays: readonly number[];
  /** Specific dates that are non-working regardless of weekday. */
    readonly holidays: readonly ISODateString[];
  /** Number of working hours per day, used for effort calculations. */
    readonly hoursPerDay: number
}

BaselineTaskSnapshot

A snapshot of a single task's dates at the time a baseline was captured. Used to compare planned vs. actual progress.

ts
interface BaselineTaskSnapshot {
  /** The task this snapshot refers to. */
    readonly taskId: TaskId;
  /** Baseline start date. */
    readonly startDate: ISODateString;
  /** Baseline end date. */
    readonly endDate: ISODateString;
  /** Baseline duration in days. */
    readonly durationDays: number;
  /** Baseline completion percentage. */
    readonly progressPercent: number
}

BaselineSnapshot

A point-in-time snapshot of the entire project schedule. Baselines allow users to track schedule drift over time.

ts
interface BaselineSnapshot {
  /** Unique baseline identifier. */
    readonly id: BaselineId;
  /** Human-readable baseline name (e.g. `"Sprint 1 Plan"`). */
    readonly name: string;
  /** When this baseline was captured. */
    readonly capturedAt: ISODateTimeString;
  /** Per-task snapshots at capture time. */
    readonly tasks: readonly BaselineTaskSnapshot[]
}

ProjectSnapshot

Complete state of the Gantt project at a single point in time. This is the primary input to the {@link GanttPlugin} — pass it via the grid's gantt, ganttDependencies, ganttCalendars, etc. properties.

ts
interface ProjectSnapshot {
  /** Project identifier. */
    readonly id: EntityId;
  /** Project name. */
    readonly name: string;
  /** Semantic version of the project data schema. */
    readonly version: string;
  /** Currency code used for cost calculations (e.g. `"USD"`). */
    readonly currency: string;
  /** Default IANA time zone for the project. */
    readonly timeZone: string;
  /** Calendar used by default for new tasks. */
    readonly primaryCalendarId: CalendarId;
  /** Timestamp of the last modification. */
    readonly updatedAt: ISODateTimeString;
  /** All tasks in the project. */
    readonly tasks: readonly TaskEntity[];
  /** All dependency links between tasks. */
    readonly dependencies: readonly DependencyEntity[];
  /** All available resources. */
    readonly resources: readonly ResourceEntity[];
  /** All task–resource assignments. */
    readonly assignments: readonly AssignmentEntity[];
  /** All working calendars. */
    readonly calendars: readonly CalendarEntity[];
  /** Historical baseline snapshots. */
    readonly baselines: readonly BaselineSnapshot[]
}

ResourceStore

Read/write store for {@link ResourceEntity} instances. Provides lookup by id and bulk replacement.

ts
interface ResourceStore {
  /** Returns all resources. */
    getAll(): readonly ResourceEntity[];
  /** Looks up a resource by its id. */
    getById(resourceId: ResourceId): ResourceEntity | undefined;
  /** Replaces the entire resource list. */
    replaceAll(resources: readonly ResourceEntity[]): void
}

AssignmentStore

Read/write store for {@link AssignmentEntity} instances. Maintains indexes for fast lookup by task or resource.

ts
interface AssignmentStore {
  /** Returns all assignments. */
    getAll(): readonly AssignmentEntity[];
  /** Looks up an assignment by its id. */
    getById(assignmentId: AssignmentId): AssignmentEntity | undefined;
  /** Returns all assignments for a given task. */
    getByTaskId(taskId: TaskId): readonly AssignmentEntity[];
  /** Returns all assignments for a given resource. */
    getByResourceId(resourceId: ResourceId): readonly AssignmentEntity[];
  /** Replaces the entire assignment list, rebuilding all indexes. */
    replaceAll(assignments: readonly AssignmentEntity[]): void;
  /** Replaces only the assignments for a specific task, keeping others intact. */
    replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentEntity[]): void
}

InMemoryResourceStore

Default in-memory implementation of {@link ResourceStore}.

ts
class InMemoryResourceStore {
  getAll(): readonly ResourceEntity[];

  getById(resourceId: ResourceId): ResourceEntity | undefined;

  replaceAll(resources: readonly ResourceEntity[]): void;
}

InMemoryAssignmentStore

Default in-memory implementation of {@link AssignmentStore}. Maintains by-id, by-task, and by-resource indexes that are rebuilt on every write operation.

ts
class InMemoryAssignmentStore {
  getAll(): readonly AssignmentEntity[];

  getById(assignmentId: AssignmentId): AssignmentEntity | undefined;

  getByTaskId(taskId: TaskId): readonly AssignmentEntity[];

  getByResourceId(resourceId: ResourceId): readonly AssignmentEntity[];

  replaceAll(assignments: readonly AssignmentEntity[]): void;

  replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentEntity[]): void;
}

TaskUpdate

Partial update payload for mutable fields of a {@link TaskEntity}. Only the listed properties may be changed via {@link TaskStore.updateTask}.

ts
/**
 * Partial update payload for mutable fields of a {@link TaskEntity}.
 * Only the listed properties may be changed via {@link TaskStore.updateTask}.
 */
export type TaskUpdate =  Partial<
  Pick<
    TaskEntity,
    | 'name'
    | 'startDate'
    | 'endDate'
    | 'durationDays'
    | 'progressPercent'
    | 'manuallyScheduled'
    | 'inactive'
    | 'constraintType'
    | 'constraintDate'
    | 'deadlineDate'
  >
>;

VisibleTaskRow

A task together with its position in the visible (flattened) tree. Produced by {@link TaskStore.getVisibleRows} after collapsing hidden branches.

ts
interface VisibleTaskRow {
  /** The underlying task entity. */
    readonly task: TaskEntity;
  /** Nesting depth (0 for root tasks). */
    readonly depth: number;
  /** Whether the task has child tasks. */
    readonly hasChildren: boolean;
  /** Whether the task's children are currently visible. */
    readonly isExpanded: boolean;
  /** Zero-based index in the visible row list. */
    readonly visibleIndex: number
}

TaskStore

Read/write store that manages the hierarchical task list. Handles parent–child relationships, expand/collapse state, selection, and incremental updates.

ts
interface TaskStore {
  /** Returns all tasks in insertion order. */
    getAll(): readonly TaskEntity[];
  /** Monotonically increasing revision counter bumped on every task data change. */
    getTaskRevision(): number;
  /** Monotonically increasing revision counter bumped when visible rows change. */
    getVisibleRowsRevision(): number;
  /** Returns every task as a {@link VisibleTaskRow}, ignoring collapse state. */
    getOrderedRows(): readonly VisibleTaskRow[];
  /** Looks up a task by its id. */
    getById(taskId: TaskId): TaskEntity | undefined;
  /** Returns top-level (root) tasks. */
    getRoots(): readonly TaskEntity[];
  /** Returns direct children of the given parent task. */
    getChildren(parentId: TaskId): readonly TaskEntity[];
  /** Returns the parent task, or `undefined` for root tasks. */
    getParent(taskId: TaskId): TaskEntity | undefined;
  /** Returns `true` if the task has at least one child. */
    hasChildren(taskId: TaskId): boolean;
  /** Returns `true` if the task's children are currently expanded. */
    isExpanded(taskId: TaskId): boolean;
  /** Toggles expand/collapse for the given task. Returns `true` if the state changed. */
    toggleExpanded(taskId: TaskId): boolean;
  /** Expands all tasks that have children. */
    expandAll(): void;
  /** Collapses all tasks. */
    collapseAll(): void;
  /** Returns the set of currently expanded task ids. */
    getExpandedTaskIds(): ReadonlySet<TaskId>;
  /** Replaces the entire expanded set with the given task ids. */
    replaceExpandedTaskIds(taskIds: Iterable<TaskId>): void;
  /** Returns only the tasks visible after applying expand/collapse state. */
    getVisibleRows(): readonly VisibleTaskRow[];
  /** Returns the nesting depth of a task in the tree hierarchy. */
    getIndentLevel(taskId: TaskId): number;
  /** Returns the zero-based index of a task in the visible row list, or `-1` if hidden. */
    getVisibleIndex(taskId: TaskId): number;
  /** Returns the currently selected task id, or `null`. */
    getSelectedTaskId(): TaskId | null;
  /** Selects a task (or clears selection with `null`). Returns `true` if changed. */
    selectTask(taskId: TaskId | null): boolean;
  /** Applies a partial update to a task and returns the updated entity. */
    updateTask(taskId: TaskId, patch: TaskUpdate): TaskEntity;
  /** Replaces the entire task list, rebuilding internal indexes. */
    replaceAll(tasks: readonly TaskEntity[]): void
}

InMemoryTaskStore

Default in-memory implementation of {@link TaskStore}. Maintains parent–child indexes, expand/collapse state, and a lazily computed visible-row cache.

ts
class InMemoryTaskStore {
  getAll(): readonly TaskEntity[];

  getTaskRevision(): number;

  getVisibleRowsRevision(): number;

  getById(taskId: TaskId): TaskEntity | undefined;

  getOrderedRows(): readonly VisibleTaskRow[];

  getRoots(): readonly TaskEntity[];

  getChildren(parentId: TaskId): readonly TaskEntity[];

  getParent(taskId: TaskId): TaskEntity | undefined;

  hasChildren(taskId: TaskId): boolean;

  isExpanded(taskId: TaskId): boolean;

  toggleExpanded(taskId: TaskId): boolean;

  expandAll(): void;

  collapseAll(): void;

  getExpandedTaskIds(): ReadonlySet<TaskId>;

  replaceExpandedTaskIds(taskIds: Iterable<TaskId>): void;

  getVisibleRows(): readonly VisibleTaskRow[];

  getIndentLevel(taskId: TaskId): number;

  getVisibleIndex(taskId: TaskId): number;

  getSelectedTaskId(): TaskId | null;

  selectTask(taskId: TaskId | null): boolean;

  updateTask(taskId: TaskId, patch: TaskUpdate): TaskEntity;

  replaceAll(tasks: readonly TaskEntity[]): void;
}

createDependencyGraph

Builds a {@link DependencyGraph} from the given tasks and dependencies. Dependencies that reference tasks not in taskIds are silently ignored.

@param taskIds - All task ids to include in the graph. * @param dependencies - Dependency links to process. * @returns A new dependency graph ready for topological sorting.

ts
export function createDependencyGraph(
  taskIds: readonly TaskId[],
  dependencies: readonly DependencyEntity[],
): DependencyGraph;

topologicallySortDependencyGraph

Performs a topological sort on the dependency graph using Kahn's algorithm. If a cycle is detected, returns ok: false with the involved task ids.

@param graph - The dependency graph to sort. * @returns Sorted task order on success, or cycle information on failure.

ts
export function topologicallySortDependencyGraph(graph: DependencyGraph): TopologicalSortResult;

DependencyGraph

A directed acyclic graph of task dependencies. Maps each task to its outgoing dependencies and tracks in-degree counts for topological sorting.

ts
interface DependencyGraph {
  /** All task ids participating in the graph. */
    readonly taskIds: readonly TaskId[];
  /** Outgoing dependencies keyed by predecessor task id. */
    readonly outgoingByTaskId: ReadonlyMap<TaskId, readonly DependencyEntity[]>;
  /** Number of incoming dependencies for each task. */
    readonly incomingCountByTaskId: ReadonlyMap<TaskId, number>
}

DependencyCycle

Represents a cycle detected in the dependency graph. Contains the task ids that form the cycle.

ts
interface DependencyCycle {
  /** Task ids involved in the cycle. */
    readonly taskIds: readonly TaskId[]
}

TopologicalSortResult

Result of a topological sort on a {@link DependencyGraph}. When ok is true, order contains all tasks in dependency order. When ok is false, cycle identifies the offending tasks.

ts
/**
 * Result of a topological sort on a {@link DependencyGraph}.
 * When `ok` is `true`, `order` contains all tasks in dependency order.
 * When `ok` is `false`, `cycle` identifies the offending tasks.
 */
export type TopologicalSortResult = 
  | {
      readonly ok: true;
      readonly order: readonly TaskId[];
      readonly cycle: null;
    }
  | {
      readonly ok: false;
      readonly order: readonly TaskId[];
      readonly cycle: DependencyCycle;
    };

createSchedulerEngine

Creates a new {@link SchedulerEngine} instance. The returned engine uses a deterministic forward-pass algorithm.

ts
export function createSchedulerEngine(): SchedulerEngine;

ScheduledTaskKind

Classification of a scheduled task's type after engine processing.

ts
/** Classification of a scheduled task's type after engine processing. */
export type ScheduledTaskKind =  'task' | 'summary' | 'milestone';

ScheduleOrigin

Indicates how the scheduler determined a task's dates.

ts
/** Indicates how the scheduler determined a task's dates. */
export type ScheduleOrigin =  'normalized' | 'dependency' | 'constraint' | 'manual' | 'rollup';

ScheduledTask (Extended from index.ts)

A task after being processed by the scheduling engine. Extends the raw {@link TaskEntity} with computed scheduling metadata.

ts
interface ScheduledTask {
  /** Resolved task type. */
    readonly type: ScheduledTaskKind;
  /** Whether the task was manually scheduled (bypassing auto-scheduling). */
    readonly manuallyScheduled: boolean;
  /** Whether the task is excluded from scheduling. */
    readonly inactive: boolean;
  /** How the scheduler determined this task's dates. */
    readonly scheduleOrigin: ScheduleOrigin;
  /** Total slack (float) in calendar days before the task delays the project end. */
    readonly totalSlackDays: number
}

SchedulerCycleIssue

A dependency cycle was detected during scheduling.

ts
interface SchedulerCycleIssue {
  readonly code: 'dependency-cycle';
  /** Human-readable description of the cycle. */
    readonly message: string;
  /** Task ids involved in the cycle. */
    readonly taskIds: readonly TaskId[]
}

MissingDependencyTaskIssue

A dependency references a task that does not exist in the project.

ts
interface MissingDependencyTaskIssue {
  readonly code: 'missing-dependency-task';
  readonly message: string;
  readonly taskIds: readonly TaskId[]
}

InvalidTaskConstraintIssue

A task constraint could not be satisfied as specified.

ts
interface InvalidTaskConstraintIssue {
  readonly code: 'invalid-task-constraint';
  readonly message: string;
  readonly taskIds: readonly TaskId[]
}

SchedulerIssue

Union of all issue types the scheduler can report.

ts
/** Union of all issue types the scheduler can report. */
export type SchedulerIssue = 
  | SchedulerCycleIssue
  | MissingDependencyTaskIssue
  | InvalidTaskConstraintIssue;

ConstraintWindowConflict

A soft constraint (window-based) conflicted with a dependency requirement.

ts
interface ConstraintWindowConflict {
  readonly code: 'constraint-window-conflict';
  readonly taskId: TaskId;
  readonly constraintType: Exclude<
      TaskConstraintType,
      'must-start-on' | 'must-finish-on'
    >;
  readonly constraintDate: ISODateString;
  readonly requiredStartDate: ISODateString;
  readonly attemptedStartDate: ISODateString;
  readonly resolvedStartDate: ISODateString;
  readonly message: string
}

DependencyConstraintConflict

A dependency requirement conflicted with an explicit constraint on the same task.

ts
interface DependencyConstraintConflict {
  readonly code: 'dependency-constraint-conflict';
  readonly taskId: TaskId;
  readonly dependencyId: string;
  readonly dependencyType: DependencyEntity['type'];
  readonly constraintType: TaskConstraintType;
  readonly requiredStartDate: ISODateString;
  readonly resolvedStartDate: ISODateString;
  readonly message: string
}

HardConstraintConflict

A hard constraint (must-start-on / must-finish-on) could not be honoured.

ts
interface HardConstraintConflict {
  readonly code: 'hard-constraint-conflict';
  readonly taskId: TaskId;
  readonly constraintType: Extract<TaskConstraintType, 'must-start-on' | 'must-finish-on'>;
  readonly constraintDate: ISODateString;
  readonly resolvedStartDate: ISODateString;
  readonly message: string
}

SchedulerConflict

Union of all conflict types the scheduler can report.

ts
/** Union of all conflict types the scheduler can report. */
export type SchedulerConflict = 
  | ConstraintWindowConflict
  | DependencyConstraintConflict
  | HardConstraintConflict;

SchedulingResult

Result of running the scheduler on a project. Contains the computed task list, detected issues, conflicts, and the set of dependency ids on the critical path.

ts
/**
 * Result of running the scheduler on a project.
 * Contains the computed task list, detected issues, conflicts,
 * and the set of dependency ids on the critical path.
 */
export type SchedulingResult = 
  | {
      readonly ok: true;
      readonly tasks: readonly ScheduledTask[];
      readonly tasksById: ReadonlyMap<TaskId, ScheduledTask>;
      readonly issues: readonly SchedulerIssue[];
      readonly conflicts: readonly SchedulerConflict[];
      readonly criticalDependencyIds: ReadonlySet<string>;
    }
  | {
      readonly ok: false;
      readonly tasks: readonly ScheduledTask[];
      readonly tasksById: ReadonlyMap<TaskId, ScheduledTask>;
      readonly issues: readonly SchedulerIssue[];
      readonly conflicts: readonly SchedulerConflict[];
      readonly criticalDependencyIds: ReadonlySet<string>;
    };

SchedulerEngine

The scheduling engine recalculates task dates based on dependencies, constraints, and calendar rules. It also performs validation and computes the critical path.

ts
interface SchedulerEngine {
  /**
     * Recalculates the full project schedule.
     * @param project - Complete project snapshot.
     * @param options - Optional scheduling parameters.
     * @returns Computed schedule with issues and conflicts.
     */
    recalculate(project: ProjectSnapshot, options?: SchedulerOptions): SchedulingResult;
  /**
     * Validates task/dependency data without running a full schedule.
     * @returns Any structural issues found.
     */
    validate(
      tasks: readonly TaskEntity[],
      dependencies: readonly DependencyEntity[],
      calendars: readonly CalendarEntity[],
    ): readonly SchedulerIssue[]
}

SchedulerOptions

Options passed to {@link SchedulerEngine.recalculate}.

ts
interface SchedulerOptions {
  readonly excludeHolidaysFromDuration?: boolean
}

DeterministicSchedulerEngine

ts
class DeterministicSchedulerEngine {
  validate(
    tasks: readonly TaskEntity[],
    dependencies: readonly DependencyEntity[],
    _calendars: readonly CalendarEntity[],
  ): readonly SchedulerIssue[];

  recalculate(project: ProjectSnapshot, options?: SchedulerOptions): SchedulingResult;
}

resolveTaskEdit

Validates and resolves a user-initiated inline edit on a task field. Handles date parsing, duration recalculation, constraint checking, and prevents edits on derived fields (e.g. summary task dates).

@param _task - The original task entity (before the edit). * @param scheduledTask - The scheduled version of the task (with computed fields). * @param field - The column property name being edited. * @param value - The raw value entered by the user. * @returns A {@link TaskEditResult} with a validated patch or an error.

ts
export function resolveTaskEdit(
  _task: TaskEntity,
  scheduledTask: ScheduledTask,
  field: string,
  value: unknown,
): TaskEditResult;

TaskEditSuccess

Successful task edit — contains the validated patch to apply.

ts
interface TaskEditSuccess {
  readonly ok: true;
  /** Validated partial update ready to be applied to the task. */
    readonly patch: TaskUpdate
}

TaskEditFailure

Failed task edit — contains the error code and a human-readable message.

ts
interface TaskEditFailure {
  readonly ok: false;
  /** Error classification: invalid field name, invalid value, or readonly derived field. */
    readonly code: 'invalid-field' | 'invalid-value' | 'readonly-derived-field';
  /** Explanation of why the edit was rejected. */
    readonly message: string
}

TaskEditResult

Discriminated union returned by {@link resolveTaskEdit}. Check the ok property to determine success or failure.

ts
/**
 * Discriminated union returned by {@link resolveTaskEdit}.
 * Check the `ok` property to determine success or failure.
 */
export type TaskEditResult =  TaskEditSuccess | TaskEditFailure;

AssignmentsTool

Gantt feature tool responsible for managing resource assignments.

Integrates resource filtering into the projection pipeline and delegates assignment mutations through the {@link AssignmentMutationService}.

ts
class AssignmentsTool {
  /**
     * Contribute resource-filter projection options before the render cycle.
     * @param context - The current gantt coordinator context.
     * @returns Partial render contributions with resource filter IDs, or `undefined` if no filter is active.
     */
  beforeRender(context: GanttCoordinatorContext): Partial<GanttRenderContributions> | void;

  /**
     * Configure the assignment mutation service with the latest resolved project state.
     * @param context - The current gantt coordinator context.
     */
  afterRender(context: GanttCoordinatorContext): void;

  /**
     * Route an assignee field edit through the assignment mutation service.
     * @param taskId - The task whose assignments are being edited.
     * @param field - The field name being edited (only `'assignees'` is handled).
     * @param value - The raw editor value.
     * @returns The mutation result, or `null` if the field is not `'assignees'`.
     */
  handleFieldEdit(taskId: string, field: string, value: unknown): AssignmentMutationResult | null;

  destroy(): void;
}

AssignmentMutationService

Service contract for mutating task-to-resource assignments. Implementations manage assignment CRUD and input parsing.

ts
interface AssignmentMutationService {
  /**
     * Configure the service with the current project state and stores.
     * Must be called after each render cycle.
     */
    configure(
      project: ProjectSnapshot,
      taskStore: TaskStore,
      resourceStore: ResourceStore,
      assignmentStore: AssignmentStore,
    ): void;
  /**
     * Replace all assignments for a task with the given list.
     * @param taskId - The task to update.
     * @param assignments - The complete set of assignments to apply.
     * @returns Mutation result indicating success or failure.
     */
    replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentInput[]): AssignmentMutationResult;
  /**
     * Parse a raw editor value (e.g. comma-separated resource names) and replace assignments.
     * @param taskId - The task to update.
     * @param value - Raw field value from the grid editor.
     * @returns Mutation result indicating success or failure.
     */
    updateAssignmentField(taskId: TaskId, value: unknown): AssignmentMutationResult
}

AssignmentMutationResult

Discriminated union result of an assignment mutation — either success or failure.

ts
/** Discriminated union result of an assignment mutation — either success or failure. */
export type AssignmentMutationResult =  AssignmentMutationSuccess | AssignmentMutationFailure;

AssignmentInput

Input payload describing a single resource assignment to a task.

ts
interface AssignmentInput {
  /** Identifier of the resource being assigned. */
    readonly resourceId: ResourceId;
  /** Percentage of the resource's capacity allocated (0–100). */
    readonly allocationUnits: number;
  /** Optional role or responsibility label for this assignment. */
    readonly responsibility?: string
}

DefaultAssignmentMutationService

Default implementation of {@link AssignmentMutationService}. Manages in-memory assignment state and validates against resource/task stores.

ts
class DefaultAssignmentMutationService {
  configure(
    project: ProjectSnapshot,
    taskStore: TaskStore,
    resourceStore: ResourceStore,
    assignmentStore: AssignmentStore,
  ): void;

  replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentInput[]): AssignmentMutationResult;

  updateAssignmentField(taskId: TaskId, value: unknown): AssignmentMutationResult;
}

createAssignmentMutationService

Factory function to create a new {@link AssignmentMutationService} instance.

@returns A configured {@link DefaultAssignmentMutationService}.

ts
export function createAssignmentMutationService(): AssignmentMutationService;

BaselineTool

Gantt feature tool responsible for baseline bar visibility.

Contributes a showBaseline projection option each render cycle based on the visual configuration. The actual baseline rendering is handled by the projection pipeline.

ts
class BaselineTool {
  /**
     * Contribute baseline visibility to the projection options.
     * @param context - The current gantt coordinator context.
     * @returns Partial render contributions with the `showBaseline` flag.
     */
  beforeRender(context: GanttCoordinatorContext): Partial<any> | void;

  destroy(): void;
}

CriticalPathTool

Gantt feature tool that manages critical path highlighting.

Reads showCriticalPath from the visual config, contributes projection options, and exposes the set of critical dependency IDs from the scheduling engine.

ts
class CriticalPathTool {
  /**
     * Contribute the `showCriticalPath` flag to projection options.
     * @param context - The current gantt coordinator context.
     * @returns Partial render contributions with the critical path flag.
     */
  beforeRender(context: GanttCoordinatorContext): Partial<GanttRenderContributions> | void;

  destroy(): void;

  /**
     * Return the set of dependency IDs that lie on the critical path.
     * @param context - The current gantt coordinator context.
     * @returns A read-only set of critical dependency IDs (empty when critical path is disabled).
     */
  getCriticalDependencyIds(context: GanttCoordinatorContext): ReadonlySet<DependencyId>;
}

DependencyTool

Gantt feature tool that manages the full lifecycle of dependency arrows.

Responsibilities include:

  • SVG overlay rendering and viewport-synchronized refresh
  • Hover and selection state management with event emission
  • Dependency field editing (predecessors/successors columns)
  • Keyboard delete handling for selected dependencies
  • Drag-to-connect controller wiring and preview management
  • Cancelable before-mutation event emission
ts
class DependencyTool {
  /**
     * Refresh the dependency overlay after a render cycle.
     * Ensures the SVG layer and drag controller are initialized.
     * @param context - The current gantt coordinator context.
     * @param _renderState - The current render state (unused).
     */
  afterRender(context: GanttCoordinatorContext, _renderState: GanttRenderState): void;

  /**
     * Schedule an overlay refresh when the viewport scrolls or resizes.
     * @param context - The current gantt coordinator context.
     */
  onViewportChanged(context: GanttCoordinatorContext): void;

  /**
     * Handle an inline field edit for predecessor or successor columns.
     * Parses the text reference and delegates to the mutation service.
     * @param taskId - The task being edited.
     * @param field - The field name (`'predecessors'` or `'successors'`).
     * @param value - The raw editor value.
     * @param context - The current gantt coordinator context.
     * @returns Mutation result, or `null` if the field is not a dependency field.
     */
  handleFieldEdit(taskId: TaskId, field: string, value: unknown, context: GanttCoordinatorContext): DependencyMutationResult | null;

  /**
     * Apply a successful mutation result: update the dependency list, sync selection, and re-render.
     * @param result - The mutation result to apply.
     * @param context - The current gantt coordinator context.
     * @param rerender - Whether to request a re-render (default `true`).
     * @returns `true` if the result was successful and applied.
     */
  applyMutationResult(result: DependencyMutationResult, context: GanttCoordinatorContext, rerender = true): boolean;

  /**
     * Apply a dependency mutation with before-mutation event emission.
     * Emits a cancelable event before applying the mutation.
     * If the event is canceled, the mutation is skipped.
     */
  applyDependencyMutation(
    action: 'create' | 'delete' | 'edit',
    mutationFn: () => DependencyMutationResult,
    context: GanttCoordinatorContext,
    dependency: DependencyEntity,
    previousDependency?: DependencyEntity,
  ): boolean;

  /**
     * Handle keyboard events for dependency deletion.
     * Deletes the currently selected dependency on Delete/Backspace.
     * @param event - The keyboard event.
     * @param context - The current gantt coordinator context.
     * @returns `true` if the event was handled.
     */
  handleKeyDown(event: KeyboardEvent, context: GanttCoordinatorContext): boolean;

  /** Tear down the dependency overlay, drag controller, and all state. */
  destroy(): void;
}

DependencyLayerFrame

Viewport frame dimensions for the dependency SVG overlay.

ts
interface DependencyLayerFrame {
  /** Width of the viewport in pixels. */
    readonly width: number;
  /** Height of the viewport in pixels. */
    readonly height: number
}

DependencyLayerRenderState

Current visual state of the dependency overlay (hover, selection, critical path).

ts
interface DependencyLayerRenderState {
  /** ID of the dependency currently hovered, or `null`. */
    readonly hoveredDependencyId: DependencyId | null;
  /** ID of the dependency currently selected, or `null`. */
    readonly selectedDependencyId: DependencyId | null;
  /** Set of dependency IDs on the critical path. */
    readonly criticalDependencyIds: ReadonlySet<string>
}

DependencyLayerDraft

A draft dependency line drawn during a drag-to-connect interaction.

ts
interface DependencyLayerDraft {
  /** SVG path `d` attribute for the draft line. */
    readonly path: string;
  /** Whether the draft represents a valid dependency connection. */
    readonly valid: boolean
}

DependencyLayerInteractionHandlers

Callbacks for dependency overlay user interactions.

ts
interface DependencyLayerInteractionHandlers {
  /** Called when the user hovers over or away from a dependency. */
    onHover(dependencyId: DependencyId | null): void;
  /** Called when the user clicks to select a dependency. */
    onSelect(dependencyId: DependencyId): void;
  /** Called when the user clicks the delete button on a selected dependency. */
    onDelete(dependencyId: DependencyId): void
}

DependencyLayer

Preact-based SVG overlay layer that renders dependency arrows between task bars.

Supports hover/select highlighting, critical path styling, draft previews, and inline delete buttons. Mounts into a container element and re-renders via the {@link render} method.

ts
class DependencyLayer {
  /**
     * Attach the overlay root element to the container DOM.
     * No-op if already mounted.
     */
  mount(): void;

  /** Remove the overlay from the DOM and clean up. */
  destroy(): void;

  /** Hide the overlay without destroying it. */
  hide(): void;

  /**
     * Update the viewport frame dimensions.
     * @param frame - New width and height.
     */
  setFrame(frame: DependencyLayerFrame): void;

  /**
     * Render dependency arrows, interaction states, and optional draft preview.
     * @param layouts - Computed layout geometries for visible dependencies.
     * @param dependenciesById - Map of dependency entities keyed by ID.
     * @param state - Current hover/select/critical visual state.
     * @param draft - Optional draft path for a dependency being drawn.
     */
  render(
    layouts: readonly DependencyLayout[],
    dependenciesById: ReadonlyMap<DependencyId, DependencyEntity>,
    state: DependencyLayerRenderState,
    draft: DependencyLayerDraft | null = null,
  ): void;
}

createDependencyLayoutService

Factory function to create a new {@link DependencyLayoutService} instance.

@returns A new {@link DefaultDependencyLayoutService}.

ts
export function createDependencyLayoutService(): DependencyLayoutService;

DependencyLayoutViewport

Viewport dimensions used for dependency layout calculations.

ts
interface DependencyLayoutViewport {
  /** Viewport width in pixels. */
    readonly width: number;
  /** Viewport height in pixels. */
    readonly height: number
}

DependencyLayout

Computed geometry for a single dependency arrow path.

ts
interface DependencyLayout {
  /** Unique dependency ID. */
    readonly dependencyId: string;
  /** Task ID of the predecessor. */
    readonly predecessorTaskId: string;
  /** Task ID of the successor. */
    readonly successorTaskId: string;
  /** SVG path `d` attribute string. */
    readonly path: string;
  /** X-coordinate of the arrow endpoint. */
    readonly endX: number;
  /** Y-coordinate of the arrow endpoint. */
    readonly endY: number;
  /** Minimum X extent of the path bounding box. */
    readonly minX: number;
  /** Maximum X extent of the path bounding box. */
    readonly maxX: number;
  /** Minimum Y extent of the path bounding box. */
    readonly minY: number;
  /** Maximum Y extent of the path bounding box. */
    readonly maxY: number
}

DependencyLayoutService

Service contract for computing dependency arrow layout geometries. Implementations handle path routing, caching, and viewport culling.

ts
interface DependencyLayoutService {
  /** Invalidate any cached layout data. */
    invalidate(): void;
  /**
     * Compute SVG path layouts for a set of visible dependencies.
     * @param dependencies - Dependency entities to lay out.
     * @param visibleBars - Visible task bar anchor positions.
     * @param viewport - Current viewport dimensions.
     * @returns Array of computed dependency layouts.
     */
    layout(
      dependencies: readonly DependencyEntity[],
      visibleBars: readonly VisibleTaskBarAnchors[],
      viewport: DependencyLayoutViewport,
    ): readonly DependencyLayout[];
  /**
     * Compute a preview layout for a dependency being drawn or edited.
     * @param dependencyId - Temporary ID for the preview.
     * @param predecessorTaskId - Source task ID.
     * @param successorTaskId - Target task ID.
     * @param type - Dependency type.
     * @param predecessorAnchor - Pixel coordinates of the predecessor anchor.
     * @param successorAnchor - Pixel coordinates of the successor anchor.
     * @param viewport - Current viewport dimensions.
     * @returns The computed layout, or `null` if outside the viewport.
     */
    preview(
      dependencyId: string,
      predecessorTaskId: string,
      successorTaskId: string,
      type: DependencyType,
      predecessorAnchor: { x: number; y: number },
      successorAnchor: { x: number; y: number },
      viewport: DependencyLayoutViewport,
    ): DependencyLayout | null
}

DefaultDependencyLayoutService

Default implementation of {@link DependencyLayoutService}.

Routes orthogonal SVG paths with rounded corners between task bar anchors. Caches layout results and invalidates on viewport or data changes.

ts
class DefaultDependencyLayoutService {
  invalidate(): void;

  layout(
    dependencies: readonly DependencyEntity[],
    visibleBars: readonly VisibleTaskBarAnchors[],
    viewport: DependencyLayoutViewport,
  ): readonly DependencyLayout[];

  preview(
    dependencyId: string,
    predecessorTaskId: string,
    successorTaskId: string,
    type: DependencyType,
    predecessorAnchor:;
}

DependencyDragPreview

Snapshot of a dependency drag preview state during a drag-to-connect interaction.

ts
interface DependencyDragPreview {
  /** Task ID of the drag source (predecessor). */
    readonly predecessorTaskId: TaskId;
  /** Task ID of the drag target (successor). */
    readonly successorTaskId: TaskId;
  /** Resolved dependency type based on drag sides. */
    readonly type: DependencyType;
  /** Pixel coordinates of the predecessor anchor point. */
    readonly predecessorAnchor: { x: number; y: number };
  /** Pixel coordinates of the successor anchor point. */
    readonly successorAnchor: { x: number; y: number };
  /** Whether the previewed dependency is a valid connection. */
    readonly valid: boolean
}

DependencyDragControllerOptions

Callback context provided to the {@link DependencyDragController}.

ts
interface DependencyDragControllerOptions {
  /** Return the current viewport snapshot. */
    getViewport(): GanttViewportSnapshot | null;
  /** Return task bar anchors for a given task ID. */
    getBarAnchors(taskId: TaskId): VisibleTaskBarAnchors | null;
  /** Check whether a dependency type is permitted by the config. */
    isAllowedType(type: DependencyType): boolean;
  /** Update the drag preview overlay. */
    setPreview(preview: DependencyDragPreview | null): void;
  /** Commit a finalized dependency after a successful drag. */
    commitDependency(
      predecessorTaskId: TaskId,
      successorTaskId: TaskId,
      type: DependencyType,
    ): void
}

DependencyDragController

Pointer-event-based controller for drag-to-connect dependency creation.

Listens for pointer events on dependency handle elements within task bars, tracks the drag state, resolves hover targets, and manages the preview overlay. On pointer-up, commits the dependency if the connection is valid.

ts
class DependencyDragController {
  /**
     * Remove all event listeners and clean up.
     */
  destroy(): void;
}

createDependencyMutationService

ts
export function createDependencyMutationService(): DependencyMutationService;

DependencyReferenceInput

Input describing a dependency reference for batch replacement.

ts
interface DependencyReferenceInput {
  /** Target task ID for the dependency. */
    readonly taskId: TaskId;
  /** Link type (e.g. `'finish-to-start'`). */
    readonly type: DependencyType;
  /** Optional lag in days (positive = lag, negative = lead). */
    readonly lagDays?: number
}

DependencyMutationSuccess

Successful result of a dependency mutation operation.

ts
interface DependencyMutationSuccess {
  /** Discriminant indicating success. */
    readonly ok: true;
  /** ID of the affected dependency, or `null` for batch operations. */
    readonly dependencyId: DependencyId | null;
  /** Whether a new dependency was created (vs. updated/deleted). */
    readonly created: boolean
}

DependencyMutationFailure

Failed result of a dependency mutation operation.

ts
interface DependencyMutationFailure {
  /** Discriminant indicating failure. */
    readonly ok: false;
  /** Machine-readable error code. */
    readonly code:
      | 'dependency-not-found'
      | 'invalid-task'
      | 'invalid-self-reference'
      | 'invalid-type'
      | 'duplicate-dependency'
      | 'invalid-reference';
  /** Human-readable error message. */
    readonly message: string
}

DependencyMutationResult

Discriminated union result of a dependency mutation — either success or failure.

ts
/** Discriminated union result of a dependency mutation — either success or failure. */
export type DependencyMutationResult =  DependencyMutationSuccess | DependencyMutationFailure;

DependencyMutationService

Service contract for mutating dependency entities. Implementations manage dependency CRUD, validation, and batch replacement.

ts
interface DependencyMutationService {
  /**
     * Configure the service with the current dependency set and task store.
     * @param dependencies - Current dependency entities.
     * @param taskStore - Task store for validation.
     * @param allowedTypes - Set of permitted dependency types.
     */
    configure(
      dependencies: readonly DependencyEntity[],
      taskStore: TaskStore,
      allowedTypes: readonly DependencyType[],
    ): void;
  /** Return all current dependency entities. */
    getAll(): readonly DependencyEntity[];
  /**
     * Create a new dependency between two tasks.
     * @param predecessorTaskId - Source task.
     * @param successorTaskId - Target task.
     * @param type - Link type.
     * @param lagDays - Optional lag in days.
     * @returns Mutation result.
     */
    createDependency(
      predecessorTaskId: TaskId,
      successorTaskId: TaskId,
      type: DependencyType,
      lagDays?: number,
    ): DependencyMutationResult;
  /**
     * Update an existing dependency's type or lag.
     * @param dependencyId - ID of the dependency to update.
     * @param patch - Partial update fields.
     * @returns Mutation result.
     */
    updateDependency(
      dependencyId: DependencyId,
      patch: Partial<Pick<DependencyEntity, 'type' | 'lagDays'>>,
    ): DependencyMutationResult;
  /**
     * Delete a dependency by ID.
     * @param dependencyId - ID of the dependency to remove.
     * @returns Mutation result.
     */
    deleteDependency(dependencyId: DependencyId): DependencyMutationResult;
  /**
     * Replace all dependencies for a task in one direction.
     * @param taskId - The task whose dependencies are replaced.
     * @param direction - Whether replacing predecessors or successors.
     * @param references - The new set of dependency references.
     * @returns Mutation result.
     */
    replaceTaskDependencies(
      taskId: TaskId,
      direction: 'predecessors' | 'successors',
      references: readonly DependencyReferenceInput[],
    ): DependencyMutationResult
}

DefaultDependencyMutationService

Default implementation of {@link DependencyMutationService}.

Manages an in-memory list of dependency entities and validates against the task store and allowed dependency type configuration.

ts
class DefaultDependencyMutationService {
  configure(
    dependencies: readonly DependencyEntity[],
    taskStore: TaskStore,
    allowedTypes: readonly DependencyType[],
  ): void;

  getAll(): readonly DependencyEntity[];

  createDependency(
    predecessorTaskId: TaskId,
    successorTaskId: TaskId,
    type: DependencyType,
    lagDays = 0,
  ): DependencyMutationResult;

  updateDependency(
    dependencyId: DependencyId,
    patch: Partial<Pick<DependencyEntity, 'type' | 'lagDays'>>,
  ): DependencyMutationResult;

  deleteDependency(dependencyId: DependencyId): DependencyMutationResult;

  replaceTaskDependencies(
    taskId: TaskId,
    direction: 'predecessors' | 'successors',
    references: readonly DependencyReferenceInput[],
  ): DependencyMutationResult;
}

formatDependencyTypeShort

Format a dependency type as a short label (e.g. 'FS', 'SS').

@param type - The dependency type to format. * @returns Two-letter short label.

ts
export function formatDependencyTypeShort(type: DependencyType): string;

formatDependencyReference

Format a dependency entity as a reference token for display in a grid cell.

@param dependency - The dependency entity. * @param relatedTaskId - The task ID from whose perspective the reference is formatted. * @param taskRefById - Map of task IDs to their display references (WBS codes). * @returns A formatted reference with task ID and display token, or null if the task ref is missing.

ts
export function formatDependencyReference(
  dependency: DependencyEntity,
  relatedTaskId: string,
  taskRefById: ReadonlyMap<TaskId, string>,
): FormattedDependencyReference | null;

parseDependencyReferences

Parse a comma-separated string of dependency references into structured objects.

Each reference has the format <taskRef><TypeLabel>[±<lag>d], e.g. "1FS", "2.1SS+2d".

@param value - The raw dependency reference string. * @returns Array of parsed references. * @throws Error if any individual reference is malformed.

ts
export function parseDependencyReferences(value: string): readonly ParsedDependencyReference[];

FormattedDependencyReference

A formatted dependency reference token for display in grid cells.

ts
interface FormattedDependencyReference {
  /** ID of the related task. */
    readonly taskId: TaskId;
  /** Human-readable reference token (e.g. `"1FS"`, `"2.1SS+2"`). */
    readonly token: string
}

ParsedDependencyReference

A parsed dependency reference extracted from a user-entered text string.

ts
interface ParsedDependencyReference {
  /** Task reference identifier (WBS code or task ID). */
    readonly taskRef: string;
  /** Dependency link type (e.g. `'finish-to-start'`). */
    readonly type: DependencyType;
  /** Lag or lead in days (positive = lag, negative = lead). */
    readonly lagDays: number
}

TaskBarsTool

Gantt feature tool that manages task bar projection and selection state.

Provides access to projected task rows, visible bar anchors, and row frames. Used by interaction and dependency tools to resolve task geometries.

ts
class TaskBarsTool {
  destroy(): void;

  /**
     * Return the full list of projected task grid rows.
     * @returns Array of {@link TaskGridRow} from the grid data source.
     */
  getProjectedRows(): TaskGridRow[];

  /**
     * Return the projected row for a specific task.
     * @param taskId - The task to look up.
     * @returns The projected row, or `null` if not found.
     */
  getProjectedRow(taskId: TaskId): TaskGridRow | null;

  /**
     * Return projected rows filtered to only visible tasks from the task store.
     * @returns Array of visible {@link TaskGridRow} entries.
     */
  getVisibleProjectedRows(): TaskGridRow[];

  /**
     * Return the viewport frame (top offset and height) for a given row index.
     * @param rowIndex - Virtual row index in the viewport.
     * @returns Row frame coordinates, or `null` if the row is not visible.
     */
  getVisibleRowFrame(rowIndex: number):;

  /**
     * Compute visible task bar anchor positions for a specific task.
     * @param taskId - The task to compute anchors for.
     * @returns Bar anchor geometry, or `null` if the task is not visible.
     */
  getVisibleTaskBarAnchor(taskId: TaskId);

  /**
     * Synchronize visual selection state on projected rows when the focused task changes.
     * @param previousTaskId - The previously selected task (or `null`).
     * @param nextTaskId - The newly selected task.
     */
  syncSelection(previousTaskId: TaskId | null, nextTaskId: TaskId): void;
}

InteractionTool

Gantt feature tool that coordinates task timeline interactions.

Manages the lifecycle of drag, resize, and create controllers and the shared preview overlay layer. All task mutations flow through the {@link DefaultTaskMutationService} with cancelable before-change events.

ts
class InteractionTool {
  /**
     * Configure the mutation service and ensure controllers are initialized.
     * @param context - The current gantt coordinator context.
     * @param renderState - The current render state with scheduling data.
     */
  afterRender(context: GanttCoordinatorContext, renderState: GanttRenderState): void;

  /**
     * Synchronize task bar selection visuals when the focused cell changes.
     * @param previousTaskId - The previously focused task, or `null`.
     * @param taskId - The newly focused task.
     */
  handleBeforeCellFocus(previousTaskId: TaskId | null, taskId: TaskId): void;

  /**
     * Route an inline task field edit through the mutation service.
     * @param taskId - The task being edited.
     * @param field - The field name.
     * @param value - The raw editor value.
     * @returns The mutation result.
     */
  handleTaskFieldEdit(taskId: TaskId, field: string, value: unknown): TaskMutationResult;

  /**
     * Apply a task mutation with before-mutation event emission.
     * Emits a cancelable event before applying the mutation.
     * If the event is canceled, the mutation is skipped.
     */
  applyTaskMutation(
    action: GanttBeforeTaskChangeAction,
    mutationFn: () => TaskMutationResult,
    context: GanttCoordinatorContext,
    taskId: TaskId,
    proposedChanges: Partial<TaskEntity>,
  ): void;

  /**
     * Schedule an overlay refresh when the viewport scrolls or resizes.
     * @param context - The current gantt coordinator context.
     */
  onViewportChanged(context: GanttCoordinatorContext): void;

  /** Tear down all controllers, the preview layer, and interaction state. */
  destroy(): void;

  /**
     * Set the current interaction preview and refresh the overlay.
     * @param preview - The preview to display, or `null` to clear.
     * @param context - The current gantt coordinator context.
     */
  setPreview(preview: TimelineInteractionPreview | null, context: GanttCoordinatorContext): void;
}

ProgressTool

Gantt feature tool that wires progress-drag interactions.

Creates a {@link TaskProgressController} to handle progress handle drag events and delegates preview rendering to the shared {@link InteractionTool}.

ts
class ProgressTool {
  /**
     * Ensure the progress controller is initialized after a render cycle.
     * @param context - The current gantt coordinator context.
     */
  afterRender(context: GanttCoordinatorContext): void;

  destroy(): void;
}

DefaultTaskMutationService

Service that handles task CRUD operations, field updates, and hierarchy changes.

Manages task creation, movement, resizing, progress updates, indent/outdent, and inline field edits. Respects calendar-aware working day constraints when excludeHolidaysFromDuration is enabled.

ts
class DefaultTaskMutationService {
  /**
     * Configure the service with the current project and scheduling state.
     * Must be called after each render cycle.
     * @param project - Current project snapshot.
     * @param taskStore - Task store for reads and writes.
     * @param scheduledTasksById - Map of scheduled task results from the engine.
     * @param options - Optional scheduling config (e.g. holiday exclusion).
     */
  configure(
    project: ProjectSnapshot,
    taskStore: TaskStore,
    scheduledTasksById: ReadonlyMap<TaskId, ScheduledTask>,
    options?: GanttPluginConfig['scheduling'],
  ): void;

  /**
     * Snap a date to the nearest working day in the primary calendar.
     * No-op when holiday exclusion is disabled.
     * @param date - The date to snap.
     * @param direction - Search direction (`'forward'` or `'back'`).
     * @returns The snapped date, or the original if already on a working day.
     */
  snapToWorkingDate(date: ISODateString, direction: 'forward' | 'back' = 'forward'): ISODateString;

  /**
     * Update a single task field from an inline grid editor.
     * Delegates to {@link resolveTaskEdit} for field resolution.
     * @param taskId - The task to update.
     * @param field - The field name.
     * @param value - The raw editor value.
     * @returns Mutation result.
     */
  updateTaskField(taskId: TaskId, field: string, value: unknown): TaskMutationResult;

  /**
     * Apply a partial update patch to a task.
     * Validates dates, duration, and calendar constraints.
     * @param taskId - The task to update.
     * @param patch - Partial task update fields.
     * @returns Mutation result.
     */
  updateTaskPatch(taskId: TaskId, patch: TaskUpdate): TaskMutationResult;

  /**
     * Update a task's progress percentage.
     * Clamps the value to 0–100.
     * @param taskId - The task to update.
     * @param progressPercent - New progress value.
     * @returns Mutation result.
     */
  updateTaskProgress(taskId: TaskId, progressPercent: number): TaskMutationResult;

  /**
     * Move a task to a new start date on the timeline.
     * Summary tasks cannot be moved directly.
     * @param taskId - The task to move.
     * @param newStartDate - The new start date.
     * @returns Mutation result.
     */
  moveTask(taskId: TaskId, newStartDate: ISODateString): TaskMutationResult;

  /**
     * Resize a task by setting new start and end dates.
     * Recomputes duration using calendar-aware working days when applicable.
     * @param taskId - The task to resize.
     * @param newStartDate - The new start date.
     * @param newEndDate - The new end date.
     * @returns Mutation result.
     */
  resizeTask(
    taskId: TaskId,
    newStartDate: ISODateString,
    newEndDate: ISODateString,
  ): TaskMutationResult;

  /**
     * Create a new task with the given date range and optional parent.
     * Validates dates, calendar constraints, and parent existence.
     * @param parentId - Parent task ID for hierarchy, or `null` for root.
     * @param payload - Start/end dates and optional name.
     * @param placement - Optional insertion position.
     * @returns Mutation result with the new task ID.
     */
  createTask(
    parentId: TaskId | null,
    payload: TaskCreatePayload,
    placement?: TaskCreatePlacement,
  ): TaskMutationResult;

  /**
     * Indent a task, making it a child of the previous sibling task.
     * Moves the task and all its descendants.
     * @param taskId - The task to indent.
     * @returns Mutation result.
     */
  indentTask(taskId: TaskId): TaskMutationResult;

  /**
     * Outdent a task, promoting it to a sibling of its current parent.
     * Moves the task and all its descendants.
     * @param taskId - The task to outdent.
     * @returns Mutation result.
     */
  outdentTask(taskId: TaskId): TaskMutationResult;
}

createTaskMutationService

Factory function to create a new {@link DefaultTaskMutationService} instance.

@returns A new task mutation service.

ts
export function createTaskMutationService();

TaskMutationResult

Discriminated union result of a task mutation — either success or failure.

ts
/** Discriminated union result of a task mutation — either success or failure. */
export type TaskMutationResult =  TaskMutationSuccess | TaskMutationFailure;

TaskCreatePayload

Payload describing the date range and optional name for a new task.

ts
interface TaskCreatePayload {
  /** Start date in ISO format. */
    readonly startDate: ISODateString;
  /** End date in ISO format. */
    readonly endDate: ISODateString;
  /** Optional task name (auto-generated if omitted). */
    readonly name?: string
}

TaskCreateController

Pointer-event-based controller for drag-to-create task interactions.

Listens for pointer events on empty gantt cells. When the user drags beyond a threshold, a task creation preview is rendered. On pointer-up, the task is committed through the context callback.

ts
class TaskCreateController {
  /**
     * Remove all event listeners and clean up.
     */
  destroy(): void;
}

CreateControllerContext

Callback context provided to the {@link TaskCreateController}.

ts
interface CreateControllerContext {
  /** Whether task creation by drag is currently enabled. */
    isCreateEnabled(): boolean;
  /** Return the current timeline scale. */
    getScale(): TimelineScale | null;
  /** Return the current viewport snapshot. */
    getViewport(): GanttViewportSnapshot | null;
  /** Resolve the parent/insertion position for a new task at the given row. */
    getCreatePlacement(rowIndex: number): { parentId: TaskId | null; insertAfterTaskId: TaskId | null } | null;
  /** Update the interaction preview overlay. */
    setPreview(preview: TimelineInteractionPreview | null): void;
  /** Commit a new task after a successful drag-to-create gesture. */
    commitCreate(
      parentId: TaskId | null,
      startDate: string,
      endDate: string,
      insertAfterTaskId: TaskId | null,
    ): void
}

TaskDragController

Pointer-event-based controller for drag-to-move task interactions.

Listens for pointer events on task bar elements (excluding resize/progress/dependency handles). During the drag, renders a move preview. On pointer-up, commits the new start date. Supports optional date snapping to working days.

ts
class TaskDragController {
  /**
     * Remove all event listeners and clean up.
     */
  destroy(): void;
}

DragControllerContext

Callback context provided to the {@link TaskDragController}.

ts
interface DragControllerContext {
  /** Return the current timeline scale. */
    getScale(): TimelineScale | null;
  /** Return the current viewport snapshot. */
    getViewport(): GanttViewportSnapshot | null;
  /** Return the scheduled task data for a given task ID. */
    getScheduledTask(taskId: TaskId): ScheduledTask | null;
  /** Return the preview bar width for a task. */
    getTaskPreviewWidth(taskId: TaskId): number | null;
  /** Update the interaction preview overlay. */
    setPreview(preview: TimelineInteractionPreview | null): void;
  /** Commit a task move to a new start date. */
    commitMove(taskId: TaskId, newStartDate: string): void;
  /** Snap a date to the nearest working day (optional). */
    snapDate?(date: ISODateString, direction: 'forward' | 'back'): ISODateString
}

TaskResizeController

Pointer-event-based controller for drag-to-resize task interactions.

Listens for pointer events on resize handle elements within task bars. During the drag, renders a resize preview snapped to the dragged edge. On pointer-up, commits the new start/end dates. Supports optional date snapping to working days.

ts
class TaskResizeController {
  /**
     * Remove all event listeners and clean up.
     */
  destroy(): void;
}

ResizeControllerContext

Callback context provided to the {@link TaskResizeController}.

ts
interface ResizeControllerContext {
  /** Return the current timeline scale. */
    getScale(): TimelineScale | null;
  /** Return the current viewport snapshot. */
    getViewport(): GanttViewportSnapshot | null;
  /** Return the scheduled task data for a given task ID. */
    getScheduledTask(taskId: TaskId): ScheduledTask | null;
  /** Return the virtual row index for a task ID. */
    getRowIndex(taskId: TaskId): number | null;
  /** Return the viewport row frame for a virtual row index. */
    getRowFrame(rowIndex: number): { top: number; height: number } | null;
  /** Update the interaction preview overlay. */
    setPreview(preview: TimelineInteractionPreview | null): void;
  /** Commit a task resize with new start and end dates. */
    commitResize(taskId: TaskId, newStartDate: string, newEndDate: string): void;
  /** Snap a date to the nearest working day (optional). */
    snapDate?(date: ISODateString, direction: 'forward' | 'back'): ISODateString
}

TaskProgressController

Pointer-event-based controller for drag-to-update-progress interactions.

Listens for pointer events on progress handle elements within task bars. During the drag, renders a progress preview. On pointer-up, commits the computed progress percentage.

ts
class TaskProgressController {
  /**
     * Remove all event listeners and clean up.
     */
  destroy(): void;
}

ProgressControllerContext

Callback context provided to the {@link TaskProgressController}.

ts
interface ProgressControllerContext {
  /** Return the current viewport snapshot. */
    getViewport(): GanttViewportSnapshot | null;
  /** Return the scheduled task data for a given task ID. */
    getScheduledTask(taskId: TaskId): ScheduledTask | null;
  /** Return the task bar's left offset and width in pixels. */
    getTaskBarFrame(taskId: TaskId): { left: number; width: number } | null;
  /** Return the virtual row index for a task ID. */
    getRowIndex(taskId: TaskId): number | null;
  /** Return the viewport row frame for a virtual row index. */
    getRowFrame(rowIndex: number): { top: number; height: number } | null;
  /** Update the interaction preview overlay. */
    setPreview(preview: TimelineInteractionPreview | null): void;
  /** Commit a progress update with the new percentage. */
    commitProgress(taskId: TaskId, progressPercent: number): void
}

TimelinePreviewLayer

Preact-based overlay layer that renders a ghost preview bar during task move, resize, create, and progress interactions.

Mounts into a container element and re-renders when the preview changes.

ts
class TimelinePreviewLayer {
  /**
     * Attach the overlay root element to the container DOM.
     * No-op if already mounted.
     */
  mount(): void;

  /** Remove the overlay from the DOM and clean up. */
  destroy(): void;

  /**
     * Update the viewport frame dimensions.
     * @param frame - New width and height.
     */
  setFrame(frame: TimelinePreviewFrame): void;

  /**
     * Render the interaction preview, or clear if `null`.
     * @param preview - The preview to render, or `null` to hide.
     */
  render(preview: TimelineInteractionPreview | null): void;
}

TimelineInteractionPreview

Snapshot of a task interaction preview (move, resize, create, or progress).

ts
interface TimelineInteractionPreview {
  /** Task ID being interacted with, or `null` for create previews. */
    readonly taskId: string | null;
  /** Virtual row index in the grid. */
    readonly rowIndex: number;
  /** Type of interaction being previewed. */
    readonly kind: 'move' | 'resize' | 'create' | 'progress';
  /** Bar visual kind (task or milestone). */
    readonly barKind: Exclude<GanttBarKind, 'summary'>;
  /** Left offset in pixels relative to the viewport. */
    readonly left: number;
  /** Width of the preview bar in pixels. */
    readonly width: number;
  /** Top offset in pixels (row center). */
    readonly top: number;
  /** Row height in pixels. */
    readonly height: number;
  /** Width of the progress fill, for progress previews. */
    readonly progressWidth?: number;
  /** Whether the preview represents a valid state. */
    readonly valid: boolean
}

TimelinePreviewFrame

Viewport frame dimensions for the preview overlay.

ts
interface TimelinePreviewFrame {
  /** Width of the viewport in pixels. */
    readonly width: number;
  /** Height of the viewport in pixels. */
    readonly height: number
}

addDays

Add a number of days to an ISO date string.

@param date - Base date in ISO format. * @param days - Number of days to add (can be negative). * @returns The resulting date in ISO format.

ts
export function addDays(date: ISODateString, days: number): ISODateString;

diffInDays

Calculate the difference in whole days between two ISO dates.

@param startDate - Earlier date. * @param endDate - Later date. * @returns Number of days (negative if endDate is before startDate).

ts
export function diffInDays(startDate: ISODateString, endDate: ISODateString): number;

createMoveDraft

Compute a draft range for a task move interaction.

@param scale - Current timeline scale. * @param scrollLeft - Horizontal scroll offset. * @param originalBarLeft - Original bar left position in content coordinates. * @param originContentX - Pointer X at drag start in content coordinates. * @param pointerContentX - Current pointer X in content coordinates. * @param width - Bar width in pixels. * @returns A {@link TimelineDraftRange} with the projected date range.

ts
export function createMoveDraft(
  scale: TimelineScale,
  scrollLeft: number,
  originalBarLeft: number,
  originContentX: number,
  pointerContentX: number,
  width: number,
): TimelineDraftRange;

createResizeDraft

Compute a draft range for a task resize interaction.

@param scale - Current timeline scale. * @param scrollLeft - Horizontal scroll offset. * @param edge - Which edge is being dragged ('start' or 'end'). * @param originalLeft - Original bar left in content coordinates. * @param originalRight - Original bar right in content coordinates. * @param pointerContentX - Current pointer X in content coordinates. * @returns A {@link TimelineDraftRange} with the projected date range.

ts
export function createResizeDraft(
  scale: TimelineScale,
  scrollLeft: number,
  edge: 'start' | 'end',
  originalLeft: number,
  originalRight: number,
  pointerContentX: number,
): TimelineDraftRange;

createTaskDraft

Compute a draft range for a task create interaction.

@param scale - Current timeline scale. * @param scrollLeft - Horizontal scroll offset. * @param originContentX - Pointer X at drag start in content coordinates. * @param pointerContentX - Current pointer X in content coordinates. * @returns A {@link TimelineDraftRange} with the projected date range.

ts
export function createTaskDraft(
  scale: TimelineScale,
  scrollLeft: number,
  originContentX: number,
  pointerContentX: number,
): TimelineDraftRange;

createProgressDraft

Compute a draft state for a progress-drag interaction.

@param barLeft - Bar left position in content coordinates. * @param barWidth - Bar width in pixels. * @param scrollLeft - Horizontal scroll offset. * @param pointerContentX - Current pointer X in content coordinates. * @returns A {@link TimelineProgressDraft} with the computed progress.

ts
export function createProgressDraft(
  barLeft: number,
  barWidth: number,
  scrollLeft: number,
  pointerContentX: number,
): TimelineProgressDraft;

TimelineDraftRange

Draft range computed during a task move, resize, or create interaction.

ts
interface TimelineDraftRange {
  /** Start date in ISO format. */
    readonly startDate: ISODateString;
  /** End date in ISO format. */
    readonly endDate: ISODateString;
  /** Left offset in pixels relative to the viewport. */
    readonly left: number;
  /** Width of the draft bar in pixels. */
    readonly width: number;
  /** Whether the draft represents a valid date range. */
    readonly valid: boolean
}

TimelineProgressDraft

Draft state computed during a progress-drag interaction.

ts
interface TimelineProgressDraft {
  /** Left offset of the bar in pixels relative to the viewport. */
    readonly left: number;
  /** Full bar width in pixels. */
    readonly width: number;
  /** Width of the progress fill in pixels. */
    readonly progressWidth: number;
  /** Computed progress as a 0–100 integer percentage. */
    readonly progressPercent: number;
  /** Whether the draft is valid (always `true` for progress). */
    readonly valid: boolean
}

TimelineTool

Gantt feature tool that manages timeline zoom levels and visible date range.

Wraps a {@link TimelineZoomController} and provides public methods for programmatic zoom, level queries, and anchor-preserving zoom transitions.

ts
class TimelineTool {
  /**
     * React to config changes by updating the zoom controller preset.
     * @param context - The current gantt coordinator context.
     */
  onConfigChange(context: GanttCoordinatorContext): void;

  /**
     * Synchronize the visible date range after a render cycle.
     * @param context - The current gantt coordinator context.
     * @param _renderState - The current render state (unused).
     */
  afterRender(context: GanttCoordinatorContext, _renderState: GanttRenderState): void;

  /**
     * Handle horizontal scroll events to update the visible date range.
     * @param detail - The scroll event detail from the grid.
     * @param context - The current gantt coordinator context.
     */
  onViewportScroll(detail: ViewPortScrollEvent, context: GanttCoordinatorContext): void;

  /** Return the current zoom level descriptor. */
  getZoomLevel();

  /** Whether zooming in is possible (not at the finest level). */
  canZoomIn();

  /** Whether zooming out is possible (not at the coarsest level). */
  canZoomOut();

  /** Return the currently visible date range. */
  getVisibleRange();

  /**
     * Zoom in one level.
     * @param context - The current gantt coordinator context.
     * @returns `true` if zoom was applied.
     */
  zoomIn(context: GanttCoordinatorContext): boolean;

  /**
     * Zoom out one level.
     * @param context - The current gantt coordinator context.
     * @returns `true` if zoom was applied.
     */
  zoomOut(context: GanttCoordinatorContext): boolean;

  /**
     * Set a specific zoom level by ID.
     * @param levelId - The zoom level identifier.
     * @param context - The current gantt coordinator context.
     * @returns `true` if zoom was applied.
     */
  setZoomLevel(levelId: string, context: GanttCoordinatorContext): boolean;

  /** Return the current zoom controller configuration. */
  getConfig();

  destroy(): void;
}

CalendarTool

Gantt feature tool that provides calendar context to other tools.

Resolves the primary project calendar from the project snapshot. Used by the decoration tool to determine non-working time shading.

ts
class CalendarTool {
  destroy(): void;

  /**
     * Return the primary project calendar entity.
     * @param context - The current gantt coordinator context.
     * @returns The primary calendar, or `null` if no project is loaded.
     */
  getPrimaryCalendar(context: GanttCoordinatorContext): CalendarEntity | null;
}

DecorationTool

Gantt feature tool that manages decorative timeline overlays.

Renders the project line marker, user-defined time range highlights, and non-working day shading using the {@link TimelineDecorationLayer}. Refreshes on every render cycle and viewport scroll.

ts
class DecorationTool {
  /**
     * Refresh the decoration layer after a render cycle.
     * @param context - The current gantt coordinator context.
     * @param _renderState - The current render state (unused).
     */
  afterRender(context: GanttCoordinatorContext, _renderState: GanttRenderState): void;

  /**
     * Refresh the decoration layer when the viewport scrolls or resizes.
     * @param context - The current gantt coordinator context.
     */
  onViewportChanged(context: GanttCoordinatorContext): void;

  /** Hide the decoration layer without destroying it. */
  hide(): void;

  destroy(): void;
}

TimelineDecorationLayer

Preact-based overlay layer that renders timeline decorations: non-working day shading, user-defined time ranges, and the project line.

Mounts into a container element and re-renders from a {@link TimelineDecorationModel} on each refresh.

ts
class TimelineDecorationLayer {
  /**
     * Attach the overlay root element to the container DOM.
     * No-op if already mounted.
     */
  mount(): void;

  /** Remove the overlay from the DOM and clean up. */
  destroy(): void;

  /** Hide the overlay without destroying it. */
  hide(): void;

  /**
     * Update the viewport frame dimensions.
     * @param frame - New width and height.
     */
  setFrame(frame: TimelineDecorationFrame): void;

  /**
     * Render the decoration model (project line, time ranges, non-working shading).
     * @param model - The computed decoration model to render.
     */
  render(model: TimelineDecorationModel): void;
}

TimelineDecorationFrame

Viewport frame dimensions for the decoration overlay.

ts
interface TimelineDecorationFrame {
  /** Width of the viewport in pixels. */
    readonly width: number;
  /** Height of the viewport in pixels. */
    readonly height: number
}

createTimelineDecorationModel

Build a complete timeline decoration model from the current scale, viewport, and options.

Computes the project line position, today flag line, user milestone flag lines, user-defined time range highlights, and non-working day shading.

@param scale - Current timeline scale for date-to-pixel conversion. * @param viewport - Viewport dimensions and scroll position. * @param options - Decoration options. * @returns A {@link TimelineDecorationModel} for rendering.

ts
export function createTimelineDecorationModel(
  scale: TimelineScale,
  viewport: TimelineVisualViewport,
  options:;

TimelineDecorationModel

Complete decoration model for the timeline overlay, composed of lines and ranges.

ts
interface TimelineDecorationModel {
  /** Project line visual, or `null` if not configured. */
    readonly projectLine: TimelineLineVisual | null;
  /** Today flag line, or `null` if disabled or off-screen. */
    readonly todayLine: TimelineLineVisual | null;
  /** User-defined milestone flag lines. */
    readonly milestoneLines: readonly TimelineLineVisual[];
  /** User-defined time range highlights. */
    readonly timeRanges: readonly TimelineRangeVisual[];
  /** Non-working day shading ranges. */
    readonly nonWorkingRanges: readonly TimelineRangeVisual[]
}

TimelineVisualViewport

Viewport dimensions and scroll position for decoration calculations.

ts
interface TimelineVisualViewport {
  /** Viewport width in pixels. */
    readonly width: number;
  /** Viewport height in pixels. */
    readonly height: number;
  /** Horizontal scroll offset in pixels. */
    readonly scrollLeft: number
}

createGanttColumnType

Create a RevoGrid column type that renders the gantt timeline header and task bars.

The returned column type provides a columnTemplate that draws the multi-row timeline header cells and a cellTemplate that renders the task bar (regular, milestone, or summary) with progress, dependency handles, and baseline overlays.

@param getTimeline - Accessor returning the current timeline view model, or

  • undefined when no timeline has been computed yet.

@returns A read-only ColumnType suitable for use in revogrid.columnTypes.

ts
export function createGanttColumnType(
  getTimeline: () => GanttTimelineViewModel | undefined,
): ColumnType;

GANTT_DEPENDENCY_HOVER_EVENT

Fired when the user hovers over a dependency arrow.

ts
GANTT_DEPENDENCY_HOVER_EVENT: string;

GANTT_DEPENDENCY_SELECT_EVENT

Fired when the user clicks a dependency arrow.

ts
GANTT_DEPENDENCY_SELECT_EVENT: string;

GANTT_TASK_CREATE_EVENT

Dispatched to create a new task. Provide {@link GanttCreateTaskOptions} as the detail.

ts
GANTT_TASK_CREATE_EVENT: string;

GANTT_TASK_INDENT_EVENT

Dispatched to indent (demote) the selected task one level deeper.

ts
GANTT_TASK_INDENT_EVENT: string;

GANTT_TASK_OUTDENT_EVENT

Dispatched to outdent (promote) the selected task one level up.

ts
GANTT_TASK_OUTDENT_EVENT: string;

GANTT_ZOOM_IN_EVENT

Dispatched to zoom in by one level.

ts
GANTT_ZOOM_IN_EVENT: string;

GANTT_ZOOM_OUT_EVENT

Dispatched to zoom out by one level.

ts
GANTT_ZOOM_OUT_EVENT: string;

GANTT_ZOOM_SET_LEVEL_EVENT

Dispatched to jump directly to a specific zoom level by id.

ts
GANTT_ZOOM_SET_LEVEL_EVENT: string;

GANTT_PANEL_RESIZE_EVENT

Fired when the user resizes the table/timeline panel divider.

ts
GANTT_PANEL_RESIZE_EVENT: string;

GANTT_BEFORE_TASK_CHANGE_EVENT

Cancelable event fired before a task is created, moved, resized, or edited.

ts
GANTT_BEFORE_TASK_CHANGE_EVENT: string;

GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT

Cancelable event fired before a dependency is created, deleted, or edited.

ts
GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT: string;

GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT

Cancelable event fired before task assignments are modified.

ts
GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT: string;

GanttPanelResizeEventDetail

Detail payload for panel resize events.

ts
interface GanttPanelResizeEventDetail {
  /** New panel width in pixels. */
    readonly width: number
}

GanttDependencyInteractionDetail

Detail payload for dependency hover/select events.

ts
interface GanttDependencyInteractionDetail {
  /** Dependency id, or `null` when the interaction is cleared. */
    readonly dependencyId: DependencyId | null;
  /** Full dependency entity, or `null` when cleared. */
    readonly dependency: DependencyEntity | null
}

GanttTaskHierarchyActionDetail

Detail payload for indent/outdent events.

ts
interface GanttTaskHierarchyActionDetail {
  /** Target task id (defaults to the currently selected task). */
    readonly taskId?: TaskId
}

GanttZoomSetLevelDetail

Detail payload for zoom-set-level events.

ts
interface GanttZoomSetLevelDetail {
  /** The zoom level id to jump to. */
    readonly levelId: string
}

GanttBeforeTaskChangeAction

Kind of task mutation that triggered the before-change event.

ts
// Before-mutation event details (cancelable)

/** Kind of task mutation that triggered the before-change event. */
export type GanttBeforeTaskChangeAction =  'move' | 'resize' | 'create' | 'edit' | 'progress' | 'indent' | 'outdent';

GanttBeforeTaskChangeDetail

Detail payload for the cancelable {@link GANTT_BEFORE_TASK_CHANGE_EVENT}. Call event.preventDefault() to block the change.

ts
interface GanttBeforeTaskChangeDetail {
  readonly action: GanttBeforeTaskChangeAction;
  readonly taskId: TaskId;
  /** Partial task with proposed values */
    readonly changes: Partial<TaskEntity>;
  /** Previous values of fields being changed */
    readonly previousValues: Partial<TaskEntity>
}

GanttBeforeDependencyChangeAction

Kind of dependency mutation that triggered the before-change event.

ts
/** Kind of dependency mutation that triggered the before-change event. */
export type GanttBeforeDependencyChangeAction =  'create' | 'delete' | 'edit';

GanttBeforeDependencyChangeDetail

Detail payload for the cancelable {@link GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT}. Call event.preventDefault() to block the change.

ts
interface GanttBeforeDependencyChangeDetail {
  readonly action: GanttBeforeDependencyChangeAction;
  readonly dependencyId: DependencyId | null;
  readonly dependency: DependencyEntity;
  readonly previousDependency?: DependencyEntity
}

GanttBeforeAssignmentChangeAction

Kind of assignment mutation that triggered the before-change event.

ts
/** Kind of assignment mutation that triggered the before-change event. */
export type GanttBeforeAssignmentChangeAction =  'edit';

GanttBeforeAssignmentChangeDetail

Detail payload for the cancelable {@link GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT}. Call event.preventDefault() to block the change.

ts
interface GanttBeforeAssignmentChangeDetail {
  readonly action: GanttBeforeAssignmentChangeAction;
  readonly taskId: TaskId;
  readonly assignments: readonly AssignmentEntity[];
  readonly previousAssignments: readonly AssignmentEntity[]
}

GanttPanelResizeDetail

Payload emitted with each gantt-panel-resize event.

ts
interface GanttPanelResizeDetail {
  /** The current width of the gantt panel in pixels. */
    readonly width: number
}

GanttPanelResizePluginConfig

ts
interface GanttPanelResizePluginConfig {
  /**
     * Initial width of the gantt (colPinEnd) panel in pixels or as a percentage
     * of the grid width (e.g. `"40%"`).
     * Defaults to the current rendered width of the panel.
     */
    initialWidth?: number | string
}

GanttPanelResizePlugin

GanttPanelResizePlugin adds a drag handle on the left edge of the pinned-end (gantt chart) viewport, allowing the user to resize the split between the task-list columns (rgCol) and the gantt chart (colPinEnd).

Dragging the handle left expands the gantt panel; dragging right shrinks it. An gantt-panel-resize event is emitted on the revogrid element during and after each drag with { width: number } in its detail.

ts
class GanttPanelResizePlugin {
  /**
     * Programmatically set the gantt panel width.
     */
  setPanelWidth(width: number): void;

  /**
     * Returns the current gantt panel (colPinEnd) width in pixels, or null if
     * the viewport is not yet rendered.
     */
  getPanelWidth(): number | null;
}

GanttPlugin

ts
class GanttPlugin {
  applyGantt(config?: GanttPluginConfig);

  clearGantt();

  zoomIn(): boolean;

  zoomOut(): boolean;

  setZoomLevel(levelId: string): boolean;

  getZoomLevel();

  canZoomIn(): boolean;

  canZoomOut(): boolean;

  getVisibleRange();

  createTask(options?: GanttCreateTaskOptions): TaskId | null;

  indentTask(taskId?: TaskId): TaskId | null;

  outdentTask(taskId?: TaskId): TaskId | null;
}

GanttPluginConfig

Top-level configuration for the {@link GanttPlugin}. Pass this object to the grid element's gantt property.

ts
interface GanttPluginConfig {
  // Project metadata (required)
    /** Unique project identifier. */
    readonly id: EntityId;
  /** Project display name. */
    readonly name: string;
  /** Project data schema version. */
    readonly version: string;
  /** Currency code for cost calculations (e.g. `\"USD\"`). */
    readonly currency: string;
  /** Default IANA time zone (e.g. `\"America/New_York\"`). */
    readonly timeZone: string;
  /** Calendar used by default for new tasks. */
    readonly primaryCalendarId: CalendarId;
  /** Timestamp of last project modification. */
    readonly updatedAt: ISODateTimeString;
  // Configuration (all optional)
    /** Pre-defined zoom level — see {@link TimelineZoomPreset}. */
    readonly zoomPreset?: TimelineZoomPreset;
  /** Advanced zoom configuration overriding the preset. */
    readonly zoom?: TimelineZoomConfig;
  /** Scheduling engine options. */
    readonly scheduling?: GanttSchedulingConfig;
  /** When `true`, users can create new tasks from the timeline. */
    readonly allowTaskCreate?: boolean;
  /** Restricts which dependency types the user may create. */
    readonly allowedDependencyTypes?: readonly DependencyType[];
  /** Filters the resource list to only show selected resources. */
    readonly resourceFilterIds?: readonly ResourceId[];
  /** Visual appearance options — see {@link GanttVisualConfig}. */
    readonly visuals?: GanttVisualConfig
}

GanttSchedulingConfig

Scheduling engine configuration.

ts
interface GanttSchedulingConfig {
  /**
     * When enabled, task duration is evaluated in working days only,
     * excluding calendar holidays and non-working weekdays.
     */
    readonly excludeHolidaysFromDuration?: boolean
}

GanttTimeRange

A highlighted date range rendered as a coloured band on the timeline. Use to mark sprints, milestones windows, or other periods of interest.

ts
interface GanttTimeRange {
  /** Unique identifier. */
    readonly id: string;
  /** Range start date (inclusive). */
    readonly startDate: ISODateString;
  /** Range end date (inclusive). */
    readonly endDate: ISODateString;
  /** Optional label displayed inside the range band. */
    readonly label?: string;
  /** Optional CSS colour for the range band. */
    readonly color?: string
}

GanttTaskMarker

A visual marker pinned to a specific date on a task bar. Use to flag deadlines, constraints, or custom indicators.

ts
interface GanttTaskMarker {
  /** Unique identifier. */
    readonly id: string;
  /** Date the marker is pinned to. */
    readonly date: ISODateString;
  /** Tooltip or label text. */
    readonly label?: string;
  /** Optional CSS class name for custom styling. */
    readonly className?: string
}

GanttTaskMarkerHook

Callback that produces per-task markers for the timeline. Invoked by the rendering pipeline for each visible task.

ts
/**
 * Callback that produces per-task markers for the timeline.
 * Invoked by the rendering pipeline for each visible task.
 */
export type GanttTaskMarkerHook =  (task: {
  readonly id: TaskId;
  readonly startDate: ISODateString;
  readonly endDate: ISODateString;
  readonly deadlineDate?: ISODateString;
  readonly constraintType?: string;
  readonly constraintDate?: ISODateString;
}) => readonly GanttTaskMarker[];

GanttMilestoneLine

A vertical flag line pinned to a specific date on the gantt timeline. Shows a cap/flag at the top of the canvas and a full-height vertical line.

ts
interface GanttMilestoneLine {
  /** Unique identifier. */
    readonly id: string;
  /** Date the line is pinned to. */
    readonly date: ISODateString;
  /** Label displayed on the flag cap. */
    readonly label?: string;
  /** Optional CSS color for the line and flag (defaults to CSS variable). */
    readonly color?: string
}

GanttVisualConfig

Controls visual overlays and decorations on the Gantt timeline.

ts
interface GanttVisualConfig {
  /** Show baseline bars beneath task bars for comparison. */
    readonly showBaseline?: boolean;
  /** Highlight tasks on the critical path. */
    readonly showCriticalPath?: boolean;
  /** Display task names as labels on the timeline bars. */
    readonly showTaskLabels?: boolean;
  /** Which baseline snapshot to display (defaults to the latest). */
    readonly baselineId?: BaselineId;
  /** Vertical "today" or status-date line on the timeline. */
    readonly projectLineDate?: ISODateString;
  /** Highlighted date ranges on the timeline background. */
    readonly timeRanges?: readonly GanttTimeRange[];
  /** Shade non-working days (weekends, holidays) on the timeline. */
    readonly shadeNonWorkingTime?: boolean;
  /**
     * Show a "today" flag line on the timeline.
     * Set to `false` to disable. Enabled by default when not specified.
     */
    readonly showTodayLine?: boolean;
  /** Custom vertical flag lines on the timeline (e.g. sprint starts, release dates). */
    readonly milestoneLines?: readonly GanttMilestoneLine[];
  /** Hook to produce custom markers on individual task bars. */
    readonly taskMarkerHook?: GanttTaskMarkerHook
}

GanttCreateTaskOptions

Options for programmatic task creation via the {@link GANTT_TASK_CREATE_EVENT} event.

ts
interface GanttCreateTaskOptions {
  /** Parent task id, or `null` for a root-level task. */
    readonly parentId?: TaskId | null;
  /** Insert the new task after this sibling. */
    readonly insertAfterTaskId?: TaskId | null;
  /** Initial start date. */
    readonly startDate?: ISODateString;
  /** Initial end date. */
    readonly endDate?: ISODateString;
  /** Initial task name. */
    readonly name?: string
}

createTaskGridScaleConfig

Build the timeline scale configuration from a scheduling result and zoom level.

Determines the visible date range, creates the timeline scale, and derives the header rows, ticks, bands, and visible range for the gantt view-model.

@param schedulingResult - The output of the scheduling engine. * @param zoomLevelOrPreset - A concrete zoom level descriptor or a named preset string. * @param locale - BCP 47 locale tag used for date formatting (default "en-US"). * @param defaultHeaderFormatter - Optional custom formatter for header cell labels. * @returns A TaskGridScaleConfig ready for rendering.

ts
export function createTaskGridScaleConfig(
  schedulingResult: SchedulingResult,
  zoomLevelOrPreset: TimelineZoomLevel | TimelineZoomPreset,
  locale = 'en-US',
  defaultHeaderFormatter?: TimelineDateFormatter,
): TaskGridScaleConfig;

createTaskGridSource

Project tasks into grid rows using a pre-built timeline scale.

@param project - The resolved project snapshot. * @param taskStore - The task store providing the ordered task list. * @param resourceStore - The resource store for resource name lookups. * @param assignmentStore - The assignment store for task–resource links. * @param scale - The timeline scale used for coordinate projection. * @param schedulingResult - The scheduling engine output. * @param projectionOptions - Optional overrides for row projection behaviour. * @returns An array of data rows suitable for the grid source.

ts
export function createTaskGridSource(
  project: ProjectSnapshot,
  taskStore: TaskStore,
  resourceStore: ResourceStore,
  assignmentStore: AssignmentStore,
  scale: TimelineScale,
  schedulingResult: SchedulingResult,
  projectionOptions: TaskRowProjectionOptions =;

createTaskGridConfig

One-shot helper that runs the scheduling engine_and_ builds the full grid configuration (scale + projected rows) in a single call.

@param project - The resolved project snapshot. * @param taskStore - Task store instance. * @param resourceStore - Resource store instance. * @param assignmentStore - Assignment store instance. * @param zoomLevel - Zoom level descriptor or named preset. * @param schedulerEngine - Optional pre-configured scheduler engine. * @param locale - BCP 47 locale tag (default "en-US"). * @param defaultHeaderFormatter - Optional custom header formatter. * @param projectionOptions - Optional row projection overrides. * @returns A complete TaskGridConfig.

ts
export function createTaskGridConfig(
  project: ProjectSnapshot,
  taskStore: TaskStore,
  resourceStore: ResourceStore,
  assignmentStore: AssignmentStore,
  zoomLevel: TimelineZoomLevel | TimelineZoomPreset,
  schedulerEngine: SchedulerEngine = createSchedulerEngine(),
  locale = 'en-US',
  defaultHeaderFormatter?: TimelineDateFormatter,
  projectionOptions: TaskRowProjectionOptions =;

TaskGridScaleConfig

Pre-computed timeline scale and view-model for the gantt grid.

ts
interface TaskGridScaleConfig {
  /** The timeline scale instance used for coordinate calculations. */
    readonly scale: TimelineScale;
  /** The derived view-model consumed by the gantt column type renderer. */
    readonly timeline: GanttTimelineViewModel;
  /** ISO date string of the timeline start boundary. */
    readonly startDate: ISODateString;
  /** ISO date string of the timeline end boundary. */
    readonly endDate: ISODateString
}

TaskGridConfig

Complete grid configuration bundle containing projected row data, the timeline scale config, and scheduling results.

ts
interface TaskGridConfig {
  /** The projected grid rows (one per visible task). */
    readonly source: readonly DataType[];
  /** Timeline scale configuration for the gantt column. */
    readonly scale: TaskGridScaleConfig;
  /** Scheduling engine output. */
    readonly scheduling: SchedulingResult
}

TaskRowProjectionOptions

Options controlling which optional data layers are included in the task row projection.

ts
interface TaskRowProjectionOptions {
  /** Show baseline overlay bars when baseline data is available. */
    readonly showBaseline?: boolean;
  /** Highlight tasks on the critical path. */
    readonly showCriticalPath?: boolean;
  /** Render inline task name labels on Gantt bars. */
    readonly showTaskLabels?: boolean;
  /** Specific baseline snapshot to compare against. Uses the latest baseline when omitted. */
    readonly baselineId?: BaselineId;
  /** Hook to inject custom point markers onto task rows. */
    readonly taskMarkerHook?: GanttTaskMarkerHook;
  /** When set, only tasks assigned to these resources (and their ancestors) are included. */
    readonly resourceFilterIds?: readonly ResourceId[]
}

OverlayKind

Discriminator for the category of overlay rendered on the gantt chart.

ts
/** Discriminator for the category of overlay rendered on the gantt chart. */
export type OverlayKind =  'selection' | 'baseline' | 'dependency' | 'annotation';

OverlayDescriptor

Describes a single overlay element rendered on top of the gantt chart.

ts
interface OverlayDescriptor {
  /** Unique identifier for this overlay instance. */
    readonly id: string;
  /** The category of overlay (selection, baseline, dependency, or annotation). */
    readonly kind: OverlayKind;
  /** The task this overlay is associated with, if any. */
    readonly taskId?: TaskId;
  /** Whether the overlay is currently visible. */
    readonly visible: boolean;
  /** CSS z-index controlling stacking order among overlays. */
    readonly zIndex: number;
  /** Optional anchor point in viewport coordinates for positioning. */
    readonly anchor?: ViewportPoint
}

OverlayManager

Registry for managing overlay elements displayed over the gantt chart.

Implementations are responsible for tracking overlay descriptors and providing ordered access for the rendering layer.

ts
interface OverlayManager {
  /** Return all registered overlay descriptors in display order. */
    list(): readonly OverlayDescriptor[];
  /** Register a new overlay or replace an existing one with the same id. */
    register(descriptor: OverlayDescriptor): void;
  /** Remove an overlay by its unique id. */
    unregister(overlayId: string): void;
  /** Remove all registered overlays. */
    clear(): void
}

createGanttColumn

Create the pinned-end gantt column definition.

This produces a single read-only column that spans the full timeline width and uses the gantt column type for rendering.

@param totalWidth - The total pixel width of the timeline. * @returns A ColumnRegular pinned to colPinEnd.

ts
export function createGanttColumn(totalWidth: number): ColumnRegular;

createDefaultTaskTableColumn

Look up a default task-table column definition by property name.

@param prop - The column property key (e.g. "wbs", "name"). * @returns A cloned ColumnRegular if a default exists, or null.

ts
export function createDefaultTaskTableColumn(prop: TaskTableColumnProp): ColumnRegular;

createInitialTaskTableColumns

Create the initial set of task-table columns shown before the user supplies custom columns.

@returns An array containing the WBS and Name columns.

ts
export function createInitialTaskTableColumns(): ColumnRegular[];

normalizePinnedTaskColumns

Normalize user-supplied columns for the task-table side of the gantt grid.

Strips any existing gantt column (it is managed internally), fills in missing properties from default column definitions, and falls back to the initial columns if the array is empty.

@param columns - The raw column array from the grid or user config. * @returns A cleaned array of columns ready to be combined with the gantt column.

ts
export function normalizePinnedTaskColumns(
  columns: Array<ColumnGrouping | ColumnRegular> | undefined,
): Array<ColumnGrouping | ColumnRegular>;

defaultTaskTableColumns

ts
defaultTaskTableColumns: {
  wbs: { readonly: true; prop: string; name: string; size: number; };
  name: { tree: true; editor: typeof TextEditor; prop: string; name: string; size: number; };
  startDate: { readonly: ({ model }: ColumnDataSchemaModel) => boolean; prop: string; name: string; size: number; columnType: "date"; required: boolean; };
  endDate: { readonly: ({ model }: ColumnDataSchemaModel) => boolean; prop: string; name: string; size: number; columnType: "date"; required: boolean; };
  duration: { readonly: ({ model }: ColumnDataSchemaModel) => boolean; editor: typeof TextEditor; prop: string; name: string; size: number; };
  percentDone: { editor: typeof TextEditor; prop: string; name: string; size: number; };
  predecessors: { editor: typeof TextEditor; prop: string; name: string; size: number; };
  successors: { editor: typeof TextEditor; prop: string; name: string; size: number; };
  status: { readonly: true; prop: string; name: string; size: number; };
  assignees: { editor: typeof TextEditor; prop: string; name: string; size: number; };
};

GanttViewportFrame

Dimensions and position of the gantt viewport element.

ts
interface GanttViewportFrame {
  /** Pixel width of the viewport. */
    readonly width: number;
  /** Pixel height of the viewport. */
    readonly height: number;
  /** Left offset of the viewport content area relative to the page. */
    readonly clientLeft: number;
  /** Top offset of the viewport content area relative to the page. */
    readonly clientTop: number
}

GanttViewportScrollState

Current scroll offsets of the gantt viewport.

ts
interface GanttViewportScrollState {
  /** Horizontal scroll offset in pixels. */
    readonly scrollLeft: number;
  /** Vertical scroll offset in pixels. */
    readonly scrollTop: number
}

GanttViewportSnapshot

Point-in-time snapshot of the gantt viewport's geometry, scroll position, DOM element reference, and currently visible rows.

ts
interface GanttViewportSnapshot {
  /** Viewport dimensions and position. */
    readonly frame: GanttViewportFrame;
  /** Current scroll offsets. */
    readonly scroll: GanttViewportScrollState;
  /** The underlying DOM element of the gantt viewport. */
    readonly element: HTMLElement;
  /** The virtual row items currently visible in the viewport. */
    readonly visibleRows: readonly VirtualPositionItem[]
}

GridUpdateMode

Describes how deeply the grid must be updated after a render cycle.

  • 'none' — no grid update needed.
  • 'data' — only row data payloads changed (in-place update).
  • 'structure' — row count or order changed (full data refresh).
ts
/**
 * Describes how deeply the grid must be updated after a render cycle.
 *
 * - `'none'` — no grid update needed.
 * - `'data'` — only row data payloads changed (in-place update).
 * - `'structure'` — row count or order changed (full data refresh).
 */
export type GridUpdateMode =  'none' | 'data' | 'structure';

GanttRenderContributions

Contributions a feature tool can provide before each render pass.

ts
interface GanttRenderContributions {
  /** Additional options influencing how task rows are projected. */
    readonly projectionOptions: TaskRowProjectionOptions
}

GanttToolGridEventMap

Map of internal grid events that feature tools can subscribe to.

ts
interface GanttToolGridEventMap {
  readonly viewportscroll: { detail: ViewPortScrollEvent };
  readonly gridedit: { detail: EventManagerEvent };
  readonly beforecellfocus: { previousTaskId: TaskId | null; taskId: TaskId };
  readonly keydown: { event: KeyboardEvent };
  readonly wheel: { event: WheelEvent };
  readonly aftersourceset: Record<string, never>;
  readonly contentsizechanged: Record<string, never>
}

GanttRenderState (Extended from index.ts)

Extended render result that includes the update mode indicating what changed since the previous frame.

ts
interface GanttRenderState {
  /** How deeply the grid was updated during this render. */
    readonly updateMode: GridUpdateMode
}

GanttCoordinatorContext

Central context object passed to every gantt feature tool.

Provides read access to the gantt project state, scheduling results, timeline model, and viewport geometry. Also exposes mutation helpers for row data, scrolling, and event dispatch.

ts
interface GanttCoordinatorContext {
  getConfig(): GanttPluginConfig | null;
  getResolvedProjectSnapshot(): ProjectSnapshot | null;
  getSchedulingResult(): SchedulingResult | null;
  getCurrentScale(): GanttGridRenderResult['scaleConfig']['scale'] | null;
  getTimeline(): GanttTimelineViewModel | null;
  setTimelineVisibleRange(visibleRange: TimelineVisibleDateRange): void;
  setTimelineFlagLines(lines: readonly TimelineFlagLine[]): void;
  getTaskStore(): TaskStore;
  getResourceStore(): ResourceStore;
  getAssignmentStore(): AssignmentStore;
  getDependencies(): readonly DependencyEntity[];
  getDependenciesById(): ReadonlyMap<DependencyId, DependencyEntity>;
  getProjectedRows(): readonly TaskGridRow[];
  getProjectedRow(taskId: TaskId): TaskGridRow | null;
  getVisibleProjectedRows(): readonly TaskGridRow[];
  getVisibleRowFrame(rowIndex: number): { top: number; height: number } | null;
  getVisibleTaskBarAnchor(taskId: TaskId): VisibleTaskBarAnchors | null;
  getGridVisibleTaskIds(): ReadonlySet<TaskId>;
  getGridVirtualRowIndex(taskId: TaskId): number | null;
  readViewport(): GanttViewportSnapshot | null;
  requestRender(updateMode?: GridUpdateMode): GanttGridRenderResult | null;
  applyRowData(rows: readonly DataType[]): void;
  applyRows(rows: readonly DataType[]): void;
  scrollToX(x: number): Promise<void>;
  emit<T>(eventName: string, detail: T): void;
  /**
     * Emit a cancelable event before a mutation.
     * Returns true if the mutation should proceed (event was not canceled),
     * false if the event was canceled via preventDefault().
     */
    emitCancelable<T>(eventName: string, detail: T): boolean
}

GanttFeatureTool

Lifecycle interface for a gantt feature tool.

Feature tools participate in the gantt render cycle and can react to grid events. Each tool is set up once, receives before/after render callbacks, and is destroyed when the plugin is torn down.

ts
interface GanttFeatureTool {
  setup?(context: GanttCoordinatorContext): void;
  beforeRender?(context: GanttCoordinatorContext): Partial<GanttRenderContributions> | void;
  afterRender?(context: GanttCoordinatorContext, renderState: GanttRenderState): void;
  onConfigChange?(context: GanttCoordinatorContext): void;
  onGridEvent?<T extends keyof GanttToolGridEventMap>(
      eventName: T,
      payload: GanttToolGridEventMap[T],
      context: GanttCoordinatorContext,
    ): boolean | void;
  destroy(): void
}

DependencyPreviewState

Transient state describing in-progress dependency drawing and hover/selection highlights.

ts
interface DependencyPreviewState {
  /** The draft dependency being drawn by the user, if any. */
    readonly draft: DependencyDragPreview | null;
  /** The id of the dependency currently under the pointer. */
    readonly hoveredDependencyId: DependencyId | null;
  /** The id of the dependency that is actively selected. */
    readonly selectedDependencyId: DependencyId | null
}

getContentX

Convert a pointer event's client X coordinate to a content-space X coordinate within the gantt viewport.

Accounts for the viewport's current horizontal scroll offset and the element's left edge position.

@param event - The pointer event providing the clientX value. * @param viewport - A snapshot of the gantt viewport geometry and scroll state. * @returns The X position in content (scrollable) coordinates.

ts
export function getContentX(event: PointerEvent, viewport: GanttViewportSnapshot): number;

createGanttBarLayout

Computes the pixel layout for a scheduled task's Gantt bar.

@param task - The engine-scheduled task with dates, type, and progress. * @param scale - The active timeline scale used to convert dates to pixel positions. * @param showCriticalPath - Whether to mark the bar as critical when the task is on the critical path. * @returns A {@link GanttBarLayout} with pixel coordinates and metadata.

ts
export function createGanttBarLayout(
  task: ScheduledTask,
  scale: TimelineScale,
  showCriticalPath = true,
): GanttBarLayout;

createBaselineBarLayout

Computes the pixel layout for a baseline bar overlay.

@param startDate - Baseline start date (ISO string). * @param endDate - Baseline end date (ISO string). * @param scale - The active timeline scale. * @returns A {@link GanttBaselineLayout} with x and width in pixels.

ts
export function createBaselineBarLayout(
  startDate: ISODateString,
  endDate: ISODateString,
  scale: TimelineScale,
): GanttBaselineLayout;

createIndicatorLayout

Creates a layout descriptor for a point indicator on the Gantt row.

@param id - Unique identifier for the indicator. * @param date - The date the indicator marks. * @param kind - Category of the indicator (deadline, constraint, or custom). * @param scale - The active timeline scale. * @param label - Optional display label. * @param className - Optional CSS class name. * @returns A {@link GanttIndicatorLayout} positioned on the timeline.

ts
export function createIndicatorLayout(
  id: string,
  date: ISODateString,
  kind: GanttIndicatorLayout['kind'],
  scale: TimelineScale,
  label?: string,
  className?: string,
): GanttIndicatorLayout;

GanttBarKind

Discriminator for the visual shape of a Gantt bar.

ts
/** Discriminator for the visual shape of a Gantt bar. */
export type GanttBarKind =  'task' | 'summary' | 'milestone';

GanttBaselineLayout

Layout coordinates for a baseline bar overlay.

ts
interface GanttBaselineLayout {
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Pixel width of the baseline bar. */
    readonly width: number
}

GanttIndicatorLayout

Layout descriptor for a single-point indicator (deadline, constraint, or custom marker) on the Gantt row.

ts
interface GanttIndicatorLayout {
  /** Unique identifier for this indicator instance. */
    readonly id: string;
  /** Category of the indicator. */
    readonly kind: 'deadline' | 'constraint' | 'custom';
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Optional display label shown on hover or beside the indicator. */
    readonly label?: string;
  /** Optional CSS class name applied to the indicator element. */
    readonly className?: string
}

GanttBarLayout

Computed pixel layout for a single Gantt task bar, including progress and critical-path metadata.

ts
interface GanttBarLayout {
  /** Visual shape type of the bar. */
    readonly kind: GanttBarKind;
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Pixel width of the bar (minimum-clamped). */
    readonly width: number;
  /** Pixel width of the filled progress portion inside the bar. */
    readonly progressWidth: number;
  /** Horizontal center X used for milestone diamond rendering. */
    readonly milestoneCenterX: number;
  /** Whether this task lies on the critical path. */
    readonly isCritical: boolean;
  /** Total slack (float) available before the task delays the project. */
    readonly totalSlackDays: number
}

projectVisibleTaskBarAnchors

Projects viewport-relative anchor points for every task bar visible in the current viewport. Used to position dependency arrow endpoints.

@param projection - Viewport state and row data needed for the projection. * @returns An array of {@link VisibleTaskBarAnchors} for each visible task bar.

ts
export function projectVisibleTaskBarAnchors(
  projection: VisibleTaskBarProjection,
): readonly VisibleTaskBarAnchors[];

TaskBarAnchorPoint

A 2D point in viewport-relative coordinates.

ts
interface TaskBarAnchorPoint {
  /** Horizontal pixel coordinate. */
    readonly x: number;
  /** Vertical pixel coordinate. */
    readonly y: number
}

VisibleTaskBarAnchors

Viewport-relative anchor points and bounds for a visible task bar, used for dependency line routing.

ts
interface VisibleTaskBarAnchors {
  /** Identifier of the task this anchor set belongs to. */
    readonly taskId: TaskId;
  /** Row index of the task within the data source. */
    readonly rowIndex: number;
  /** Top edge of the row in viewport pixels. */
    readonly top: number;
  /** Bottom edge of the row in viewport pixels. */
    readonly bottom: number;
  /** Left edge of the bar in viewport pixels. */
    readonly left: number;
  /** Right edge of the bar in viewport pixels. */
    readonly right: number;
  /** Anchor point at the start (left) side of the bar, offset for dependency arrows. */
    readonly start: TaskBarAnchorPoint;
  /** Anchor point at the end (right) side of the bar, offset for dependency arrows. */
    readonly end: TaskBarAnchorPoint;
  /** Anchor point centered above the bar. */
    readonly topCenter: TaskBarAnchorPoint;
  /** Anchor point centered below the bar. */
    readonly bottomCenter: TaskBarAnchorPoint
}

VisibleTaskBarProjection

Input data required to project visible task bar anchors within the current viewport.

ts
interface VisibleTaskBarProjection {
  /** All task grid rows (full dataset). */
    readonly rows: readonly TaskGridRow[];
  /** Virtual position items describing which rows are currently visible. */
    readonly viewportRows: readonly VirtualPositionItem[];
  /** Current horizontal scroll offset in pixels. */
    readonly scrollLeft: number;
  /** Current vertical scroll offset in pixels. */
    readonly scrollTop: number;
  /** Width of the visible viewport in pixels. */
    readonly viewportWidth: number;
  /** Height of the visible viewport in pixels. */
    readonly viewportHeight: number
}

normalizeTimelineHeaderLabel

Normalizes a header label to the structured {@link TimelineHeaderLabelParts} form.

@param label - A plain string or structured label. * @returns The label as a { label, subLabel } object.

ts
export function normalizeTimelineHeaderLabel(label: TimelineHeaderLabel): TimelineHeaderLabelParts;

TimelineUnit

Supported calendar units for the timeline grid.

ts
/** Supported calendar units for the timeline grid. */
export type TimelineUnit =  'day' | 'week' | 'month' | 'quarter' | 'year';

TimelineHeaderLabelParts

Structured label with an optional secondary line for timeline header cells.

ts
interface TimelineHeaderLabelParts {
  /** Primary display text. */
    readonly label: string;
  /** Optional secondary text rendered below or beside the label. */
    readonly subLabel?: string
}

TimelineHeaderLabel

A header cell label — either a plain string or a structured label with sub-text.

ts
/** A header cell label — either a plain string or a structured label with sub-text. */
export type TimelineHeaderLabel =  string | TimelineHeaderLabelParts;

TimelineDateFormatterContext

Context passed to a custom date formatter when rendering a timeline header cell.

ts
interface TimelineDateFormatterContext {
  /** Zoom level identifier that owns this header. */
    readonly levelId: string;
  /** Identifier of the header row being rendered. */
    readonly rowId: string;
  /** Calendar unit of this header row. */
    readonly unit: TimelineUnit;
  /** Number of units each cell spans. */
    readonly count: number;
  /** Active locale string (e.g. "en-US"). */
    readonly locale: string;
  /** Zero-based index of this row within the header stack. */
    readonly rowIndex: number;
  /** Whether this is the bottom (leaf / tick) row. */
    readonly isLeafRow: boolean
}

TimelineDateFormatter

Custom formatter function used to produce the label for a single timeline header cell.

@param startDate - Cell start date (ISO string). * @param endDate - Cell end date (ISO string). * @param context - Rendering context with unit, locale, and positional info. * @returns A label string or structured label parts.

ts
/**
 * Custom formatter function used to produce the label for a single timeline header cell.
 *
 * @param startDate - Cell start date (ISO string).
 * @param endDate - Cell end date (ISO string).
 * @param context - Rendering context with unit, locale, and positional info.
 * @returns A label string or structured label parts.
 */
export type TimelineDateFormatter =  (
  startDate: ISODateString,
  endDate: ISODateString,
  context: TimelineDateFormatterContext,
) => TimelineHeaderLabel;

TimelineHeaderRowConfig

Configuration for a single row in the timeline header stack.

ts
interface TimelineHeaderRowConfig {
  /** Unique identifier for this header row. */
    readonly id: string;
  /** Calendar unit this row represents. */
    readonly unit: TimelineUnit;
  /** Number of units each cell spans (defaults to 1). */
    readonly count?: number;
  /** Optional custom formatter overriding the default label logic. */
    readonly formatter?: TimelineDateFormatter
}

TimelineHeaderCell

A single rendered cell within a timeline header row.

ts
interface TimelineHeaderCell {
  /** Unique key for React/framework reconciliation. */
    readonly key: string;
  /** Start date of the interval this cell covers (ISO string). */
    readonly startDate: ISODateString;
  /** End date (inclusive) of the interval this cell covers (ISO string). */
    readonly endDate: ISODateString;
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Pixel width of the cell. */
    readonly width: number;
  /** Primary display text. */
    readonly label: string;
  /** Secondary display text (may be empty). */
    readonly subLabel: string
}

TimelineHeaderRowModel

Fully resolved model for a single header row, including its computed cells.

ts
interface TimelineHeaderRowModel {
  /** Identifier matching the originating {@link TimelineHeaderRowConfig.id}. */
    readonly id: string;
  /** Calendar unit of this row. */
    readonly unit: TimelineUnit;
  /** Number of units each cell spans. */
    readonly count: number;
  /** Ordered array of rendered header cells. */
    readonly cells: readonly TimelineHeaderCell[]
}

createTimelineScale

Creates a {@link TimelineScale} from the given configuration.

@param config - Scale configuration specifying date range, tick unit, and header rows. * @returns A fully initialized timeline scale instance.

ts
export function createTimelineScale(config: TimelineScaleConfig): TimelineScale;

getZoomPresetConfig

Returns the scale configuration fields for a named zoom preset.

@param preset - One of the predefined zoom preset identifiers. * @returns A partial {@link TimelineScaleConfig} with tick and header settings.

ts
export function getZoomPresetConfig(
  preset: TimelineZoomPreset,
): Pick<TimelineScaleConfig, 'levelId' | 'tickUnit' | 'tickCount' | 'tickWidth' | 'headerRows'>;

getProjectTimelineRange

Computes a start/end date range that encloses all provided dates with padding appropriate for the given zoom level or preset.

@param dates - Array of ISO date strings to encompass. * @param zoomLevelOrPreset - A zoom level object or preset identifier. * @returns A { startDate, endDate } range with timeline padding.

ts
export function getProjectTimelineRange(
  dates: readonly ISODateString[],
  zoomLevelOrPreset: TimelineZoomLevel | TimelineZoomPreset,
): Pick<TimelineScaleConfig, 'startDate' | 'endDate'>;

TimelineTickUnit

Calendar unit used for the leaf-level tick grid.

ts
/** Calendar unit used for the leaf-level tick grid. */
export type TimelineTickUnit =  TimelineUnit;

TimelineBandUnit

Calendar unit used for the grouping band row (excludes 'day').

ts
/** Calendar unit used for the grouping band row (excludes 'day'). */
export type TimelineBandUnit =  Exclude<TimelineUnit, 'day'>;

TimelineZoomPreset

Named presets mapping to entries in {@link DEFAULT_TIMELINE_ZOOM_LEVELS}.

ts
/** Named presets mapping to entries in {@link DEFAULT_TIMELINE_ZOOM_LEVELS}. */
export type TimelineZoomPreset = 
  | 'day-week'
  | 'week-month'
  | 'month-quarter'
  | 'quarter-year'
  | 'year-quarter'
  | 'multi-year-quarter';

TimelineTick

A single tick cell on the leaf row of the timeline.

ts
interface TimelineTick {
  /** Unique key for reconciliation. */
    readonly key: string;
  /** Start date of the tick interval (ISO string). */
    readonly startDate: ISODateString;
  /** End date of the tick interval (ISO string). */
    readonly endDate: ISODateString;
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Pixel width of the tick cell. */
    readonly width: number;
  /** Primary display label. */
    readonly label: string;
  /** Secondary display label. */
    readonly subLabel: string
}

TimelineBand

A grouping band cell on an upper row of the timeline header.

ts
interface TimelineBand {
  /** Unique key for reconciliation. */
    readonly key: string;
  /** Start date of the band interval (ISO string). */
    readonly startDate: ISODateString;
  /** End date of the band interval (ISO string). */
    readonly endDate: ISODateString;
  /** Horizontal pixel offset from the timeline origin. */
    readonly x: number;
  /** Pixel width of the band cell. */
    readonly width: number;
  /** Display label. */
    readonly label: string
}

TimelineScaleConfig

Configuration used to construct a {@link TimelineScale} instance.

ts
interface TimelineScaleConfig {
  /** Project timeline start date (ISO string). */
    readonly startDate: ISODateString;
  /** Project timeline end date (ISO string). */
    readonly endDate: ISODateString;
  /** Optional zoom level identifier to look up in the default levels. */
    readonly levelId?: string;
  /** Calendar unit for the leaf tick row (overrides zoom level when set). */
    readonly tickUnit?: TimelineTickUnit;
  /** Number of tick units each cell spans. */
    readonly tickCount?: number;
  /** Calendar unit for the grouping band row. */
    readonly bandUnit?: TimelineBandUnit;
  /** Pixel width of a single tick cell. */
    readonly tickWidth: number;
  /** Header row definitions (overrides zoom level rows when set). */
    readonly headerRows?: readonly TimelineHeaderRowConfig[];
  /** Locale string for date formatting (defaults to "en-US"). */
    readonly locale?: string;
  /** Fallback date formatter applied when no row-level formatter is set. */
    readonly defaultHeaderFormatter?: TimelineDateFormatter
}

TimelineScale

Core abstraction for converting between dates and pixel positions on the Gantt timeline. Provides tick/band generation and header row models.

ts
interface TimelineScale {
  /** First date of the timeline range (ISO string). */
    readonly startDate: ISODateString;
  /** Last date of the timeline range (ISO string). */
    readonly endDate: ISODateString;
  /** Zoom level configuration that produced this scale. */
    readonly zoomLevel: TimelineZoomLevel;
  /** Calendar unit of the leaf tick row. */
    readonly tickUnit: TimelineTickUnit;
  /** Number of calendar units per tick cell. */
    readonly tickCount: number;
  /** Pixel width of a single tick cell. */
    readonly tickWidth: number;
  /** Total pixel width of the entire timeline. */
    readonly totalWidth: number;
  /**
     * Converts a date to a horizontal pixel offset.
     * @param date - ISO date string.
     */
    dateToX(date: ISODateString): number;
  /**
     * Converts a horizontal pixel offset to the nearest date.
     * @param x - Pixel offset from the timeline origin.
     */
    xToDate(x: number): ISODateString;
  /** Returns all tick cells across the full timeline range. */
    getTicks(): readonly TimelineTick[];
  /**
     * Returns tick cells visible within the given horizontal viewport slice.
     * @param startX - Left edge pixel offset.
     * @param viewportWidth - Width of the visible area.
     */
    getVisibleTicks(startX: number, viewportWidth: number): readonly TimelineTick[];
  /** Returns all band (grouping) cells. */
    getBands(): readonly TimelineBand[];
  /** Returns the computed header row models for rendering. */
    getHeaderRows(): readonly TimelineHeaderRowModel[];
  /**
     * Returns the date range visible within the given horizontal viewport slice.
     * @param startX - Left edge pixel offset.
     * @param viewportWidth - Width of the visible area.
     */
    getVisibleRange(startX: number, viewportWidth: number): TimelineVisibleDateRange
}

TimelineZoomController

Manages the active zoom level and zoom transitions for the Gantt timeline. Provides discrete zoom-in/out operations, level selection, and anchor-based scroll position computation to maintain visual continuity across zoom changes.

ts
class TimelineZoomController {
  /**
     * Replaces the zoom configuration, preserving the current level when possible.
     * @param config - New zoom configuration.
     * @param fallbackLevelId - Fallback level ID if the previous level is not in the new config.
     */
  setConfig(config?: TimelineZoomConfig, fallbackLevelId?: string);

  /** Returns the resolved zoom configuration. */
  getConfig(): ResolvedTimelineZoomConfig;

  /** Returns the currently active zoom level. */
  getZoomLevel(): TimelineZoomLevel;

  /** Returns the last computed visible date range, or `null` if not yet updated. */
  getVisibleRange():;

  /**
     * Recalculates and caches the visible date range from the current scroll position.
     * @param scale - Active timeline scale.
     * @param scrollLeft - Current horizontal scroll offset.
     * @param viewportWidth - Width of the visible area.
     * @returns The updated visible date range.
     */
  updateVisibleRange(scale: TimelineScale, scrollLeft: number, viewportWidth: number):;

  /** Returns `true` if zooming in (finer detail) is possible. */
  canZoomIn(): boolean;

  /** Returns `true` if zooming out (coarser detail) is possible. */
  canZoomOut(): boolean;

  /** Zooms in one level. Returns `true` if the level changed. */
  zoomIn(): boolean;

  /** Zooms out one level. Returns `true` if the level changed. */
  zoomOut(): boolean;

  /**
     * Jumps to a specific zoom level by ID.
     * @param levelId - Target zoom level identifier.
     * @returns `true` if the level changed.
     */
  setZoomLevel(levelId: string): boolean;

  /**
     * Prepares a zoom transition descriptor that can be applied to update the
     * scroll position so the anchor date stays visually stable.
     *
     * @param nextLevelId - Target zoom level identifier.
     * @param context - Current viewport and pointer context for anchor calculation.
     * @returns A {@link TimelineZoomTransition}, or `null` if no change occurred.
     */
  createZoomTransition(
    nextLevelId: string,
    context: TimelineZoomAnchorContext,
  ): TimelineZoomTransition | null;

  /**
     * Computes the scroll-left position that keeps an anchor date at a fixed viewport offset.
     *
     * @param scale - The timeline scale for the new zoom level.
     * @param anchorDate - The date that should remain visually anchored.
     * @param anchorOffset - Pixel offset from the viewport left edge where the anchor date should appear.
     * @returns The scroll-left value to apply.
     */
  resolveAnchoredScrollLeft(
    scale: TimelineScale,
    anchorDate: ISODateString,
    anchorOffset: number,
  ): number;
}

normalizeTimelineZoomConfig

Normalizes a partial zoom config into a fully resolved configuration with defaults applied.

@param config - Optional user-supplied zoom configuration. * @param fallbackLevelId - Level ID to use as the default when the config does not specify one. * @returns A {@link ResolvedTimelineZoomConfig} with all fields populated.

ts
export function normalizeTimelineZoomConfig(
  config: TimelineZoomConfig | undefined,
  fallbackLevelId = FALLBACK_ZOOM_LEVEL.id,
): ResolvedTimelineZoomConfig;

TimelineZoomMode

Strategy for transitioning between zoom levels.

ts
/** Strategy for transitioning between zoom levels. */
export type TimelineZoomMode =  'discrete' | 'smooth-discrete';

WheelZoomTrigger

Modifier key that must be held to trigger wheel-based zoom.

ts
/** Modifier key that must be held to trigger wheel-based zoom. */
export type WheelZoomTrigger =  'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'none';

ZoomAnchorMode

Anchor strategy determining which viewport position stays fixed during zoom.

ts
/** Anchor strategy determining which viewport position stays fixed during zoom. */
export type ZoomAnchorMode =  'pointer' | 'center' | 'start';

TimelineVisibleSpan

Describes a time span used for minimum/maximum visible range constraints.

ts
interface TimelineVisibleSpan {
  /** Calendar unit of the span. */
    readonly unit: 'day' | 'month' | 'year';
  /** Number of units. */
    readonly value: number
}

TimelineZoomLevel

Definition of a single zoom level, specifying tick granularity and header layout.

ts
interface TimelineZoomLevel {
  /** Unique level identifier (e.g. "day-week"). */
    readonly id: string;
  /** Calendar unit for the leaf tick row. */
    readonly tickUnit: TimelineUnit;
  /** Number of tick units per cell (defaults to 1). */
    readonly tickCount?: number;
  /** Pixel width of a single tick cell. */
    readonly tickWidth: number;
  /** Header row definitions for this level. */
    readonly headerRows: readonly TimelineHeaderRowConfig[];
  /** Optional minimum visible time span constraint. */
    readonly minVisibleSpan?: TimelineVisibleSpan;
  /** Optional maximum visible time span constraint. */
    readonly maxVisibleSpan?: TimelineVisibleSpan;
  /** Human-readable label for UI display. */
    readonly label?: string;
  /**
     * Per-zoom-level highlight overrides.
     */
    highlightVisibility?: TimelineHighlightVisibility
}

TimelineZoomConfig

User-facing zoom configuration. All fields are optional and fall back to sensible defaults.

ts
interface TimelineZoomConfig {
  /** Whether zoom functionality is enabled. */
    readonly enabled?: boolean;
  /** Ordered list of zoom levels from finest to coarsest. */
    readonly levels?: readonly TimelineZoomLevel[];
  /** Level ID to activate initially. */
    readonly defaultLevelId?: string;
  /** Finest (most detailed) level ID allowed. */
    readonly minLevelId?: string;
  /** Coarsest level ID allowed. */
    readonly maxLevelId?: string;
  /** Locale string for date formatting (e.g. "en-US"). */
    readonly locale?: string;
  /** Whether to shade non-working time columns. */
    readonly shadeNonWorkingTime?: boolean;
  /** Whether mouse wheel zoom is enabled. */
    readonly wheelZoomEnabled?: boolean;
  /** Modifier key required for wheel zoom. */
    readonly wheelZoomTrigger?: WheelZoomTrigger;
  /** Zoom transition mode. */
    readonly wheelZoomMode?: TimelineZoomMode;
  /** Anchor strategy during zoom transitions. */
    readonly zoomAnchorMode?: ZoomAnchorMode;
  /** Whether to invert the wheel scroll direction for zoom. */
    readonly invertWheelDirection?: boolean;
  /** Fallback date formatter for header cells. */
    readonly defaultHeaderFormatter?: TimelineDateFormatter
}

ResolvedTimelineZoomConfig

Fully resolved zoom configuration with all defaults applied.

ts
interface ResolvedTimelineZoomConfig {
  /** Whether zoom functionality is enabled. */
    readonly enabled: boolean;
  /** Ordered list of available zoom levels. */
    readonly levels: readonly TimelineZoomLevel[];
  /** Active default level ID. */
    readonly defaultLevelId: string;
  /** Finest allowed level ID. */
    readonly minLevelId: string;
  /** Coarsest allowed level ID. */
    readonly maxLevelId: string;
  /** Resolved locale string. */
    readonly locale: string;
  /** Whether non-working time shading is enabled. */
    readonly shadeNonWorkingTime: boolean | undefined;
  /** Whether wheel zoom is enabled. */
    readonly wheelZoomEnabled: boolean;
  /** Required modifier key for wheel zoom. */
    readonly wheelZoomTrigger: WheelZoomTrigger;
  /** Zoom transition mode. */
    readonly wheelZoomMode: TimelineZoomMode;
  /** Anchor strategy during zoom. */
    readonly zoomAnchorMode: ZoomAnchorMode;
  /** Whether wheel direction is inverted. */
    readonly invertWheelDirection: boolean;
  /** Default header date formatter, if any. */
    readonly defaultHeaderFormatter: TimelineDateFormatter | undefined
}

TimelineVisibleDateRange

A start/end date range representing the currently visible portion of the timeline.

ts
interface TimelineVisibleDateRange {
  /** First visible date (ISO string). */
    readonly startDate: ISODateString;
  /** Last visible date (ISO string). */
    readonly endDate: ISODateString
}

TimelineWheelInput

Raw wheel event data used to determine zoom direction and trigger eligibility.

ts
interface TimelineWheelInput {
  /** Vertical scroll delta from the wheel event. */
    readonly deltaY: number;
  /** Whether the Ctrl key was held. */
    readonly ctrlKey?: boolean;
  /** Whether the Meta (Cmd) key was held. */
    readonly metaKey?: boolean;
  /** Whether the Alt key was held. */
    readonly altKey?: boolean;
  /** Whether the Shift key was held. */
    readonly shiftKey?: boolean
}

TimelineZoomAnchorContext

Viewport and pointer context used to calculate the zoom anchor position.

ts
interface TimelineZoomAnchorContext {
  /** Active timeline scale instance. */
    readonly scale: TimelineScale;
  /** Current horizontal scroll offset in pixels. */
    readonly scrollLeft: number;
  /** Width of the visible viewport in pixels. */
    readonly viewportWidth: number;
  /** Left edge of the viewport element in client coordinates (for pointer anchor). */
    readonly viewportClientLeft?: number;
  /** Pointer X position in client coordinates (for pointer anchor). */
    readonly pointerClientX?: number
}

TimelineZoomTransition

Describes a pending zoom level transition, including the anchor date used to preserve scroll position.

ts
interface TimelineZoomTransition {
  /** Zoom level before the transition. */
    readonly previousLevel: TimelineZoomLevel;
  /** Zoom level after the transition. */
    readonly nextLevel: TimelineZoomLevel;
  /** Date that should remain at the anchor offset after zoom. */
    readonly anchorDate: ISODateString;
  /** Pixel offset from the viewport left where the anchor date should appear. */
    readonly anchorOffset: number;
  /** Scroll-left at the time the transition was initiated. */
    readonly scrollLeft: number
}

TimelineHighlightVisibility

ts
interface TimelineHighlightVisibility {
  weekends?: boolean;
  holidays?: boolean
}

DEFAULT_SMOOTH_WHEEL_THRESHOLD

Pixel threshold for accumulated smooth-wheel deltas before triggering a zoom step.

ts
DEFAULT_SMOOTH_WHEEL_THRESHOLD: 96;

DEFAULT_TIMELINE_ZOOM_LEVELS

Built-in set of zoom levels ordered from finest (day) to coarsest (multi-year).

ts
DEFAULT_TIMELINE_ZOOM_LEVELS: readonly TimelineZoomLevel[];

FALLBACK_ZOOM_LEVEL

Default zoom level used when no levels are configured. Falls back to the first entry of {@link DEFAULT_TIMELINE_ZOOM_LEVELS}.

ts
FALLBACK_ZOOM_LEVEL: TimelineZoomLevel;

getLevelById

Finds a zoom level by its ID.

@param levels - Available zoom levels. * @param levelId - ID to search for. * @returns The matching level, or null if not found.

ts
export function getLevelById(levels: readonly TimelineZoomLevel[], levelId: string | undefined): TimelineZoomLevel | null;

getLevelIndex

Returns the index of a zoom level by ID, or 0 if not found.

@param levels - Available zoom levels. * @param levelId - ID to search for. * @returns Zero-based index into the levels array.

ts
export function getLevelIndex(levels: readonly TimelineZoomLevel[], levelId: string): number;

clampLevelIndex

Clamps a level index to the allowed range defined by min/max level IDs.

@param levels - Available zoom levels. * @param index - Proposed level index. * @param minLevelId - Finest allowed level ID. * @param maxLevelId - Coarsest allowed level ID. * @returns The clamped index.

ts
export function clampLevelIndex(
  levels: readonly TimelineZoomLevel[],
  index: number,
  minLevelId: string,
  maxLevelId: string,
): number;

getAnchorOffset

Computes the viewport-relative anchor offset based on the active anchor mode.

@param anchorMode - The anchor strategy ('pointer', 'center', or 'start'). * @param context - Current viewport and pointer context. * @returns Pixel offset from the viewport left edge.

ts
export function getAnchorOffset(
  anchorMode: string,
  context: TimelineZoomAnchorContext,
): number;

getNextScrollLeft

Computes the scroll-left position that places an anchor date at a given viewport offset.

@param scale - The timeline scale instance. * @param anchorDate - ISO date string to anchor. * @param anchorOffset - Desired pixel offset from the viewport left edge. * @returns The scroll-left value (minimum 0).

ts
export function getNextScrollLeft(
  scale: TimelineScale,
  anchorDate: ISODateString,
  anchorOffset: number,
): number;

shouldHandleWheelTrigger

Determines whether a wheel event should trigger a zoom action based on the configured modifier key.

@param trigger - The required modifier key. * @param input - Raw wheel event data. * @returns true if the trigger condition is met.

ts
export function shouldHandleWheelTrigger(trigger: WheelZoomTrigger, input: TimelineWheelInput): boolean;

resolveHighlightVisibility

ts
export function resolveHighlightVisibility(
  zoom: TimelineZoomLevel,
): Required<TimelineHighlightVisibility>;

ViewportPoint

A point in viewport-relative coordinates.

ts
interface ViewportPoint {
  /** Horizontal pixel coordinate. */
    readonly x: number;
  /** Vertical pixel coordinate. */
    readonly y: number
}

ViewportRect (Extended from index.ts)

A rectangle in viewport-relative coordinates.

ts
interface ViewportRect {
  /** Width of the rectangle in pixels. */
    readonly width: number;
  /** Height of the rectangle in pixels. */
    readonly height: number
}

GridViewport

Describes the current scroll position and dimensions of the grid viewport.

ts
interface GridViewport {
  /** Current horizontal scroll offset in pixels. */
    readonly scrollLeft: number;
  /** Current vertical scroll offset in pixels. */
    readonly scrollTop: number;
  /** Width of the visible viewport in pixels. */
    readonly width: number;
  /** Height of the visible viewport in pixels. */
    readonly height: number;
  /** Uniform row height in pixels. */
    readonly rowHeight: number
}

DependencyAnchorSide

Side of a task bar where a dependency link attaches.

ts
/** Side of a task bar where a dependency link attaches. */
export type DependencyAnchorSide =  'start' | 'end';

ViewportMapper

Maps task identifiers to viewport-relative rectangles and dependency anchor points.

ts
interface ViewportMapper {
  /**
     * Returns the viewport-relative bounding rectangle of a task bar.
     *
     * @param taskId - The task to look up.
     * @param viewport - Current grid viewport state.
     * @returns The bounding rect, or `null` if the task is not visible.
     */
    getTaskRect(taskId: TaskId, viewport: GridViewport): ViewportRect | null;
  /**
     * Returns the dependency anchor point on the specified side of a task bar.
     *
     * @param taskId - The task to look up.
     * @param side - Which side of the bar to anchor to.
     * @param viewport - Current grid viewport state.
     * @returns The anchor point, or `null` if the task is not visible.
     */
    getDependencyAnchor(
      taskId: TaskId,
      side: DependencyAnchorSide,
      viewport: GridViewport,
    ): ViewportPoint | null
}

createTaskGridRows

Projects the full project state into an ordered array of flat grid rows ready for rendering. Combines scheduling results, WBS numbering, dependency labels, baseline overlays, resource assignments, and Gantt bar layouts into a single row model per task.

@param project - The current project snapshot (tasks, resources, assignments, baselines, dependencies). * @param scale - The active timeline scale for date-to-pixel conversion. * @param scheduledTasksById - Map of task IDs to their engine-computed schedule results. * @param taskStore - Task store instance (defaults to an in-memory store built from the project). * @param resourceStore - Resource store instance (defaults to an in-memory store built from the project). * @param assignmentStore - Assignment store instance (defaults to an in-memory store built from the project). * @param options - Optional projection options (baseline, critical path, labels, resource filter). * @returns An ordered array of {@link TaskGridRow} objects.

ts
export function createTaskGridRows(
  project: ProjectSnapshot,
  scale: TimelineScale,
  scheduledTasksById: ReadonlyMap<TaskId, ScheduledTask>,
  taskStore: TaskStore = new InMemoryTaskStore(project.tasks),
  resourceStore: ResourceStore = new InMemoryResourceStore(project.resources),
  assignmentStore: AssignmentStore = new InMemoryAssignmentStore(project.assignments),
  options: TaskRowProjectionOptions =;

TaskGridRow

Flat row model produced by projecting a scheduled task onto the Gantt grid. Contains display-ready fields and computed layout.

ts
interface TaskGridRow {
  /** Unique task identifier. */
    readonly id: TaskId;
  /** Parent task identifier, or `null` for top-level tasks. */
    readonly parentId: TaskId | null;
  /** Work Breakdown Structure code (e.g. "1.2.3"). */
    readonly wbs: string;
  /** Display name of the task. */
    readonly name: string;
  /** Nesting depth in the task hierarchy (0 = root). */
    readonly depth: number;
  /** Whether the task has child tasks. */
    readonly hasChildren: boolean;
  /** Whether the task's subtree is expanded in the grid. */
    readonly isExpanded: boolean;
  /** Whether the task is currently selected. */
    readonly isSelected: boolean;
  /** Scheduler-determined kind (task, summary, milestone). */
    readonly taskKind: ScheduledTaskKind;
  /** Human-readable task type label. */
    readonly taskType: string;
  /** Human-readable status label. */
    readonly status: string;
  /** Scheduled start date (ISO string). */
    readonly startDate: string;
  /** Scheduled end date (ISO string). */
    readonly endDate: string;
  /** Duration in working days. */
    readonly duration: number;
  /** Completion percentage (0–100). */
    readonly percentDone: number;
  /** Total slack (float) in days before the task delays the project. */
    readonly totalSlackDays: number;
  /** Optional inline label rendered on the Gantt bar. */
    readonly taskLabel?: string;
  /** Optional baseline bar layout for plan-vs-actual comparison. */
    readonly baselineLayout?: GanttBaselineLayout;
  /** Point indicators (deadlines, constraints, custom markers) on this row. */
    readonly indicators: readonly GanttIndicatorLayout[];
  /** Comma-separated list of assigned resource names. */
    readonly assignees: string;
  /** Comma-separated predecessor reference tokens. */
    readonly predecessors: string;
  /** Comma-separated successor reference tokens. */
    readonly successors: string;
  /** Computed pixel layout for the Gantt bar. */
    readonly ganttLayout: GanttBarLayout;
  /** Reserved field for the Gantt bar cell renderer. */
    readonly gantt: string
}

buildWbsMap

Builds a map of task IDs to WBS (Work Breakdown Structure) codes based on the visible row order and nesting depth.

@param visibleRows - Ordered rows with depth and task identity. * @returns A read-only map from task ID to its computed WBS string (e.g. "1.2.3").

ts
export function buildWbsMap(
  visibleRows: readonly VisibleTaskRow[],
): ReadonlyMap<TaskId, string>;

normalizeTaskSource

Filter and normalize a raw data source into valid TaskEntity values.

Non-object entries and objects missing required task fields (id, projectId, startDate, durationDays) are silently dropped.

@param source - The raw row data supplied to the grid. * @returns An array of validated task entities.

ts
export function normalizeTaskSource(source: readonly DataType[] | undefined): TaskEntity[];

GanttGridRenderResult

Result of a full gantt grid recalculation cycle.

Contains the resolved project snapshot, scheduling output, timeline scale configuration, whether the scale changed since the last render, and the projected row data ready for the grid.

ts
interface GanttGridRenderResult {
  /** The fully resolved project snapshot used for this render. */
    readonly resolvedProject: ProjectSnapshot;
  /** The scheduling engine output (scheduled dates, critical path, etc.). */
    readonly scheduling: SchedulingResult;
  /** The timeline scale and view-model derived from the scheduling result. */
    readonly scaleConfig: TaskGridScaleConfig;
  /** `true` if the timeline scale level or date range changed since the previous render. */
    readonly scaleChanged: boolean;
  /** The projected grid rows, one per visible task. */
    readonly rows: readonly DataType[]
}

GanttGridState

Mutable state container for the gantt grid.

Holds the current project data (tasks, dependencies, calendars, resources, assignments, baselines), the scheduling engine result, and the derived timeline scale. Provides methods to hydrate, replace, and recalculate the grid projection.

ts
class GanttGridState {
  bootstrapProject(
    project: GanttPluginConfig,
    source: readonly DataType[] | undefined,
    dependencies: readonly DependencyEntity[] | undefined,
    calendars: readonly CalendarEntity[] | undefined,
    resources: readonly ResourceEntity[] | undefined,
    assignments: readonly AssignmentEntity[] | undefined,
    baselines: readonly BaselineSnapshot[] | undefined,
  );

  replaceTasks(source: readonly DataType[] | undefined);

  replaceDependencies(dependencies: readonly DependencyEntity[]);

  replaceResources(resources: ProjectSnapshot['resources']);

  replaceAssignments(assignments: ProjectSnapshot['assignments']);

  replaceCalendars(calendars: readonly CalendarEntity[]);

  replaceBaselines(baselines: readonly BaselineSnapshot[]);

  recalculate(
    zoomLevel: TimelineZoomLevel | TimelineZoomPreset,
    locale = 'en-US',
    defaultHeaderFormatter?: TimelineDateFormatter,
    projectionOptions: TaskRowProjectionOptions =;

  clear();

  getResolvedProjectSnapshot(): ProjectSnapshot | null;

  getTaskStore();

  getDependencies();

  getResourceStore();

  getAssignmentStore();

  getDependenciesById();

  getSchedulingResult();

  getCurrentScale();

  getTimeline();

  setTimelineVisibleRange(visibleRange: TimelineVisibleDateRange);

  setTimelineFlagLines(lines: readonly TimelineFlagLine[]);

  getProjectedRowPosition(taskId: TaskId): number | null;
}

GanttGridSync

Synchronises the gantt plugin's state with the underlying RevoGrid element.

Manages the grid's column configuration, row data, column types, and additional data to keep the task-list and gantt timeline in sync. On initialization it captures the original grid state so it can be fully restored when the gantt plugin is destroyed.

ts
class GanttGridSync {
  initialize();

  getSource(): DataType[];

  applyScale(scaleConfig: TaskGridScaleConfig);

  applyRowData(rows: readonly DataType[]);

  applyRows(rows: readonly DataType[]);

  isApplyingColumns(): boolean;

  captureColumns(columns: (ColumnGrouping | ColumnRegular)[] | undefined);

  getManagedColumns(totalWidth: number): (ColumnGrouping | ColumnRegular)[];

  restore();

  getVisibleGridTaskIds(): ReadonlySet<TaskId>;

  getGridVirtualRowIndex(taskId: TaskId): number | null;
}

TimelineFlagLine

A flag line to render as a cap label inside the gantt timeline header. Uses absolute timeline X coordinates (not scroll-adjusted).

ts
interface TimelineFlagLine {
  readonly id: string;
  /** Absolute X position in the full timeline (px from timeline start). */
    readonly dateX: number;
  readonly label: string;
  readonly color?: string;
  readonly kind: 'today' | 'milestone'
}

GanttTimelineViewModel

Read-only view model describing the current gantt timeline layout.

This is the primary data structure consumed by the gantt column type and overlay renderers to position header cells, task bars, tick lines, and bands.

ts
interface GanttTimelineViewModel {
  /** Unique identifier of the active zoom level (e.g. `"day"`, `"week"`). */
    readonly levelId: string;
  /** Human-readable label for the current zoom level. */
    readonly label?: string;
  /** Total pixel width of the entire timeline. */
    readonly totalWidth: number;
  /** Pixel width of a single tick (the smallest time unit column). */
    readonly tickWidth: number;
  /** Header row models describing multi-level date/time labels. */
    readonly headerRows: readonly TimelineHeaderRowModel[];
  /** Individual tick marks across the timeline. */
    readonly ticks: readonly TimelineTick[];
  /** Non-working day or custom shading bands. */
    readonly bands: readonly TimelineBand[];
  /** The currently visible date range within the viewport. */
    readonly visibleRange: TimelineVisibleDateRange;
  /** Flag cap labels to render inside the header (today line + milestone lines). */
    readonly flagLines: readonly TimelineFlagLine[]
}

textEditor

ts
textEditor: typeof TextEditor;

COLUMN_DEFS

ts
COLUMN_DEFS: { wbs: { prop: string; name: string; size: number; }; name: { prop: string; name: string; size: number; }; startDate: { prop: string; name: string; size: number; columnType: "date"; required: boolean; }; endDate: { prop: string; name: string; size: number; columnType: "date"; required: boolean; }; duration: { prop: string; name: string; size: number; }; percentDone: { prop: string; name: string; size: number; }; predecessors: { prop: string; name: string; size: number; }; successors: { prop: string; name: string; size: number; }; status: { prop: string; name: string; size: number; }; assignees: { prop: string; name: string; size: number; }; };

TaskTableColumnProp

ts
export type TaskTableColumnProp =  'wbs' | 'name' | 'startDate' | 'endDate' | 'duration' | 'percentDone' | 'predecessors' | 'successors' | 'status' | 'assignees';

AssignmentMutationSuccess

Successful result of an assignment mutation operation.

ts
interface AssignmentMutationSuccess {
  /** Discriminant indicating success. */
    readonly ok: true;
  /** Identifier of the task whose assignments were modified. */
    readonly taskId: TaskId
}

AssignmentMutationFailure

Failed result of an assignment mutation operation.

ts
interface AssignmentMutationFailure {
  /** Discriminant indicating failure. */
    readonly ok: false;
  /** Machine-readable error code describing the failure reason. */
    readonly code: 'task-not-found' | 'resource-not-found' | 'invalid-value';
  /** Human-readable error message. */
    readonly message: string
}

TaskCreatePlacement

Options controlling where a newly created task is inserted in the task list.

ts
interface TaskCreatePlacement {
  /** Insert the new task after this task ID, or at the end of the parent's children if `null`. */
    readonly insertAfterTaskId?: TaskId | null
}

TaskMutationSuccess

Successful result of a task mutation operation.

ts
interface TaskMutationSuccess {
  /** Discriminant indicating success. */
    readonly ok: true;
  /** ID of the affected task. */
    readonly taskId: TaskId;
  /** Whether a new task was created (vs. updated). */
    readonly created: boolean;
  /** Parent task ID, if the operation changed the hierarchy. */
    readonly parentId?: TaskId | null
}

TaskMutationFailure

Failed result of a task mutation operation.

ts
interface TaskMutationFailure {
  /** Discriminant indicating failure. */
    readonly ok: false;
  /** Machine-readable error code describing the failure reason. */
    readonly code:
      | 'task-not-found'
      | 'readonly-task'
      | 'invalid-field'
      | 'invalid-date'
      | 'invalid-range'
      | 'invalid-parent'
      | 'invalid-value';
  /** Human-readable error message. */
    readonly message: string
}

TimelineRangeVisual

Computed visual data for a time range decoration (non-working day or user-defined range).

ts
interface TimelineRangeVisual {
  /** Unique identifier for the range. */
    readonly id: string;
  /** Left pixel offset relative to the viewport. */
    readonly left: number;
  /** Width in pixels. */
    readonly width: number;
  /** Optional display label. */
    readonly label?: string;
  /** Optional CSS color override. */
    readonly color?: string
}

TimelineLineVisual

Computed visual data for a vertical line decoration (e.g. project milestone line).

ts
interface TimelineLineVisual {
  /** Unique identifier for the line. */
    readonly id: string;
  /** Left pixel offset relative to the viewport. */
    readonly left: number;
  /** Optional display label. */
    readonly label?: string;
  /** Optional CSS color override. */
    readonly color?: string
}