@elaraai/e3-ui 1.0.79 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +1 -1
  2. package/dist/src/bind/data.d.ts +178 -56
  3. package/dist/src/bind/data.d.ts.map +1 -1
  4. package/dist/src/bind/data.js +89 -72
  5. package/dist/src/bind/data.js.map +1 -1
  6. package/dist/src/bind/record.d.ts +6 -12
  7. package/dist/src/bind/record.d.ts.map +1 -1
  8. package/dist/src/bind/record.js +4 -5
  9. package/dist/src/bind/record.js.map +1 -1
  10. package/dist/src/decision/bind.d.ts +12 -1848
  11. package/dist/src/decision/bind.d.ts.map +1 -1
  12. package/dist/src/decision/index.d.ts +4 -616
  13. package/dist/src/decision/index.d.ts.map +1 -1
  14. package/dist/src/decision/queue.d.ts +23 -2310
  15. package/dist/src/decision/queue.d.ts.map +1 -1
  16. package/dist/src/decision/types.d.ts +8 -619
  17. package/dist/src/decision/types.d.ts.map +1 -1
  18. package/dist/src/decision/types.js +4 -3
  19. package/dist/src/decision/types.js.map +1 -1
  20. package/dist/src/index.d.ts +2 -2
  21. package/dist/src/index.d.ts.map +1 -1
  22. package/dist/src/index.js +2 -2
  23. package/dist/src/index.js.map +1 -1
  24. package/dist/src/internal.d.ts +3 -3
  25. package/dist/src/internal.d.ts.map +1 -1
  26. package/dist/src/internal.js +3 -3
  27. package/dist/src/internal.js.map +1 -1
  28. package/dist/src/ui.d.ts +4 -4
  29. package/dist/src/ui.d.ts.map +1 -1
  30. package/dist/src/ui.js +5 -7
  31. package/dist/src/ui.js.map +1 -1
  32. package/dist/src/utils/derive.d.ts.map +1 -1
  33. package/dist/src/utils/derive.js +4 -1
  34. package/dist/src/utils/derive.js.map +1 -1
  35. package/dist/src/utils/manifest.d.ts +4 -31
  36. package/dist/src/utils/manifest.d.ts.map +1 -1
  37. package/dist/src/utils/manifest.js +4 -31
  38. package/dist/src/utils/manifest.js.map +1 -1
  39. package/dist/test/bind/data/data.examples.d.ts +94 -13
  40. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  41. package/dist/test/bind/data/data.examples.js +240 -121
  42. package/dist/test/bind/data/data.examples.js.map +1 -1
  43. package/dist/test/bind/record/record.examples.js +2 -2
  44. package/dist/test/bind/record/record.examples.js.map +1 -1
  45. package/dist/test/decision/journal.examples.d.ts +1 -154
  46. package/dist/test/decision/journal.examples.d.ts.map +1 -1
  47. package/dist/test/decision/loop.examples.d.ts +2 -308
  48. package/dist/test/decision/loop.examples.d.ts.map +1 -1
  49. package/dist/test/decision/queue.examples.d.ts +2 -155
  50. package/dist/test/decision/queue.examples.d.ts.map +1 -1
  51. package/dist/test/diff/diff.examples.d.ts +207 -5
  52. package/dist/test/diff/diff.examples.d.ts.map +1 -1
  53. package/dist/test/diff/diff.examples.js +0 -9
  54. package/dist/test/diff/diff.examples.js.map +1 -1
  55. package/package.json +8 -8
