Interface: DatasetOptions<TProps>
Defined in: api/dataset.ts:60
Type Parameters
TProps
TProps = unknown
Properties
aggregators?
optionalaggregators?:Readonly<Record<string,Aggregator>>
Defined in: api/dataset.ts:92
Consumer Aggregators by name. Shipped names (min, sum, …) are already registered.
entries
entries: readonly
EntryIngestInput<TProps>[]
Defined in: api/dataset.ts:69
What the consumer writes. Ids are plain strings and dates are any InstantInput — an ISO string,
a Date, epoch milliseconds, or an already-branded Instant. Read into Entry once, here.
A declared Field key sits flat, at the top level, the same shape add()/update() take (ADR
0011); a nested props stays legal for passenger keys and for a bag already held. Typed as
EntryIngestInput<TProps> — see model/stored-entry.ts's own comment for why a function
generic over TProps needs the plain EntryInput<TProps> half of the union, and why a
concrete TProps still gets the flat-key check.
fields?
optionalfields?: readonlyField[]
Defined in: api/dataset.ts:88
Consumer Field declarations. Core Fields are already in the registry.
fieldTypes?
optionalfieldTypes?:Readonly<Record<string,FieldType<unknown>>>
Defined in: api/dataset.ts:90
Named Field type bundles. A Field's own keys win over the bundle.
history?
optionalhistory?:false| {capacity?:number; }
Defined in: api/dataset.ts:100
Undo/redo History. { capacity: 200 } keeps 200 undoable transactions; defaults to 100
(plans/s2-data-core/s2.5-undo-redo.md §1). entries.syncAll() records no step of its own
(docs/11-server-data.md), so a frequent poll never eats into this headroom.
false builds no History: the app owns undo and writes each step back with replay().
canUndo and canRedo then always read false, undo() and redo() do nothing, and the
Gantt's own Undo and Redo commands turn off, so the app can bind Mod+Z to its own undo.
locale?
optionallocale?:LocalesArgument
Defined in: api/dataset.ts:86
Locale for a Field's formatted text (#583) — named once, here, instead of on every
formatFieldValue call. Fixed for this Dataset's lifetime, the same as timeZone. Omit it
to let each caller name its own, or fall back further still to the runtime's own locale:
dataset.formatFieldValue(entry, key, locale?) reads locale ?? this.locale, and a Gantt with
no locale of its own reads this before the runtime's own.
plugins?
optionalplugins?: readonlyPluginOf<unknown,unknown>[]
Defined in: api/dataset.ts:118
The plugins this Dataset installs (ADR 0019). An unordered set: installation resolves
setup order from each plugin's requires, so [scheduling(), entryDependencies()] and the
reverse install the same way.
A plugin's fields/fieldTypes/hierarchySource declare this Dataset's shape; data() itself
runs only once that whole Dataset — the construction Rollup included — is built (ADR 0031). This
declared shape cannot change after construction, which is why Dataset.plugins is read-only. A
plugin that also fills a view half has that half run once per Gantt bound to this Dataset, each
with its own context (I2). A chrome-only plugin is legal here too, and then every Gantt on this
Dataset gets it; install it on one Gantt instead to give it to that Gantt alone.
This Dataset holds each plugin with its own props erased (PluginOf<unknown, unknown>): a
plugin's type argument names its own keys, not this Dataset's TProps, so a Dataset<TaskProps>
installs a DataPlugin<LockProps> whatever TaskProps and LockProps are. The Dataset still
hands itself to that plugin's data(ctx) typed as Dataset<LockProps> — ctx.dataset is the
plugin's own view onto the same trust boundary the class note above describes. It sees the
plugin's own key set, independent of this Dataset's own TProps.
timeZone?
optionaltimeZone?:string
Defined in: api/dataset.ts:80
IANA timeZone (D6, plans/02 §2) — all zone-aware date arithmetic (day boundaries, snapping,
week starts) resolves through it, so two users in different zones see identical day boundaries.
It is also the zone a Plain (zoneless) date in entries resolves through.
Optional (#129). Omit it to author in the current viewer's own zone — resolved once, at
construction, from the environment (Intl, 'UTC' if that reports nothing) and then fixed
for this Dataset's lifetime, same as an explicit value. Omitting it trades cross-viewer
consistency for ergonomics: a Plain date then reads differently for a viewer in a different
zone. Pass it explicitly whenever the dataset must render identically for every viewer, such
as a shared project plan.