Skip to content

Project Data Model

This page documents 41 public symbols exported by @revolist/gantt.

interface

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

export 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. Accepts either `100` or `1.0` for 100 % of the resource capacity. */
readonly allocationUnits: number;
/** Assignment work, in hours. */
readonly workHours?: number;
/** Description of what the resource is responsible for. */
readonly responsibility: string;
}
MemberType / returnRequiredDefaultDescription
idstringYes—Unique assignment identifier.
taskIdstringYes—The task this assignment belongs to.
resourceIdstringYes—The resource assigned to the task.
allocationUnitsnumberYes—Allocation units. Accepts either 100 or 1.0 for 100 % of the resource capacity.
workHoursnumber | undefinedNo—Assignment work, in hours.
responsibilitystringYes—Description of what the resource is responsible for.

Related types: AssignmentId, ResourceId, TaskId

type

Unique identifier for a task–resource assignment.

export type AssignmentId = EntityId;

Related types: EntityId

interface

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

export 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;
}
MemberType / returnRequiredDefaultDescription
getAll()readonly AssignmentEntity[]Yes—Returns all assignments.
getById(assignmentId: AssignmentId)AssignmentEntity | undefinedYes—Looks up an assignment by its id.
getByTaskId(taskId: TaskId)readonly AssignmentEntity[]Yes—Returns all assignments for a given task.
getByResourceId(resourceId: ResourceId)readonly AssignmentEntity[]Yes—Returns all assignments for a given resource.
replaceAll(assignments: readonly AssignmentEntity[])voidYes—Replaces the entire assignment list, rebuilding all indexes.
replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentEntity[])voidYes—Replaces only the assignments for a specific task, keeping others intact.

Related types: AssignmentEntity, AssignmentId, ResourceId, TaskId

type

Unique identifier for a baseline snapshot.

export type BaselineId = EntityId;

Related types: EntityId

interface

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

export 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[];
}
MemberType / returnRequiredDefaultDescription
idstringYes—Unique baseline identifier.
namestringYes—Human-readable baseline name (e.g. "Sprint 1 Plan").
capturedAt${number}-${number}-${number}T${string}Yes—When this baseline was captured.
tasksreadonly BaselineTaskSnapshot[]Yes—Per-task snapshots at capture time.

Related types: BaselineId, BaselineTaskSnapshot

interface

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

export interface BaselineTaskSnapshot {
/** The task this snapshot refers to. */
readonly taskId: TaskId;
/** Baseline start date. */
readonly startDate: ISODateString;
/** Baseline end date. */
readonly endDate: ISODateString;
/** Baseline task duration stored canonically in hours. */
readonly duration: number;
/** Baseline completion percentage. */
readonly progressPercent: number;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYes—The task this snapshot refers to.
startDateISODateStringYes—Baseline start date.
endDateISODateStringYes—Baseline end date.
durationnumberYes—Baseline task duration stored canonically in hours.
progressPercentnumberYes—Baseline completion percentage.

Related types: TaskId

function

Creates a JSON-safe deep copy of a project snapshot.

export function cloneProjectSnapshot(project: ProjectSnapshot): ProjectSnapshot;
ParameterTypeRequiredDefaultDescription
projectProjectSnapshotYes—

Related types: ProjectSnapshot

function

Builds packaged task-type choices, optionally restricted by project policy.

export function createTaskTypeOptions(allowedTaskTypes?: readonly TaskType[], labelOverrides?: Partial<Record<TaskType, string>>): TaskTypeOption[];
ParameterTypeRequiredDefaultDescription
allowedTaskTypesreadonly TaskType[] | undefinedNo—
labelOverridesPartial<Record<TaskType, string>> | undefinedNo—

Related types: TaskType, TaskTypeOption

interface

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

export 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) applied to the link; calendar basis is controlled by scheduling options. */
readonly lagDays: number;
}
MemberType / returnRequiredDefaultDescription
idstringYes—Unique dependency identifier.
predecessorTaskIdstringYes—The task that must complete (or start) first.
successorTaskIdstringYes—The task whose schedule depends on the predecessor.
typeDependencyTypeYes—Relationship type — see {@link DependencyType}.
lagDaysnumberYes—Lead (negative) or lag (positive) applied to the link; calendar basis is controlled by scheduling options.