package/README.md CHANGED
@@ -121,7 +121,7 @@ Dual-licensed:
121
121
  - [@elaraai/e3](https://www.npmjs.com/package/@elaraai/e3): SDK for authoring e3 packages with typed tasks and pipelines
122
122
  - [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core): Object store, dataflow orchestrator, execution state
123
123
  - [@elaraai/e3-types](https://www.npmjs.com/package/@elaraai/e3-types): Shared type definitions for e3 packages
124
- - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 repo`, `e3 package`, `e3 workspace`, `e3 start`, `e3 watch`, `e3 logs` commands
124
+ - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 repo`, `e3 package`, `e3 workspace`, `e3 dataflow run`, `e3 watch`, `e3 task logs` commands
125
125
  - [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3 repositories
126
126
  - [@elaraai/e3-api-server](https://www.npmjs.com/package/@elaraai/e3-api-server): REST API server for e3 repositories
127
127
  - [@elaraai/e3-api-tests](https://www.npmjs.com/package/@elaraai/e3-api-tests): Shared API compliance test suites
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @packageDocumentation
9
9
  */
10
- import { NullType, BooleanType, FunctionType, IntegerType, StringType, StructType, VariantType, OptionType, type EastType, type ExprType } from '@elaraai/east';
11
- import type { DatasetDef, TaskDef } from '@elaraai/e3';
10
+ import { ArrayType, NullType, BooleanType, FunctionType, IntegerType, StringType, StructType, VariantType, OptionType, type DictType, type EastType, type ExprType } from '@elaraai/east';
11
+ import type { DatasetDef, RecordDef, RecordIndexDef, TaskDef } from '@elaraai/e3';
12
12
  /**
13
13
  * The two operating modes for {@link Data.bind}.
14
14
  *
@@ -42,10 +42,10 @@ export type DataBindModeLiteral = "staged" | "direct";
42
42
  * @property mode - The binding's operating mode — see {@link DataBindModeType}.
43
43
  */
44
44
  export declare const DiffBindingType: StructType<{
45
- readonly source: import("@elaraai/east").ArrayType<VariantType<{
45
+ readonly source: ArrayType<VariantType<{
46
46
  readonly field: StringType;
47
47
  }>>;
48
- readonly patch: OptionType<import("@elaraai/east").ArrayType<VariantType<{
48
+ readonly patch: OptionType<ArrayType<VariantType<{
49
49
  readonly field: StringType;
50
50
  }>>>;
51
51
  readonly mode: VariantType<{
@@ -99,10 +99,10 @@ export declare const DataBindHandleType: <T extends EastType | string>(t: T) =>
99
99
  readonly 'up-to-date': NullType;
100
100
  }>>;
101
101
  readonly binding: StructType<{
102
- readonly source: import("@elaraai/east").ArrayType<VariantType<{
102
+ readonly source: ArrayType<VariantType<{
103
103
  readonly field: StringType;
104
104
  }>>;
105
- readonly patch: OptionType<import("@elaraai/east").ArrayType<VariantType<{
105
+ readonly patch: OptionType<ArrayType<VariantType<{
106
106
  readonly field: StringType;
107
107
  }>>>;
108
108
  readonly mode: VariantType<{
@@ -138,9 +138,9 @@ export type BoundValue<T extends EastType> = ExprType<ReturnType<typeof DataBind
138
138
  * runtime implementations register against this raw definition via
139
139
  * `bindPlatformFn.implement(...)`.
140
140
  */
141
- export declare const bindPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
141
+ export declare const bindPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
142
142
  readonly field: StringType;
143
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
143
+ }>>, OptionType<ArrayType<VariantType<{
144
144
  readonly field: StringType;
145
145
  }>>>, VariantType<{
146
146
  readonly staged: NullType;
@@ -161,10 +161,10 @@ export declare const bindPlatformFn: import("@elaraai/east").GenericPlatformDefi
161
161
  readonly 'up-to-date': NullType;
162
162
  }>>;
163
163
  readonly binding: StructType<{
164
- readonly source: import("@elaraai/east").ArrayType<VariantType<{
164
+ readonly source: ArrayType<VariantType<{
165
165
  readonly field: StringType;
166
166
  }>>;
167
- readonly patch: OptionType<import("@elaraai/east").ArrayType<VariantType<{
167
+ readonly patch: OptionType<ArrayType<VariantType<{
168
168
  readonly field: StringType;
169
169
  }>>>;
170
170
  readonly mode: VariantType<{
@@ -182,90 +182,90 @@ export declare const bindPlatformFn: import("@elaraai/east").GenericPlatformDefi
182
182
  */
183
183
  export declare const DataBindPrimitives: {
184
184
  /** `data_read([T], source, patch, mode) -> T` — the binding's view (mode×patch). */
185
- readonly read: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
185
+ readonly read: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
186
186
  readonly field: StringType;
187
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
187
+ }>>, OptionType<ArrayType<VariantType<{
188
188
  readonly field: StringType;
189
189
  }>>>, VariantType<{
190
190
  readonly staged: NullType;
191
191
  readonly direct: NullType;
192
192
  }>], "T">;
193
193
  /** `data_source([T], source, patch, mode) -> T` — raw source, no overlay. */
194
- readonly source: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
194
+ readonly source: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
195
195
  readonly field: StringType;
196
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
196
+ }>>, OptionType<ArrayType<VariantType<{
197
197
  readonly field: StringType;
198
198
  }>>>, VariantType<{
199
199
  readonly staged: NullType;
200
200
  readonly direct: NullType;
201
201
  }>], "T">;
202
202
  /** `data_write([T], source, patch, mode, value) -> Null`. */
203
- readonly write: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
203
+ readonly write: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
204
204
  readonly field: StringType;
205
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
205
+ }>>, OptionType<ArrayType<VariantType<{
206
206
  readonly field: StringType;
207
207
  }>>>, VariantType<{
208
208
  readonly staged: NullType;
209
209
  readonly direct: NullType;
210
210
  }>, "T"], NullType>;
211
211
  /** `data_write_and_start([T], source, patch, mode, value) -> Null`. */
212
- readonly writeAndStart: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
212
+ readonly writeAndStart: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
213
213
  readonly field: StringType;
214
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
214
+ }>>, OptionType<ArrayType<VariantType<{
215
215
  readonly field: StringType;
216
216
  }>>>, VariantType<{
217
217
  readonly staged: NullType;
218
218
  readonly direct: NullType;
219
219
  }>, "T"], NullType>;
220
220
  /** `data_start([T], source, patch, mode) -> Null`. */
221
- readonly start: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
221
+ readonly start: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
222
222
  readonly field: StringType;
223
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
223
+ }>>, OptionType<ArrayType<VariantType<{
224
224
  readonly field: StringType;
225
225
  }>>>, VariantType<{
226
226
  readonly staged: NullType;
227
227
  readonly direct: NullType;
228
228
  }>], NullType>;
229
229
  /** `data_pending([T], source, patch, mode) -> Bool`. */
230
- readonly pending: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
230
+ readonly pending: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
231
231
  readonly field: StringType;
232
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
232
+ }>>, OptionType<ArrayType<VariantType<{
233
233
  readonly field: StringType;
234
234
  }>>>, VariantType<{
235
235
  readonly staged: NullType;
236
236
  readonly direct: NullType;
237
237
  }>], BooleanType>;
238
238
  /** `data_commit([T], source, patch, mode) -> Null`. */
239
- readonly commit: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
239
+ readonly commit: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
240
240
  readonly field: StringType;
241
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
241
+ }>>, OptionType<ArrayType<VariantType<{
242
242
  readonly field: StringType;
243
243
  }>>>, VariantType<{
244
244
  readonly staged: NullType;
245
245
  readonly direct: NullType;
246
246
  }>], NullType>;
247
247
  /** `data_discard([T], source, patch, mode) -> Null`. */
248
- readonly discard: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
248
+ readonly discard: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
249
249
  readonly field: StringType;
250
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
250
+ }>>, OptionType<ArrayType<VariantType<{
251
251
  readonly field: StringType;
252
252
  }>>>, VariantType<{
253
253
  readonly staged: NullType;
254
254
  readonly direct: NullType;
255
255
  }>], NullType>;
