Skip to content

TaskModel

Defined in: core/src/model/task.ts:87

A normalized task: core’s internal, numeric record of one input Task. Deeply frozen except for task (the caller’s object, referenced, never copied or mutated) and the values of issues. The public, Date-based TaskRecord is derived from it by the facade, together with the hierarchy fields (level, childIds, rowIndex, …).

TData = unknown

Type of task.data.

readonly durationMode: DurationMode

Defined in: core/src/model/task.ts:109

task.durationMode or the default from the options.


readonly id: TaskId

Defined in: core/src/model/task.ts:89

task.id.


readonly index: number

Defined in: core/src/model/task.ts:91

Position in NormalizedModel.tasks (input order without dropped tasks).


readonly issues: readonly ModelIssue[]

Defined in: core/src/model/task.ts:117

Issues of this task, also listed in NormalizedModel.issues.


readonly name: string

Defined in: core/src/model/task.ts:95

task.name, or '' when it is not a string.


readonly parentId: TaskId | undefined

Defined in: core/src/model/task.ts:113

task.parentId as given (resolved by the hierarchy); undefined if malformed.


readonly precision: DatePrecision

Defined in: core/src/model/task.ts:107

task.precision, else 'time' when a used start / end carries a time of day or the duration has a part shorter than a day, else 'day'.


readonly progress: number

Defined in: core/src/model/task.ts:111

task.progress clamped to 0 … 100; 0 when missing or malformed.


readonly span: TaskSpan | undefined

Defined in: core/src/model/task.ts:115

The bar; undefined for placeholders and invalid tasks.


readonly task: Task<TData>

Defined in: core/src/model/task.ts:93

The caller’s task. With 'invalid-shape' issues it does not match Task.


readonly type: TaskType

Defined in: core/src/model/task.ts:100

Effective kind: 'placeholder' also for a task without dates; 'task' when the input type is malformed.


readonly valid: boolean

Defined in: core/src/model/task.ts:102

false when an error issue made the task unusable: it is a row without a bar.