Related types: DependencyId, DependencyType, TaskId

type

Unique identifier for a dependency link between two tasks.

export type DependencyId = EntityId;

Related types: EntityId

type

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';

type

Opaque string identifier used across Gantt entities.

export type EntityId = string;

function

Serializes a project snapshot into JSON without adding persistence semantics.

export function exportProjectSnapshot(project: ProjectSnapshot, options: ProjectSnapshotJsonOptions = {}): string;
ParameterTypeRequiredDefaultDescription
projectProjectSnapshotYes—
optionsProjectSnapshotJsonOptionsNo{}

Related types: ProjectSnapshot, ProjectSnapshotJsonOptions

class

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

export class InMemoryAssignmentStore {
constructor(assignments: readonly AssignmentEntity[] = []);
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;
}
MemberType / returnRequiredDefaultDescription
assignmentsAssignmentEntity[]Yes[]
assignmentsByIdMap<string, AssignmentEntity>Yesnew Map<AssignmentId, AssignmentEntity>()
assignmentsByTaskIdMap<string, AssignmentEntity[]>Yesnew Map<TaskId, AssignmentEntity[]>()
assignmentsByResourceIdMap<string, AssignmentEntity[]>Yesnew Map<ResourceId, AssignmentEntity[]>()
getAll()readonly AssignmentEntity[]Yes—
getById(assignmentId: AssignmentId)AssignmentEntity | undefinedYes—
getByTaskId(taskId: TaskId)readonly AssignmentEntity[]Yes—
getByResourceId(resourceId: ResourceId)readonly AssignmentEntity[]Yes—
replaceAll(assignments: readonly AssignmentEntity[])voidYes—
replaceTaskAssignments(taskId: TaskId, assignments: readonly AssignmentEntity[])voidYes—
rebuildIndexes()voidYes—

Related types: AssignmentEntity, AssignmentId, ResourceId, TaskId

class

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

export class InMemoryResourceStore {
constructor(resources: readonly ResourceEntity[] = []);
getAll(): readonly ResourceEntity[];
getById(resourceId: ResourceId): ResourceEntity | undefined;
replaceAll(resources: readonly ResourceEntity[]): void;
}
MemberType / returnRequiredDefaultDescription
resourcesResourceEntity[]Yes[]
resourcesByIdMap<string, ResourceEntity>Yesnew Map<ResourceId, ResourceEntity>()
getAll()readonly ResourceEntity[]Yes—
getById(resourceId: ResourceId)ResourceEntity | undefinedYes—
replaceAll(resources: readonly ResourceEntity[])voidYes—

Related types: ResourceEntity, ResourceId

class

Default in-memory implementation of {@link TaskStore}. Maintains parent–child indexes and task mutation state.

export class InMemoryTaskStore {
constructor(tasks: readonly TaskEntity[] = []);
getAll(): readonly TaskEntity[];
getTaskRevision(): number;
getById(taskId: TaskId): TaskEntity | undefined;
getOrderedRows(): readonly TaskTreeRow[];
getRoots(): readonly TaskEntity[];
getChildren(parentId: TaskId): readonly TaskEntity[];
getParent(taskId: TaskId): TaskEntity | undefined;
hasChildren(taskId: TaskId): boolean;
getIndentLevel(taskId: TaskId): number;
updateTask(taskId: TaskId, patch: TaskUpdate): TaskEntity;
replaceAll(tasks: readonly TaskEntity[]): void;
}
MemberType / returnRequiredDefaultDescription
allTasksTaskEntity[]Yes[]
tasksByIdMap<string, TaskEntity>Yesnew Map<TaskId, TaskEntity>()
childrenByParentIdMap<string | null, TaskEntity[]>Yesnew Map<TaskId | null, TaskEntity[]>()
parentByIdMap<string, string | null>Yesnew Map<TaskId, TaskId | null>()
depthByIdMap<string, number>Yesnew Map<TaskId, number>()
taskRevisionnumberYes0
getAll()readonly TaskEntity[]Yes—
getTaskRevision()numberYes—
getById(taskId: TaskId)TaskEntity | undefinedYes—
getOrderedRows()readonly TaskTreeRow[]Yes—
getRoots()readonly TaskEntity[]Yes—
getChildren(parentId: TaskId)readonly TaskEntity[]Yes—
getParent(taskId: TaskId)TaskEntity | undefinedYes—
hasChildren(taskId: TaskId)booleanYes—
getIndentLevel(taskId: TaskId)numberYes—
updateTask(taskId: TaskId, patch: TaskUpdate)TaskEntityYes—
replaceAll(tasks: readonly TaskEntity[])voidYes—