256
256
  /** `data_has([T], source, patch, mode) -> Bool`. */
257
- readonly has: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
257
+ readonly has: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
258
258
  readonly field: StringType;
259
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
259
+ }>>, OptionType<ArrayType<VariantType<{
260
260
  readonly field: StringType;
261
261
  }>>>, VariantType<{
262
262
  readonly staged: NullType;
263
263
  readonly direct: NullType;
264
264
  }>], BooleanType>;
265
265
  /** `data_status([T], source, patch, mode) -> DatasetStatus`. */
266
- readonly status: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
266
+ readonly status: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
267
267
  readonly field: StringType;
268
- }>>, OptionType<import("@elaraai/east").ArrayType<VariantType<{
268
+ }>>, OptionType<ArrayType<VariantType<{
269
269
  readonly field: StringType;
270
270
  }>>>, VariantType<{
271
271
  readonly staged: NullType;
@@ -370,17 +370,32 @@ declare function bindData<T extends EastType>(dataset: DatasetDef<T> | TaskDef<T
370
370
  * a window is not a value you can diff or stage. Bind the same dataset with
371
371
  * {@link Data.bind} when you need to edit it.
372
372
  *
373
+ * Every window, the total and every search belong to one snapshot of the
374
+ * dataset, its `revision`, so rows from two snapshots never sit side by side.
375
+ *
376
+ * @property id - The source's identity: its dataset path, and the index it
377
+ * reads through. A renderer keys its window cache on `id` and `revision`.
373
378
  * @property page - Read one window: `(offset, limit)` → the window's elements
374
379
  * as a value of the dataset's own type. `none` means the window is still in
375
380
  * flight — the call re-fires when it lands (use inside `Reactive.Root`). An
376
381
  * EMPTY window means the source is exhausted at that offset, so a reader
377
- * that walks offsets terminates on `some([])`, never on `none`.
378
- * @property total - The source's total element count, once any window has
379
- * landed; `none` until then.
382
+ * that walks offsets terminates on `some([])`, never on `none`. A window
383
+ * whose fetch failed throws its reason, and a read after a short gap fetches
384
+ * it again.
385
+ * @property total - The source's total element count, once any window of the
386
+ * snapshot has landed; `none` until then.
380
387
  * @property seek - Key search over the dataset, backed by the server's fence
381
388
  * search (`datasetFindKey`). `none` for an Array-typed dataset: stream order
382
389
  * has nothing to binary-search. Decided at bind time from the dataset's own
383
390
  * type, so a component renders the affordance only where it works.
391
+ * @property revision - The snapshot the source serves: the dataset's content
392
+ * hash, or, for a read through an index, the record's state hash. `none`
393
+ * while it is being found, or while the dataset has no value. A reader
394
+ * re-fires when the source moves to another snapshot.
395
+ * @property refresh - Move the source: `some(hash)` to that snapshot, `none`
396
+ * to the dataset's current one. Call it from an event handler after a
397
+ * confirmed write, so the view shows the write without waiting for the
398
+ * source to notice it. Returns at once.
384
399
  */
385
400
  export declare const DataPagedHandleType: <T extends EastType | string>(t: T) => StructType<{
386
401
  readonly id: StringType;
@@ -390,15 +405,52 @@ export declare const DataPagedHandleType: <T extends EastType | string>(t: T) =>
390
405
  readonly key: StringType;
391
406
  readonly prefix: StringType;
392
407
  readonly fields: StructType<{
393
- readonly values: import("@elaraai/east").ArrayType<StringType>;
408
+ readonly values: ArrayType<StringType>;
394
409
  readonly prefix: OptionType<StringType>;
395
410
  }>;
411
+ readonly range: StructType<{
412
+ readonly from: ArrayType<StringType>;
413
+ readonly to: ArrayType<StringType>;
414
+ }>;
396
415
  }>], OptionType<StructType<{
397
416
  readonly found: BooleanType;
398
417
  readonly row: IntegerType;
399
418
  readonly count: IntegerType;
400
419
  }>>>>;
420
+ readonly revision: FunctionType<[], OptionType<StringType>>;
421
+ readonly refresh: FunctionType<[OptionType<StringType>], NullType>;
401
422
  }>;
