ILink interface defines a dependency link between two tasks. Links are rendered as arrows on the Gantt chart and can represent four types of task relationships.
TypeScript definition
Fields
Unique identifier for the link. Auto-generated if omitted when adding a link via
api.exec("add-link", ...).ID of the predecessor (source) task — the task that the dependent task follows.
ID of the successor (target) task — the task that depends on the source.
The link type, describing which endpoints of the source and target tasks are connected. See Link types below.
A time offset in
durationUnit units (days by default). A positive lag introduces a delay between the two tasks. A negative value represents lead time (overlap). Defaults to 0.Link types
The four link types define the dependency relationship using the start (s) and end (e) points of the source and target tasks.
| Type | Meaning | Description |
|---|---|---|
e2s | End-to-Start | Target starts after source ends. The most common type. |
s2s | Start-to-Start | Target starts when source starts. |
e2e | End-to-End | Target ends when source ends. |
s2e | Start-to-End | Target ends when source starts. Rarely used. |
The default link type when creating a link by dragging in the UI is
e2s.Examples
- End-to-Start link
- With lag
- Adding a link via API