Related types: TaskEntity, TaskId, TaskTreeRow, TaskUpdate

function

Parses and lightly validates a JSON project snapshot.

export function parseProjectSnapshotJson(json: string): ProjectSnapshotParseResult;
ParameterTypeRequiredDefaultDescription
jsonstringYes—

Related types: ProjectSnapshotParseResult

function

Resolves a canonical task type or any packaged/default localized label.

export function parseTaskTypeValue(value: unknown, labelOverrides?: Partial<Record<TaskType, string>>): TaskType | null;
ParameterTypeRequiredDefaultDescription
valueunknownYes—
labelOverridesPartial<Record<TaskType, string>> | undefinedNo—

Related types: TaskType

interface

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.

export 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;
/** Project duration display and working-time conversion settings. */
readonly durationSettings?: DurationSettings;
/** Timestamp of the last modification. */
readonly updatedAt: ISODateTimeString;
/** Reporting date used to calculate Microsoft Project-style task status. Defaults to today. */
readonly statusDate?: ISODateString;
/** 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[];
}
MemberType / returnRequiredDefaultDescription
idstringYes—Project identifier.
namestringYes—Project name.
versionstringYes—Semantic version of the project data schema.
currencystringYes—Currency code used for cost calculations (e.g. "USD").
timeZonestringYes—Default IANA time zone for the project.
primaryCalendarIdCalendarIdYes—Calendar used by default for new tasks.
durationSettingsDurationSettings | undefinedNo—Project duration display and working-time conversion settings.
updatedAt${number}-${number}-${number}T${string}Yes—Timestamp of the last modification.
statusDateISODateString | undefinedNo—Reporting date used to calculate Microsoft Project-style task status. Defaults to today.
tasksreadonly TaskEntity[]Yes—All tasks in the project.
dependenciesreadonly DependencyEntity[]Yes—All dependency links between tasks.
resourcesreadonly ResourceEntity[]Yes—All available resources.
assignmentsreadonly AssignmentEntity[]Yes—All task–resource assignments.
calendarsreadonly CalendarEntity[]Yes—All working calendars.
baselinesreadonly BaselineSnapshot[]Yes—Historical baseline snapshots.

Related types: AssignmentEntity, BaselineSnapshot, DependencyEntity, EntityId, ResourceEntity, TaskEntity

interface

export interface ProjectSnapshotJsonOptions {
/** Indentation passed to `JSON.stringify` for readable exports. */
readonly space?: number | string;
}
MemberType / returnRequiredDefaultDescription
spacestring | number | undefinedNo—Indentation passed to JSON.stringify for readable exports.

interface

export interface ProjectSnapshotParseFailure {
readonly ok: false;
readonly error: string;
}
MemberType / returnRequiredDefaultDescription
okfalseYes—
errorstringYes—

type

export type ProjectSnapshotParseResult = ProjectSnapshotParseSuccess | ProjectSnapshotParseFailure;

Related types: ProjectSnapshotParseFailure, ProjectSnapshotParseSuccess

interface

export interface ProjectSnapshotParseSuccess {
readonly ok: true;
readonly project: ProjectSnapshot;
}
MemberType / returnRequiredDefaultDescription
oktrueYes—
projectProjectSnapshotYes—

Related types: ProjectSnapshot

function

Keeps the zero-duration milestone transition reversible.

A positive duration cannot remain a milestone, while task and summary types otherwise retain their existing ownership and validation rules.