423
+ /** The window type an index-selected {@link Data.bindPaged} serves, spelled at
424
+ * the TypeScript level so a component's prop types against it. */
425
+ export type IndexWindowType<T extends EastType, IK extends EastType, P extends EastType> = T extends DictType<infer K, infer V> ? ArrayType<StructType<{
426
+ ik: IK;
427
+ key: K;
428
+ value: P;
429
+ row: OptionType<V>;
430
+ }>> : never;
431
+ /** Reading a record through one of its secondary indexes. */
432
+ export interface BindPagedIndexOptions<T extends EastType, IK extends EastType, P extends EastType> {
433
+ /**
434
+ * The index to read through, as the `e3.recordIndex` declaration.
435
+ *
436
+ * @remarks
437
+ * The declaration rather than the name: the window's type — the index key
438
+ * and the covering projection — comes from it, so a component binding an
439
+ * index gets the row shape it will actually render, checked at compile
440
+ * time. Only the NAME travels in the IR.
441
+ */
442
+ index: RecordIndexDef<string, T, IK, P>;
443
+ /**
444
+ * Read each entry's row from the record too.
445
+ *
446
+ * @remarks
447
+ * Off by default, which is what a covering projection is for: a queue view
448
+ * that renders from `value` alone touches the index's segments and none of
449
+ * the record's. Turn it on when the view needs fields the projection does
450
+ * not carry, and accept a read per entry's segment.
451
+ */
452
+ join?: boolean;
453
+ }
402
454
  /**
403
455
  * The TypeScript type of a {@link Data.bindPaged} handle bound to source type
404
456
  * `T` — the paged sibling of {@link BoundValue}.
@@ -414,11 +466,13 @@ export declare const DataPagedHandleType: <T extends EastType | string>(t: T) =>
414
466
  */
