Skip to main content

Interface: CommandContextOf<TGantt, TDataset>

Defined in: api/command.ts:177

TDataset defaults to the public, untyped Dataset the same way TGantt defaults to unknown — a plugin author binding their own Dataset<TProps> gets a typed ctx.dataset at every when/run; code with no reason to bind either type argument sees the exact surface it always has (#141 item #9).

Type Parameters​

TGantt​

TGantt = unknown

TDataset​

TDataset = Dataset

Properties​

dataset​

dataset: TDataset

Defined in: api/command.ts:179

The public Dataset. No privileged access, no second surface.


entry?​

optional entry?: Entry<Record<string, unknown>>

Defined in: api/command.ts:189

The Selection's first Entry — the subject a command acts on, not necessarily the node the user clicked or focused (target is that; see below). On a right-click outside the Selection, the click replaces the Selection first (plans/02 §4.6), so entry reads as "the clicked bar" on that one path — but a right-click inside a multi-bar Selection, and every keyboard path (the menu key, Mod+Arrow), never click at all: entry is whichever Entry the Selection puts first, which can differ from what carries DOM focus on a segmented row. undefined when the Selection is empty.


gantt​

gantt: TGantt

Defined in: api/command.ts:181

The public Gantt, for reading live config and calling public methods.


target?​

optional target?: CommandTarget

Defined in: api/command.ts:204

The node the user acted on — DOM focus, not the Selection. A command that means "the row under the pointer/focus", rather than "the Selection's subject", reads this instead of entry; the two can name different Entries on a segmented row. CommandTarget.entryIds names every Entry the target row owns, focused one first.


variant?​

optional variant?: string

Defined in: api/command.ts:199

The variant this Gantt resolved for entry (ADR 0018). undefined when the invocation names no Entry at all.

A command scoped to one variant reads it: when: ({ variant }) => variant === MY_VARIANT. That is the same answer the layout pass painted with, so a plugin never restates its own when rule here, and never keeps a list of the ids it owns.

This is not entry.variant under another name. A variant is per Gantt, so a row cannot answer it (I2). A command context is one Gantt's, and it runs off the hot path.