export function resolveTaskTypeAfterDurationEdit(currentType: TaskType, durationHours: number): TaskType;
ParameterTypeRequiredDefaultDescription
currentTypeTaskTypeYes—
durationHoursnumberYes—

Related types: TaskType

interface

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

export interface ResourceEntity extends ResourceIdentity<ResourceId> {
/** Unique resource identifier. */
/** Display name of the resource. */
/** Optional profile image URL displayed in resource-oriented views. */
/** Role or job title. */
readonly role: string;
/** Working calendar for this resource. */
readonly calendarId: CalendarId;
/** Maximum allocation capacity. Accepts either `100` or `1.0` for 100 %. */
readonly allocationCapacity: number;
/** Cost per hour in the project currency. */
readonly hourlyCost: number;
}
MemberType / returnRequiredDefaultDescription
rolestringYes—Unique resource identifier. Display name of the resource. Optional profile image URL displayed in resource-oriented views. Role or job title.
calendarIdCalendarIdYes—Working calendar for this resource.
allocationCapacitynumberYes—Maximum allocation capacity. Accepts either 100 or 1.0 for 100 %.
hourlyCostnumberYes—Cost per hour in the project currency.

Related types: ResourceId

type

Unique identifier for a resource (person or equipment).

export type ResourceId = EntityId;

Related types: EntityId

interface

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

export 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;
}
MemberType / returnRequiredDefaultDescription
getAll()readonly ResourceEntity[]Yes—Returns all resources.
getById(resourceId: ResourceId)ResourceEntity | undefinedYes—Looks up a resource by its id.
replaceAll(resources: readonly ResourceEntity[])voidYes—Replaces the entire resource list.

Related types: ResourceEntity, ResourceId

constant

export const TASK_TYPE_LABELS: Readonly<Record<TaskType, string>>;

Related types: TaskType

constant

Canonical task kinds in the order used by packaged editors.

export const TASK_TYPE_VALUES: readonly ["task", "milestone", "summary"];

type

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';

type

Determines which task variable remains fixed when work, duration, or units change. Mirrors the common Microsoft Project task type model.

RevoGrid applies the model during schedule calculation and task/assignment mutation. The edit matrix is deterministic and formula-based; it intentionally does not mirror every Microsoft Project prompt or per-assignment side-effect.

export type TaskEffortMode = 'fixed-duration' | 'fixed-work' | 'fixed-units';

interface

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.

