Skip to main content

Interface: EntryDependencies

Defined in: extensions/features/entry-dependencies.ts:77

What entryDependencies() returns: the plugin, and the calls a consumer writes Dependencies with.

Extends​

Properties​

aggregators?​

optional aggregators?: 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?​

optional fields?: readonly Field & 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?​

optional fieldTypes?: 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?​

optional hierarchySource?: (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?​

optional requires?: readonly string[]

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​

add()​

add(dependency): void

Defined in: extensions/features/entry-dependencies.ts:82

Adds one Dependency. One undo step covers it.

Parameters​

dependency​

DependencyInput

Returns​

void


all()​

all(): readonly Dependency[]

Defined in: extensions/features/entry-dependencies.ts:86

Every Dependency, grouped by successor.

Returns​

readonly Dependency[]


data()?​

optional data(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


on()​

on<Name>(name, handler): Disposer

Defined in: extensions/features/entry-dependencies.ts:91

Calls handler for a remove the user makes with the keyboard. A call to remove(id) raises no event, because the consumer's own code made it. Returns the call that removes the handler.

Type Parameters​

Name​

Name extends keyof DependencyEvents

Parameters​

name​

Name

handler​

DependencyEvents[Name]

Returns​

Disposer


predecessorsOf()​

predecessorsOf(entry): readonly Dependency[]

Defined in: extensions/features/entry-dependencies.ts:88

The Dependencies that make entry a successor.

Parameters​

entry​

string | EntryId

Returns​

readonly Dependency[]


remove()​

remove(id): void

Defined in: extensions/features/entry-dependencies.ts:84

Removes the Dependency with this id. An unknown id changes nothing. One undo step covers it.

Parameters​

id​

string

Returns​

void


replaceAll()​

replaceAll(dependencies): void

Defined in: extensions/features/entry-dependencies.ts:80

Makes the Dependencies equal dependencies. Records no undo step. An unknown Entry id throws, and nothing changes.

Parameters​

dependencies​

readonly DependencyInput[]

Returns​

void


view()?​

optional view(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​

PluginContext

Returns​

void | Disposer

Inherited from​

DataPlugin.view