Interface: Scheduling
Defined in: extensions/features/scheduling.ts:86
What scheduling() returns: the plugin, and the calls a consumer reads its state with.
Extends
Properties
aggregators?
optionalaggregators?:Readonly<Record<string,Aggregator>>
Defined in: api/plugin.ts:94
Aggregators this plugin adds, resolved before any Field naming one in rollUp.
Inherited from
DataPlugin.aggregators
fields?
optionalfields?: readonlyField&object[]
Defined in: api/plugin.ts:90
The same shape DatasetOptions.fields/fieldTypes/aggregators take (#496 grill round 3).
Registered before any entry is read — alongside the Dataset's own, and before data()
runs. So a flat value an entry carries for one of these keys survives new Dataset(...), the
same way entries.load() already does. A duplicate key across the Dataset and every plugin
throws DuplicateFieldKeyError, the same error two ordinary declarations sharing a key throw.
This is the one way a plugin declares: there is no ctx.fields.register door. A Field whose
shape depends on this plugin's own options is built in the factory that returns this object —
const costing = (opts) => ({ id: 'acme.costing', fields: [{ key: 'cost', ...opts }], data() {} }).
Each key must be one of this plugin's own props (PropsOf<TDataset>) or a core Field key.
A typo such as { key: 'lockd' } on a definePlugin<LockProps> call fails to compile. A
core-Field override such as { key: 'start' } still compiles. An untyped plugin
(definePlugin({ … }), TDataset left as unknown) names any key.
Inherited from
DataPlugin.fields
fieldTypes?
optionalfieldTypes?:Readonly<Record<string,FieldType<unknown>>>
Defined in: api/plugin.ts:92
Named Field type bundles this plugin adds, resolved before any Field naming one.
Inherited from
DataPlugin.fieldTypes
hierarchySource?
optionalhierarchySource?: (next) =>HierarchySource<Record<string,unknown>>
Defined in: api/plugin.ts:105
Declares the tree, instead of composing it from inside data() (ADR 0031). Call:
definePlugin<PhaseProps>({ id, fields: [{ key: 'phaseId' }], hierarchySource: (next) => (entry) => entry.props.phaseId ?? next(entry) }) — "its hierarchy source is the entry's phase id, or the
next source's answer."
Composes in setup order (resolveSetupOrder), the same order data() runs in. The
first plugin wraps core's own storedParentSource, and a later plugin wraps the one before it —
the last plugin answers first. Same composing idiom setExtender/setLockRule already use.
Parameters
next
HierarchySource<Record<string, unknown>>
Returns
HierarchySource<Record<string, unknown>>
Inherited from
DataPlugin.hierarchySource
id
id:
string
Defined in: api/plugin.ts:34
Inherited from
DataPlugin.id
requires?
optionalrequires?: readonlystring[]
Defined in: api/plugin.ts:39
Plugin ids that must also be installed. Does not imply an order in the array: installation
resolves setup order from requires alone, so [a, b] and [b, a] install identically. A
required id nobody installs throws MissingPluginError. One list covers both
halves (ADR 0019).
Inherited from
DataPlugin.requires
Methods
clearConstraint()
clearConstraint(
entry):void
Defined in: extensions/features/scheduling.ts:95
Removes the constraint of one Entry. One undo step covers it. An Entry with none changes nothing.
Parameters
entry
string | EntryId
Returns
void
constraintOf()
constraintOf(
entry):ScheduleConstraint|undefined
Defined in: extensions/features/scheduling.ts:88
The constraint of one Entry, or undefined when it has none.
Parameters
entry
string | EntryId
Returns
ScheduleConstraint | undefined
data()?
optionaldata(ctx):void|Disposer
Defined in: api/plugin.ts:75
Fields, the edit hook and the store. DOM-free, and runs once, on the finished Dataset. Optional:
a plugin that only declares fields, fieldTypes, aggregators or hierarchySource
needs no data() to run.
Parameters
ctx
DatasetPluginContextOf<Dataset<unknown>>
Returns
void | Disposer
Inherited from
DataPlugin.data
diagnostics()
diagnostics(): readonly
ScheduleDiagnostic[]
Defined in: extensions/features/scheduling.ts:103
The findings of the latest commit: cycles, blocked moves, Dependencies the engine cannot read.
Returns
readonly ScheduleDiagnostic[]
drivingPath()
drivingPath(
entry): readonlyEntryId[]
Defined in: extensions/features/scheduling.ts:101
The Entry ids, in order, of the chain of predecessors that sets this Entry's position. The Entry comes
last. At each step the predecessor is the one whose Dependency holds the successor with no slack.
An Entry that no Dependency holds gives itself alone. A loop member or an unknown Entry gives [].
Parameters
entry
string | EntryId
Returns
readonly EntryId[]
on()
on(
name,handler):Disposer
Defined in: extensions/features/scheduling.ts:105
Calls handler after a commit changes the findings. Returns the call that removes the handler.
Parameters
name
"scheduleDiagnostics"
handler
Returns
setConstraint()
setConstraint(
entry,constraint):void
Defined in: extensions/features/scheduling.ts:93
Sets the constraint of one Entry and moves the Entry and its successors to meet it, in one undo step.
A "finish no later than" date moves nothing: when the Entry finishes later, diagnostics() names it.
Parameters
entry
string | EntryId
constraint
Returns
void
view()?
optionalview(ctx):void|Disposer
Defined in: api/plugin.ts:96
The same half a chrome-only plugin fills. Optional: a headless plugin paints nothing.
Parameters
ctx
Returns
void | Disposer
Inherited from
DataPlugin.view