export 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;
/** Optional authored task-bar color. */
readonly color?: string;
/** Determines scheduling behaviour — see {@link TaskType}. */
readonly type: TaskType;
/** Optional user-authored workflow state — see {@link TaskWorkflowStatus}. */
readonly workflowStatus?: TaskWorkflowStatus;
/** Planned start date (inclusive). */
readonly startDate: ISODateString;
/** Planned end date (inclusive). */
readonly endDate: ISODateString;
/** Planned task duration stored canonically in hours. */
readonly duration: number;
/** Unit retained only for authored/display formatting; it does not change storage. */
readonly durationUnit?: DurationUnit;
/** When true, duration is continuous elapsed time and ignores working calendars. */
readonly durationIsElapsed?: boolean;
/** Task type used for work/duration/unit calculations. Defaults to `fixed-duration`. */
readonly effortMode?: TaskEffortMode;
/** Whether resource changes should preserve total work where the task type allows it. */
readonly effortDriven?: boolean;
/** Planned work for the task, in hours. */
readonly workHours?: number;
/** Unit retained for Work display and editing; canonical storage remains hours. */
readonly workUnit?: DurationUnit;
/** Remaining duration stored canonically in hours; used when progress rescheduling is enabled. */
readonly remainingDuration?: number;
/** Date work actually started; anchors the schedule only under progress-aware rescheduling. */
readonly actualStartDate?: ISODateString;
/** Date work actually finished; always pins completed work to the recorded finish. */
readonly actualFinishDate?: ISODateString;
/** Non-working gaps inside the task span. */
readonly splitRanges?: readonly TaskSplitRange[];
/** When `true`, authored dates are preserved and dependency violations become diagnostics. */
readonly manuallyScheduled?: boolean;
/** When `true`, the task is excluded from scheduling and critical-path analysis. */
readonly inactive?: boolean;
/** Leveling priority from 0 to 1000. Higher priority tasks are protected first. Defaults to 500. */
readonly priority?: number;
/** Whether automatic resource leveling may delay this task. Defaults to true. */
readonly canLevel?: boolean;
/** When `true`, packaged Gantt task mutations are rejected for this task. */
readonly locked?: boolean;
/** Existing resource leveling delay in calendar days. Defaults to 0. */
readonly levelingDelayDays?: number;
/** 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[];
}
MemberType / returnRequiredDefaultDescription
idstringYes—Unique task identifier.
projectIdstringYes—Project this task belongs to.
parentIdstring | nullYes—Parent task id, or null for root-level tasks.
wbsCodestringYes—Work Breakdown Structure code (e.g. "1.2.3").
namestringYes—Human-readable task name.
colorstring | undefinedNo—Optional authored task-bar color.
typeTaskTypeYes—Determines scheduling behaviour — see {@link TaskType}.
workflowStatusTaskWorkflowStatus | undefinedNo—Optional user-authored workflow state — see {@link TaskWorkflowStatus}.
startDateISODateStringYes—Planned start date (inclusive).
endDateISODateStringYes—Planned end date (inclusive).
durationnumberYes—Planned task duration stored canonically in hours.
durationUnitDurationUnit | undefinedNo—Unit retained only for authored/display formatting; it does not change storage.
durationIsElapsedboolean | undefinedNo—When true, duration is continuous elapsed time and ignores working calendars.
effortModeTaskEffortMode | undefinedNo—Task type used for work/duration/unit calculations. Defaults to fixed-duration.
effortDrivenboolean | undefinedNo—Whether resource changes should preserve total work where the task type allows it.
workHoursnumber | undefinedNo—Planned work for the task, in hours.
workUnitDurationUnit | undefinedNo—Unit retained for Work display and editing; canonical storage remains hours.
remainingDurationnumber | undefinedNo—Remaining duration stored canonically in hours; used when progress rescheduling is enabled.
actualStartDateISODateString | undefinedNo—Date work actually started; anchors the schedule only under progress-aware rescheduling.
actualFinishDateISODateString | undefinedNo—Date work actually finished; always pins completed work to the recorded finish.
splitRangesreadonly TaskSplitRange[] | undefinedNo—Non-working gaps inside the task span.
manuallyScheduledboolean | undefinedNo—When true, authored dates are preserved and dependency violations become diagnostics.
inactiveboolean | undefinedNo—When true, the task is excluded from scheduling and critical-path analysis.
prioritynumber | undefinedNo—Leveling priority from 0 to 1000. Higher priority tasks are protected first. Defaults to 500.
canLevelboolean | undefinedNo—Whether automatic resource leveling may delay this task. Defaults to true.
lockedboolean | undefinedNo—When true, packaged Gantt task mutations are rejected for this task.
levelingDelayDaysnumber | undefinedNo—Existing resource leveling delay in calendar days. Defaults to 0.
constraintTypeTaskConstraintType | undefinedNo—Optional scheduling constraint type — see {@link TaskConstraintType}.
constraintDateISODateString | undefinedNo—Date associated with the scheduling constraint.
deadlineDateISODateString | undefinedNo—Deadline date — tasks finishing after this date are flagged.
progressPercentnumberYes—Completion percentage (0–100).
calendarIdCalendarIdYes—Calendar governing working days and holidays for this task.
isCriticalbooleanYes—Whether this task lies on the critical path.
notesstring | undefinedNo—Optional free-text notes attached to the task.
tagsreadonly string[]Yes—Arbitrary tags for categorisation or filtering.

Related types: EntityId, TaskConstraintType, TaskEffortMode, TaskId, TaskSplitRange, TaskType, TaskWorkflowStatus

type

Unique identifier for a task within a project.

export type TaskId = EntityId;

Related types: EntityId

interface

Date range where work is intentionally split and the task should not consume work. Split ranges extend the computed finish because the same work is spread over more calendar time.

export interface TaskSplitRange {
/** Split start date (inclusive). */
readonly startDate: ISODateString;
/** Split end date (inclusive). */
readonly endDate: ISODateString;
}
MemberType / returnRequiredDefaultDescription
startDateISODateStringYes—Split start date (inclusive).
endDateISODateStringYes—Split end date (inclusive).