415
467
  export type PagedValue<T extends EastType> = ExprType<ReturnType<typeof DataPagedHandleType<T>>>;
416
468
  /**
417
- * The underlying `Data.bindPaged` platform-function definition. End-users
418
- * should call {@link Data.bindPaged}; runtime implementations register
419
- * against this raw definition via `bindPagedPlatformFn.implement(...)`.
469
+ * The platform function a UI exported before pinned reads calls: a paged bind
470
+ * of the dataset's own rows, whose handle has no `revision` or `refresh`. Its
471
+ * reads are pinned, follow the dataset and fail visibly all the same, since the
472
+ * runtime serves both binds alike. End-users call {@link Data.bindPaged}, which
473
+ * emits {@link bindPagedPinnedPlatformFn}.
420
474
  */
421
- export declare const bindPagedPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
475
+ export declare const bindPagedPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
422
476
  readonly field: StringType;
423
477
  }>>], StructType<{
424
478
  readonly id: StringType;
@@ -428,14 +482,55 @@ export declare const bindPagedPlatformFn: import("@elaraai/east").GenericPlatfor
428
482
  readonly key: StringType;
429
483
  readonly prefix: StringType;
430
484
  readonly fields: StructType<{
431
- readonly values: import("@elaraai/east").ArrayType<StringType>;
485
+ readonly values: ArrayType<StringType>;
486
+ readonly prefix: OptionType<StringType>;
487
+ }>;
488
+ readonly range: StructType<{
489
+ readonly from: ArrayType<StringType>;
490
+ readonly to: ArrayType<StringType>;
491
+ }>;
492
+ }>], OptionType<StructType<{
493
+ readonly found: BooleanType;
494
+ readonly row: IntegerType;
495
+ readonly count: IntegerType;
496
+ }>>>>;
497
+ }>>;
498
+ /**
499
+ * The underlying `Data.bindPaged` platform-function definition: the source
500
+ * path, the index to read through (`none` for the dataset's own rows), and
501
+ * whether each index entry is joined to its row. Runtime implementations
502
+ * register against it via `bindPagedPinnedPlatformFn.implement(...)`.
503
+ *
504
+ * @remarks
505
+ * A function of its own rather than a wider `data_bind_paged`: that call and
506
+ * the handle it returns are baked into every UI package already exported, and
507
+ * a platform call is checked against its implementation's arity and return
508
+ * type exactly, so widening either would refuse every one of them.
509
+ */
510
+ export declare const bindPagedPinnedPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
511
+ readonly field: StringType;
512
+ }>>, OptionType<StringType>, BooleanType], StructType<{
513
+ readonly id: StringType;
514
+ readonly page: FunctionType<[IntegerType, IntegerType], OptionType<"T">>;
515
+ readonly total: FunctionType<[], OptionType<IntegerType>>;
516
+ readonly seek: OptionType<FunctionType<[VariantType<{
517
+ readonly key: StringType;
518
+ readonly prefix: StringType;
519
+ readonly fields: StructType<{
520
+ readonly values: ArrayType<StringType>;
432
521
  readonly prefix: OptionType<StringType>;
433
522
  }>;
523
+ readonly range: StructType<{
524
+ readonly from: ArrayType<StringType>;
525
+ readonly to: ArrayType<StringType>;
526
+ }>;
434
527
  }>], OptionType<StructType<{
435
528
  readonly found: BooleanType;
436
529
  readonly row: IntegerType;
437
530
  readonly count: IntegerType;
438
531
  }>>>>;
532
+ readonly revision: FunctionType<[], OptionType<StringType>>;
533
+ readonly refresh: FunctionType<[OptionType<StringType>], NullType>;
439
534
  }>>;
