[Canonical page](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Common types

Scalar formats, enum values and small object shapes that several payloads share. Field names are given in wire spelling. `Id`, `DateValue`, `TimeUnit`, `ConstraintType`, `Pause`, `ResourceData`, `Subtree`, `AnalyticsOptions` and `ProfileQuery` are named types in the package's TypeScript declarations. The other sections describe value sets that the declarations write inline on the fields that use them.

## Id

An id of a task, link, calendar, resource, assignment, slot or candidate.

```ts
type Id = string | number;
```

Ids are compared like JavaScript object keys, so `1` and `"1"` are the same id. Numeric ids are double-precision floats; send ids beyond `Number.MAX_SAFE_INTEGER` as strings. Whole-number ids come back as JSON integers.

```json
[1, "1", "task-7", 2.5]
```

The first two values name the same object.

Used wherever a payload references an object: `id`, `parent`, `source`, `target`, `task`, `resource`, `calendar_id` and the id lists in results. See [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md#ids>).

## DateValue

A naive local date-time at minute precision, sent as a string. It has no timezone and no daylight saving.

```ts
type DateValue = string | Date;
```

| Direction | Form |
|---|---|
| Input | `YYYY-MM-DD`, `YYYY-MM-DD HH:mm` or `YYYY-MM-DDTHH:mm`, each with optional `:ss`. A bare date means `00:00`. Seconds are dropped. |
| Output | Always `YYYY-MM-DD HH:mm`. |

```json
["2026-03-02", "2026-03-02 08:00", "2026-03-02T08:00:30"]
```

These inputs come back as `"2026-03-02 00:00"`, `"2026-03-02 08:00"` and `"2026-03-02 08:00"`. Any other string fails the call with `validation`, message `invalid date`, and no `path`.

`Date` is accepted only by the JS glue; the raw exports take strings.

Used by task and constraint dates, `config.project_start` / `project_end`, profile and leveling ranges, and every date in a result.

## TimeUnit

The unit of a duration or lag.

```ts
type TimeUnit = "minute" | "hour" | "day";
```

`"week"`, `"month"` and `"year"` are reserved and fail with `validation`. In the elapsed fields `leveling_delay` and `pauses`, an hour is 60 minutes and a day is 24 hours.

Used by [`SchedulingConfig`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-config.md>)`.duration_unit` (default `"day"`), [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>)`.duration_unit` and [`LinkData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/link-data.md>)`.lag_unit`.

## ConstraintType

A task's scheduling constraint. Matching is case-insensitive.

| Value | Constraint | Needs `constraint_date` |
|---|---|---|
| `"asap"` | As soon as possible | no |
| `"alap"` | As late as possible | no |
| `"snet"` | Start no earlier than | yes |
| `"snlt"` | Start no later than | yes |
| `"fnet"` | Finish no earlier than | yes |
| `"fnlt"` | Finish no later than | yes |
| `"mso"` | Must start on | yes |
| `"mfo"` | Must finish on | yes |

Used by [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>)`.constraint_type`, [`TaskUpdate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-update.md>)`.constraint_type` and the `constraint-violation` [conflict](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#conflict>). How constraints act is in [Links, constraints and summaries](<https://docs.dhtmlx.com/planning-engine/wasm/scheduling/links-constraints-summaries.md>).

## Gap behavior

How tasks are placed when links leave room.

| Value | Effect |
|---|---|
| `"preserve"` | Default. Tasks keep their preferred dates when links allow. |
| `"compress"` | Every task moves to its earliest position. |

Used by [`SchedulingConfig`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-config.md>)`.gap_behavior`.

## Calendar mode

Which calendars the work of a task runs on.

| Value | Effect |
|---|---|
| `"resource"` | Default. Each assignment works on its resource's calendar combined with the task's. |
| `"task"` | Task calendars only. |
| `"task-inherited"` | Task calendars only; a task without `calendar_id` uses its nearest ancestor's. |

Used by [`SchedulingConfig`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-config.md>)`.calendar_mode`. The rules are in [Working-time calendars](<https://docs.dhtmlx.com/planning-engine/wasm/scheduling/working-time-calendars.md>).

## Load basis

The bucket size for resource load.

| Value | Bucket |
|---|---|
| `"hour"` | One hour |
| `"day"` | One day |

When a `basis` field is omitted, it's derived from `config.duration_unit`: `"day"` for `day`, `"hour"` for `hour` and `minute`. Used by [`LevelingOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/leveling-options.md>)`.basis`, [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#profilequery>)`.basis` and [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/load-profile.md>)`.basis`.

## Link type

The dependency type of a link.

| Value | Accepted forms | Dependency |
|---|---|---|
| FS | `"fs"`, `0`, `"0"` | Finish to start (default) |
| SS | `"ss"`, `1`, `"1"` | Start to start |
| FF | `"ff"`, `2`, `"2"` | Finish to finish |
| SF | `"sf"`, `3`, `"3"` | Start to finish |

Strings match in any case, so `"FS"` is accepted. Other numbers and strings fail with `validation`. Used by [`LinkData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/link-data.md>)`.type` and the link entries of [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>).

## Task type

The kind of a task.

| Value | Kind |
|---|---|
| `"task"` | A leaf task (default) |
| `"summary"` | A summary task whose span covers its children |
| `"project"` | Input alias of `"summary"`; output says `"summary"` |
| `"milestone"` | A zero-duration point |

Used by [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>)`.type`. Result entries report the kind as `kind` on [`Mutation`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#mutation>).

## Validation mode

How a project treats invalid input.

| Value | Effect |
|---|---|
| `"strict"` | Default. Invalid input fails the call with `validation`. |
| `"repair"` | Coerces invalid data (duplicate ids, missing or inconsistent dates, dated constraints without a date) and reports each fix as a `repaired` [note](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#note>). |

Used by `ProjectOptions.validation` in the [`JsonProject`](<https://docs.dhtmlx.com/planning-engine/wasm/api/json-project.md#projectoptions>) constructor. See [Accept messy input](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/accept-messy-input.md>).

## Pause

One leveling split of a task.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `at` | `number` | yes | - | Start of the pause after the task start. Elapsed time in the task's `duration_unit`, finite and `>= 0` |
| `length` | `number` | yes | - | Length of the pause. Elapsed time in the task's `duration_unit`, finite and `> 0` |
| `by` | `"leveling"` \| `null` | no | absent | Who wrote the pause. `"leveling"` is the only value; the leveler sets it on every pause it writes |

A pause occupies the whole minutes from `round(at)` to `round(at + length)`. A pause that rounds to zero length is ignored. Unknown fields are ignored.

Used by [`TaskData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-data.md>)`.pauses`, [`TaskUpdate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/task-update.md>)`.pauses` and [`Mutation`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#mutation>)`.pauses`. How pauses affect dates and load is in [Leveling resources](<https://docs.dhtmlx.com/planning-engine/wasm/resources-and-assignment/leveling-resources.md#delays-and-pauses>).

## ResourceData

A resource that assignments book.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `id` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) | yes | - | Resource id |
| `capacity` | `number` \| `null` | no | `config.default_resource_capacity` (`1`) | Units the resource can carry per bucket, in assignment `value` units (`1` = 100 %). Finite and `>= 0` |
| `calendar_id` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) \| `null` | no | none | The resource's calendar. With `calendar_mode: "resource"` it must name a calendar in `ProjectData.calendars` |

Unknown fields are ignored. An invalid `capacity` fails with `validation` at `resources[i].capacity`; an unknown `calendar_id` at `resources[i].calendar_id`.

Used by [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/project-data.md>)`.resources` and `resources.add` in [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>). An edit to an existing resource is a [`ResourceUpdate`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md#resourceupdate>).

## Subtree

Limits a run to one branch of the task tree.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `task` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>) | yes | - | Root task of the branch. Must be a known, scheduled task |
| `inclusive` | `boolean` \| `null` | no | `true` | `true` includes the root task itself; `false` covers only its descendants |

Unknown fields fail with `parse`. An unknown or unscheduled `task` fails with `validation` at `subtree.task`.

Used by [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/solve-options.md>)`.subtree` and [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md#previewoptions>)`.subtree`. See [Reschedule a branch](<https://docs.dhtmlx.com/planning-engine/wasm/how-to/reschedule-a-branch.md>).

## AnalyticsOptions

Requests analytics in a result.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `criticalPath` | `boolean` \| `null` | no | `false` | Adds `analytics.criticalPath` |
| `slack` | `boolean` \| `null` | no | `false` | Adds `analytics.slack` |

Unknown fields fail with `parse`. The filled shape is [`Analytics`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/schedule-result.md#analytics>).

Used by [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/solve-options.md>)`.analytics`, [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md#previewoptions>)`.analytics` and [`AnalyzeOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-analyze.md#analyzeoptions>)`.analytics`.

## ProfileQuery

The range and resources a load profile covers.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `from` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) | yes | - | Range start. Buckets whose start lies in `[from, to)` are reported |
| `to` | [`DateValue`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#datevalue>) | yes | - | Range end, after `from` |
| `resources` | [`Id`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/common.md#id>)`[]` \| `null` | no | every resource | Resources to report, in this order |
| `basis` | `"hour"` \| `"day"` \| `null` | no | derived from `config.duration_unit` | Bucket size |
| `tasks` | `"none"` \| `"overallocated"` \| `"all"` \| `null` | no | `"none"` | Task ids per bucket: none (the field is absent), only in buckets where load exceeds capacity, or every booked task |

Unknown fields fail with `parse`. `to` not after `from`, or more than 100 000 buckets per resource, fails with `validation` at `to`; an unknown resource id at `resources`.

Used by [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-preview.md#previewoptions>)`.profile`. [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/wasm/api/project-load-profile.md#loadprofileoptions>) takes the same fields flat, plus `baselineId`. The result is a [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/load-profile.md>).

## Related

- [Wire format](<https://docs.dhtmlx.com/planning-engine/wasm/wire-format.md>) - ids, dates and `null` handling on the wire
- [`ProjectData`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/project-data.md>) - the snapshot most of these shapes go into
- [`SchedulingChanges`](<https://docs.dhtmlx.com/planning-engine/wasm/api/types/scheduling-changes.md>) - the change set that reuses them
