Skip to main content
The 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

export interface ILink {
  id?: TID;
  source: TID;
  target: TID;
  type: TLinkType;
  lag?: number;
}

export type TLinkType = "s2s" | "s2e" | "e2s" | "e2e";
export type TID = string | number;

Fields

id
string | number
Unique identifier for the link. Auto-generated if omitted when adding a link via api.exec("add-link", ...).
source
string | number
required
ID of the predecessor (source) task — the task that the dependent task follows.
target
string | number
required
ID of the successor (target) task — the task that depends on the source.
type
s2s
required
The link type, describing which endpoints of the source and target tasks are connected. See Link types below.
lag
number
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.
The four link types define the dependency relationship using the start (s) and end (e) points of the source and target tasks.
TypeMeaningDescription
e2sEnd-to-StartTarget starts after source ends. The most common type.
s2sStart-to-StartTarget starts when source starts.
e2eEnd-to-EndTarget ends when source ends.
s2eStart-to-EndTarget ends when source starts. Rarely used.
e2s (End-to-Start)       s2s (Start-to-Start)
[Source -------]         [Source -------]
               [Target--]  [Target------]

e2e (End-to-End)         s2e (Start-to-End)
[Source -------]             [Source -------]
        [Target-]  [Target--]
The default link type when creating a link by dragging in the UI is e2s.

Examples

Build docs developers (and LLMs) love