440
535
  /**
441
536
  * Low-level platform primitives that back {@link Data.bindPaged}'s handle
@@ -444,30 +539,47 @@ export declare const bindPagedPlatformFn: import("@elaraai/east").GenericPlatfor
444
539
  * @internal Not for direct use — author against {@link Data.bindPaged}.
445
540
  */
446
541
  export declare const DataPagedPrimitives: {
447
- /** `data_page([T], source, offset, limit) -> Option<T>` — one window (`none` = in flight). */
448
- readonly page: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
542
+ /** `data_page([T], source, index, join, offset, limit) -> Option<T>` — one
543
+ * window (`none` = in flight). */
544
+ readonly page: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
449
545
  readonly field: StringType;
450
- }>>, IntegerType, IntegerType], OptionType<string>>;
451
- /** `data_page_total([T], source) -> Option<Integer>` — total elements, once known. */
452
- readonly total: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
546
+ }>>, OptionType<StringType>, BooleanType, IntegerType, IntegerType], OptionType<string>>;
547
+ /** `data_page_total([T], source, index, join) -> Option<Integer>` — total
548
+ * elements, once known. */
549
+ readonly total: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
453
550
  readonly field: StringType;
454
- }>>], OptionType<IntegerType>>;
455
- /** `data_page_seek([T], source, query) -> Option<SeekRange>` — where a key
456
- * query lands in the source's row order (`none` = search in flight). */
457
- readonly seek: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [import("@elaraai/east").ArrayType<VariantType<{
551
+ }>>, OptionType<StringType>, BooleanType], OptionType<IntegerType>>;
552
+ /** `data_page_seek([T], source, index, join, query) -> Option<SeekRange>` —
553
+ * where a key query lands in the source's row order (`none` = search in
554
+ * flight). */
555
+ readonly seek: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
458
556
  readonly field: StringType;
459
- }>>, VariantType<{
557
+ }>>, OptionType<StringType>, BooleanType, VariantType<{
460
558
  readonly key: StringType;
461
559
  readonly prefix: StringType;
462
560
  readonly fields: StructType<{
463
- readonly values: import("@elaraai/east").ArrayType<StringType>;
561
+ readonly values: ArrayType<StringType>;
464
562
  readonly prefix: OptionType<StringType>;
465
563
  }>;
564
+ readonly range: StructType<{
565
+ readonly from: ArrayType<StringType>;
566
+ readonly to: ArrayType<StringType>;
567
+ }>;
466
568
  }>], OptionType<StructType<{
467
569
  readonly found: BooleanType;
468
570
  readonly row: IntegerType;
469
571
  readonly count: IntegerType;
470
572
  }>>>;