type

Microsoft Project-style calculated schedule health for a task.

export type TaskStatus = 'complete' | 'on-schedule' | 'late' | 'future-task';

interface

Read/write store that manages the hierarchical task list. Handles parent–child relationships and incremental task updates.

export interface TaskStore {
/** Returns all tasks in insertion order. */
getAll(): readonly TaskEntity[];
/** Monotonically increasing revision counter bumped on every task data change. */
getTaskRevision(): number;
/** Returns every task as a {@link TaskTreeRow} in canonical authored tree order. */
getOrderedRows(): readonly TaskTreeRow[];
/** 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 the nesting depth of a task in the tree hierarchy. */
getIndentLevel(taskId: TaskId): number;
/** 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;
}
MemberType / returnRequiredDefaultDescription
getAll()readonly TaskEntity[]Yes—Returns all tasks in insertion order.
getTaskRevision()numberYes—Monotonically increasing revision counter bumped on every task data change.
getOrderedRows()readonly TaskTreeRow[]Yes—Returns every task as a {@link TaskTreeRow} in canonical authored tree order.
getById(taskId: TaskId)TaskEntity | undefinedYes—Looks up a task by its id.
getRoots()readonly TaskEntity[]Yes—Returns top-level (root) tasks.
getChildren(parentId: TaskId)readonly TaskEntity[]Yes—Returns direct children of the given parent task.
getParent(taskId: TaskId)TaskEntity | undefinedYes—Returns the parent task, or undefined for root tasks.
hasChildren(taskId: TaskId)booleanYes—Returns true if the task has at least one child.
getIndentLevel(taskId: TaskId)numberYes—Returns the nesting depth of a task in the tree hierarchy.
updateTask(taskId: TaskId, patch: TaskUpdate)TaskEntityYes—Applies a partial update to a task and returns the updated entity.
replaceAll(tasks: readonly TaskEntity[])voidYes—Replaces the entire task list, rebuilding internal indexes.

Related types: TaskEntity, TaskId, TaskTreeRow, TaskUpdate

interface

A task together with its canonical position in the authored tree. Grid visibility, expansion, sorting, filtering, and selection live in the RevoGrid runtime layer, not in this domain store.

export interface TaskTreeRow {
/** 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;
/** Zero-based index in the canonical flattened tree. */
readonly index: number;
}
MemberType / returnRequiredDefaultDescription
taskTaskEntityYes—The underlying task entity.
depthnumberYes—Nesting depth (0 for root tasks).
hasChildrenbooleanYes—Whether the task has child tasks.
indexnumberYes—Zero-based index in the canonical flattened tree.

Related types: TaskEntity

type

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';

interface

export interface TaskTypeOption {
readonly label: string;
readonly value: TaskType;
}
MemberType / returnRequiredDefaultDescription
labelstringYes—
valueTaskTypeYes—

Related types: TaskType

type

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'
| 'color'
| 'workflowStatus'
| 'type'
| 'startDate'
| 'endDate'
| 'duration'
| 'durationUnit'
| 'durationIsElapsed'
| 'workHours'
| 'workUnit'
| 'remainingDuration'
| 'actualStartDate'
| 'actualFinishDate'
| 'splitRanges'
| 'effortMode'
| 'effortDriven'
| 'progressPercent'
| 'manuallyScheduled'
| 'inactive'
| 'priority'
| 'canLevel'
| 'levelingDelayDays'
| 'constraintType'
| 'constraintDate'
| 'deadlineDate'
| 'notes'
| 'calendarId'
| 'tags'
>
>;

Related types: TaskEntity

type

User-authored workflow state kept separately from calculated schedule health.

export type TaskWorkflowStatus = 'not-started' | 'in-progress' | 'done' | 'blocked';