573
+ /** `data_page_revision([T], source, index, join) -> Option<String>` — the
574
+ * snapshot the source serves (`none` while it is found). */
575
+ readonly revision: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
576
+ readonly field: StringType;
577
+ }>>, OptionType<StringType>, BooleanType], OptionType<StringType>>;
578
+ /** `data_page_refresh([T], source, index, join, target) -> Null` — move
579
+ * the source to `target`, or to the dataset's current snapshot. */
580
+ readonly refresh: import("@elaraai/east").GenericPlatformDefinition<readonly ["T"], readonly [ArrayType<VariantType<{
581
+ readonly field: StringType;
582
+ }>>, OptionType<StringType>, BooleanType, OptionType<StringType>], NullType>;
471
583
  };
472
584
  /**
473
585
  * Bind a collection dataset (Array / Set / Dict) to a WINDOWED reactive view
@@ -480,19 +592,28 @@ export declare const DataPagedPrimitives: {
480
592
  *
481
593
  * @typeParam T - The East type of the source dataset value (a collection type).
482
594
  * @param dataset - The dataset (or task) definition to bind.
483
- * @returns A handle struct described by {@link DataPagedHandleType} — `page`
484
- * and `total`.
595
+ * @returns A handle struct described by {@link DataPagedHandleType} — `page`,
596
+ * `total`, `seek`, `revision` and `refresh`.
485
597
  *
486
598
  * @remarks
487
599
  * Each `page(offset, limit)` fetches exactly that window and decodes it
488
600
  * against the dataset's own type — no blobs, no beast2, no manual fetch in
489
601
  * user code. A window still in flight reads `none` and the call re-fires when
490
602
  * it lands, so use it inside `Reactive.Root`; an empty window means the source
491
- * is exhausted, which is how a walking reader terminates.
603
+ * is exhausted, which is how a walking reader terminates. A window whose fetch
604
+ * failed throws its reason, so a view shows the failure rather than waiting;
605
+ * a read after a short gap fetches it again.
606
+ *
607
+ * Every window and search is pinned to the source's `revision`, the dataset's
608
+ * content hash, so rows from two snapshots never sit side by side. The source
609
+ * follows its dataset: when the content changes — a dataflow run, another
610
+ * user's write — it moves to the new snapshot, drops what it held, and fetches
611
+ * again only the windows and searches being read. `refresh` moves it at once,
612
+ * after a write the view itself confirmed.
492
613
  *
493
- * Unlike {@link Data.bind}, a paged source is NOT preloaded or polled as a
494
- * whole value — it is declared in the UI task's manifest under `pages`, which
495
- * is the entire point of binding it paged.
614
+ * Unlike {@link Data.bind}, a paged source is never preloaded or fetched
615
+ * whole: it is declared in the UI task's manifest under `pages`, and follows
616
+ * its dataset by content hash alone, which is the point of binding it paged.
496
617
  *
497
618
  * @example
498
619
  * ```ts
@@ -521,6 +642,7 @@ export declare const DataPagedPrimitives: {
521
642
  * ```
522
643
  */
523
644
  declare function bindDataPaged<T extends EastType>(dataset: DatasetDef<T> | TaskDef<T>): PagedValue<T>;
645
+ declare function bindDataPaged<T extends EastType, IK extends EastType, P extends EastType>(record: RecordDef<T>, options: BindPagedIndexOptions<T, IK, P>): PagedValue<IndexWindowType<T, IK, P>>;
524
646
  /**
525
647
  * The Data namespace — reactive dataset binding for e3 UI tasks.
526
648
  *
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/bind/data.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;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