@elaraai/east-ui 1.0.80 → 1.0.82
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.
- package/dist/src/charts/chart/index.d.ts +4 -0
- package/dist/src/charts/chart/index.d.ts.map +1 -1
- package/dist/src/charts/spec/index.d.ts +8 -0
- package/dist/src/charts/spec/index.d.ts.map +1 -1
- package/dist/src/collections/deck/index.d.ts +8 -0
- package/dist/src/collections/deck/index.d.ts.map +1 -1
- package/dist/src/collections/index.d.ts +2 -2
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/library/index.d.ts +4 -0
- package/dist/src/collections/library/index.d.ts.map +1 -1
- package/dist/src/collections/library/types.d.ts +4 -0
- package/dist/src/collections/library/types.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.d.ts +56 -19
- package/dist/src/collections/matrix/index.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.js +38 -24
- package/dist/src/collections/matrix/index.js.map +1 -1
- package/dist/src/collections/plan/assemble.d.ts +655 -2113
- package/dist/src/collections/plan/assemble.d.ts.map +1 -1
- package/dist/src/collections/plan/assemble.js +159 -136
- package/dist/src/collections/plan/assemble.js.map +1 -1
- package/dist/src/collections/plan/builders.d.ts +193 -40
- package/dist/src/collections/plan/builders.d.ts.map +1 -1
- package/dist/src/collections/plan/builders.js +162 -32
- package/dist/src/collections/plan/builders.js.map +1 -1
- package/dist/src/collections/plan/factories.d.ts +290 -116
- package/dist/src/collections/plan/factories.d.ts.map +1 -1
- package/dist/src/collections/plan/factories.js +281 -156
- package/dist/src/collections/plan/factories.js.map +1 -1
- package/dist/src/collections/plan/index.d.ts +111 -58
- package/dist/src/collections/plan/index.d.ts.map +1 -1
- package/dist/src/collections/plan/index.js +62 -31
- package/dist/src/collections/plan/index.js.map +1 -1
- package/dist/src/collections/plan/ir.d.ts +759 -1769
- package/dist/src/collections/plan/ir.d.ts.map +1 -1
- package/dist/src/collections/plan/ir.js +51 -27
- package/dist/src/collections/plan/ir.js.map +1 -1
- package/dist/src/collections/plan/pick.d.ts +89 -71
- package/dist/src/collections/plan/pick.d.ts.map +1 -1
- package/dist/src/collections/plan/pick.js +101 -86
- package/dist/src/collections/plan/pick.js.map +1 -1
- package/dist/src/collections/plan/root.d.ts +164 -77
- package/dist/src/collections/plan/root.d.ts.map +1 -1
- package/dist/src/collections/plan/root.js +350 -42
- package/dist/src/collections/plan/root.js.map +1 -1
- package/dist/src/collections/plan/series.d.ts +12524 -10527
- package/dist/src/collections/plan/series.d.ts.map +1 -1
- package/dist/src/collections/plan/series.js +1596 -298
- package/dist/src/collections/plan/series.js.map +1 -1
- package/dist/src/collections/plan/types.d.ts +6115 -2802
- package/dist/src/collections/plan/types.d.ts.map +1 -1
- package/dist/src/collections/plan/types.js +575 -170
- package/dist/src/collections/plan/types.js.map +1 -1
- package/dist/src/collections/sheet/bridge.d.ts +154 -43
- package/dist/src/collections/sheet/bridge.d.ts.map +1 -1
- package/dist/src/collections/sheet/bridge.js +383 -240
- package/dist/src/collections/sheet/bridge.js.map +1 -1
- package/dist/src/collections/sheet/columns.d.ts +66 -16
- package/dist/src/collections/sheet/columns.d.ts.map +1 -1
- package/dist/src/collections/sheet/columns.js +25 -25
- package/dist/src/collections/sheet/columns.js.map +1 -1
- package/dist/src/collections/sheet/context-bridge.d.ts +48 -0
- package/dist/src/collections/sheet/context-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/context-bridge.js +216 -0
- package/dist/src/collections/sheet/context-bridge.js.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts +37 -0
- package/dist/src/collections/sheet/draft-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/draft-bridge.js +153 -0
- package/dist/src/collections/sheet/draft-bridge.js.map +1 -0
- package/dist/src/collections/sheet/drafts.d.ts +14 -0
- package/dist/src/collections/sheet/drafts.d.ts.map +1 -0
- package/dist/src/collections/sheet/drafts.js +14 -0
- package/dist/src/collections/sheet/drafts.js.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts +36 -0
- package/dist/src/collections/sheet/editing-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-bridge.js +196 -0
- package/dist/src/collections/sheet/editing-bridge.js.map +1 -0
- package/dist/src/collections/sheet/editing-types.d.ts +268 -0
- package/dist/src/collections/sheet/editing-types.d.ts.map +1 -0
- package/dist/src/collections/sheet/editing-types.js +34 -0
- package/dist/src/collections/sheet/editing-types.js.map +1 -0
- package/dist/src/collections/sheet/edits.d.ts +37 -0
- package/dist/src/collections/sheet/edits.d.ts.map +1 -0
- package/dist/src/collections/sheet/edits.js +31 -0
- package/dist/src/collections/sheet/edits.js.map +1 -0
- package/dist/src/collections/sheet/group.d.ts +165 -0
- package/dist/src/collections/sheet/group.d.ts.map +1 -0
- package/dist/src/collections/sheet/group.js +52 -0
- package/dist/src/collections/sheet/group.js.map +1 -0
- package/dist/src/collections/sheet/index.d.ts +171 -27
- package/dist/src/collections/sheet/index.d.ts.map +1 -1
- package/dist/src/collections/sheet/index.js +99 -17
- package/dist/src/collections/sheet/index.js.map +1 -1
- package/dist/src/collections/sheet/link.d.ts +22 -16
- package/dist/src/collections/sheet/link.d.ts.map +1 -1
- package/dist/src/collections/sheet/link.js +18 -12
- package/dist/src/collections/sheet/link.js.map +1 -1
- package/dist/src/collections/sheet/registers.d.ts +152 -5
- package/dist/src/collections/sheet/registers.d.ts.map +1 -1
- package/dist/src/collections/sheet/registers.js +154 -5
- package/dist/src/collections/sheet/registers.js.map +1 -1
- package/dist/src/collections/sheet/root.d.ts +175 -26
- package/dist/src/collections/sheet/root.d.ts.map +1 -1
- package/dist/src/collections/sheet/root.js +150 -26
- package/dist/src/collections/sheet/root.js.map +1 -1
- package/dist/src/collections/sheet/seed-bridge.d.ts +14 -0
- package/dist/src/collections/sheet/seed-bridge.d.ts.map +1 -0
- package/dist/src/collections/sheet/seed-bridge.js +51 -0
- package/dist/src/collections/sheet/seed-bridge.js.map +1 -0
- package/dist/src/collections/sheet/sub-rows.d.ts +249 -0
- package/dist/src/collections/sheet/sub-rows.d.ts.map +1 -0
- package/dist/src/collections/sheet/sub-rows.js +222 -0
- package/dist/src/collections/sheet/sub-rows.js.map +1 -0
- package/dist/src/collections/sheet/transactions.d.ts +76 -0
- package/dist/src/collections/sheet/transactions.d.ts.map +1 -0
- package/dist/src/collections/sheet/transactions.js +40 -0
- package/dist/src/collections/sheet/transactions.js.map +1 -0
- package/dist/src/collections/sheet/types.d.ts +12034 -3651
- package/dist/src/collections/sheet/types.d.ts.map +1 -1
- package/dist/src/collections/sheet/types.js +365 -48
- package/dist/src/collections/sheet/types.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +98 -123
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +97 -111
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/collections/table/types.d.ts +87 -31
- package/dist/src/collections/table/types.d.ts.map +1 -1
- package/dist/src/collections/table/types.js +51 -26
- package/dist/src/collections/table/types.js.map +1 -1
- package/dist/src/collections/value-tree/flatten.d.ts.map +1 -1
- package/dist/src/collections/value-tree/flatten.js +4 -1
- package/dist/src/collections/value-tree/flatten.js.map +1 -1
- package/dist/src/component.d.ts +5075 -4079
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +46 -46
- package/dist/src/component.js.map +1 -1
- package/dist/src/contracts/approval.d.ts +10 -8
- package/dist/src/contracts/approval.d.ts.map +1 -1
- package/dist/src/contracts/approval.js +10 -8
- package/dist/src/contracts/approval.js.map +1 -1
- package/dist/src/contracts/drag.d.ts +11 -9
- package/dist/src/contracts/drag.d.ts.map +1 -1
- package/dist/src/contracts/drag.js +28 -21
- package/dist/src/contracts/drag.js.map +1 -1
- package/dist/src/contracts/editing.d.ts +1283 -0
- package/dist/src/contracts/editing.d.ts.map +1 -0
- package/dist/src/contracts/editing.js +711 -0
- package/dist/src/contracts/editing.js.map +1 -0
- package/dist/src/contracts/index.d.ts +2 -1
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +2 -1
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/contracts/pick.d.ts +6 -7
- package/dist/src/contracts/pick.d.ts.map +1 -1
- package/dist/src/contracts/pick.js +6 -7
- package/dist/src/contracts/pick.js.map +1 -1
- package/dist/src/contracts/review.d.ts +3 -1
- package/dist/src/contracts/review.d.ts.map +1 -1
- package/dist/src/contracts/review.js +3 -1
- package/dist/src/contracts/review.js.map +1 -1
- package/dist/src/contracts/source.d.ts +270 -80
- package/dist/src/contracts/source.d.ts.map +1 -1
- package/dist/src/contracts/source.js +357 -58
- package/dist/src/contracts/source.js.map +1 -1
- package/dist/src/display/chip-rail/index.d.ts.map +1 -1
- package/dist/src/display/chip-rail/index.js +10 -10
- package/dist/src/display/chip-rail/index.js.map +1 -1
- package/dist/src/extension.d.ts +2 -1
- package/dist/src/extension.d.ts.map +1 -1
- package/dist/src/extension.js +2 -1
- package/dist/src/extension.js.map +1 -1
- package/dist/src/format/index.d.ts +1 -154
- package/dist/src/format/index.d.ts.map +1 -1
- package/dist/src/format/types.d.ts +35 -23
- package/dist/src/format/types.d.ts.map +1 -1
- package/dist/src/format/types.js +16 -14
- package/dist/src/format/types.js.map +1 -1
- package/dist/src/forms/field/index.js +4 -4
- package/dist/src/forms/field/index.js.map +1 -1
- package/dist/src/forms/file-upload/index.js +16 -16
- package/dist/src/forms/file-upload/index.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +8 -3
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +11 -3
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/box/index.d.ts.map +1 -1
- package/dist/src/layout/box/index.js +47 -47
- package/dist/src/layout/box/index.js.map +1 -1
- package/dist/src/layout/flex/index.d.ts.map +1 -1
- package/dist/src/layout/flex/index.js +47 -47
- package/dist/src/layout/flex/index.js.map +1 -1
- package/dist/src/layout/grid/index.js +11 -11
- package/dist/src/layout/grid/index.js.map +1 -1
- package/dist/src/layout/scroll-area/index.d.ts.map +1 -1
- package/dist/src/layout/scroll-area/index.js +8 -8
- package/dist/src/layout/scroll-area/index.js.map +1 -1
- package/dist/src/layout/separator/index.d.ts.map +1 -1
- package/dist/src/layout/separator/index.js +6 -6
- package/dist/src/layout/separator/index.js.map +1 -1
- package/dist/src/layout/stack/index.d.ts.map +1 -1
- package/dist/src/layout/stack/index.js +46 -46
- package/dist/src/layout/stack/index.js.map +1 -1
- package/dist/src/layout/sticky/index.d.ts.map +1 -1
- package/dist/src/layout/sticky/index.js +8 -8
- package/dist/src/layout/sticky/index.js.map +1 -1
- package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
- package/dist/src/overlays/action-bar/index.js +8 -8
- package/dist/src/overlays/action-bar/index.js.map +1 -1
- package/dist/src/platform/index.d.ts +1 -1
- package/dist/src/platform/index.d.ts.map +1 -1
- package/dist/src/platform/index.js +1 -1
- package/dist/src/platform/index.js.map +1 -1
- package/dist/src/platform/slice/impl.d.ts +62 -51
- package/dist/src/platform/slice/impl.d.ts.map +1 -1
- package/dist/src/platform/slice/impl.js +155 -72
- package/dist/src/platform/slice/impl.js.map +1 -1
- package/dist/src/platform/slice/index.d.ts +3744 -2226
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +43 -1
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/runtime/collections/deck.d.ts +4 -0
- package/dist/src/runtime/collections/deck.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.d.ts +10 -9
- package/dist/src/runtime/collections/matrix.d.ts.map +1 -1
- package/dist/src/runtime/collections/matrix.js +11 -6
- package/dist/src/runtime/collections/matrix.js.map +1 -1
- package/dist/src/runtime/collections/plan.d.ts +148 -65
- package/dist/src/runtime/collections/plan.d.ts.map +1 -1
- package/dist/src/runtime/collections/plan.js +155 -67
- package/dist/src/runtime/collections/plan.js.map +1 -1
- package/dist/src/runtime/collections/sheet.d.ts +56 -23
- package/dist/src/runtime/collections/sheet.d.ts.map +1 -1
- package/dist/src/runtime/collections/sheet.js +30 -22
- package/dist/src/runtime/collections/sheet.js.map +1 -1
- package/dist/src/runtime/collections/table.d.ts +18 -11
- package/dist/src/runtime/collections/table.d.ts.map +1 -1
- package/dist/src/runtime/collections/table.js +7 -4
- package/dist/src/runtime/collections/table.js.map +1 -1
- package/dist/src/shared/reify.d.ts +4 -46
- package/dist/src/shared/reify.d.ts.map +1 -1
- package/dist/src/shared/reify.js +4 -61
- package/dist/src/shared/reify.js.map +1 -1
- package/dist/src/shared/tree.d.ts +88 -0
- package/dist/src/shared/tree.d.ts.map +1 -0
- package/dist/src/shared/tree.js +134 -0
- package/dist/src/shared/tree.js.map +1 -0
- package/dist/src/slice/breakdown/index.d.ts +4 -0
- package/dist/src/slice/breakdown/index.d.ts.map +1 -1
- package/dist/src/slice/breakdown/types.d.ts +4 -0
- package/dist/src/slice/breakdown/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.d.ts +24 -4
- package/dist/src/slice/cohort/index.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.js +8 -4
- package/dist/src/slice/cohort/index.js.map +1 -1
- package/dist/src/slice/cohort/types.d.ts +11 -0
- package/dist/src/slice/cohort/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/types.js +7 -0
- package/dist/src/slice/cohort/types.js.map +1 -1
- package/dist/src/slice/filter/index.d.ts +4 -0
- package/dist/src/slice/filter/index.d.ts.map +1 -1
- package/dist/src/slice/filter/types.d.ts +4 -0
- package/dist/src/slice/filter/types.d.ts.map +1 -1
- package/dist/src/slice/index.d.ts +736 -0
- package/dist/src/slice/index.d.ts.map +1 -1
- package/dist/src/slice/legend/index.d.ts +4 -0
- package/dist/src/slice/legend/index.d.ts.map +1 -1
- package/dist/src/slice/legend/types.d.ts +4 -0
- package/dist/src/slice/legend/types.d.ts.map +1 -1
- package/dist/src/slice/rail/index.d.ts +8 -4
- package/dist/src/slice/rail/index.d.ts.map +1 -1
- package/dist/src/slice/rail/index.js.map +1 -1
- package/dist/src/slice/range/index.d.ts +4 -0
- package/dist/src/slice/range/index.d.ts.map +1 -1
- package/dist/src/slice/range/types.d.ts +4 -0
- package/dist/src/slice/range/types.d.ts.map +1 -1
- package/dist/src/slice/search/index.d.ts +4 -0
- package/dist/src/slice/search/index.d.ts.map +1 -1
- package/dist/src/slice/search/types.d.ts +4 -0
- package/dist/src/slice/search/types.d.ts.map +1 -1
- package/dist/src/slice/summary/index.d.ts +4 -0
- package/dist/src/slice/summary/index.d.ts.map +1 -1
- package/dist/src/slice/summary/types.d.ts +4 -0
- package/dist/src/slice/summary/types.d.ts.map +1 -1
- package/dist/src/typography/code/index.js +1 -1
- package/dist/src/typography/code/index.js.map +1 -1
- package/dist/src/typography/code-block/index.js +7 -7
- package/dist/src/typography/code-block/index.js.map +1 -1
- package/dist/src/typography/heading/index.js +2 -2
- package/dist/src/typography/heading/index.js.map +1 -1
- package/dist/src/typography/list/index.js +1 -1
- package/dist/src/typography/list/index.js.map +1 -1
- package/dist/src/typography/mark/index.js +1 -1
- package/dist/src/typography/mark/index.js.map +1 -1
- package/dist/src/typography/note/index.js +1 -1
- package/dist/src/typography/note/index.js.map +1 -1
- package/dist/src/typography/numeric/index.d.ts +3 -308
- package/dist/src/typography/numeric/index.d.ts.map +1 -1
- package/dist/src/typography/numeric/index.js +4 -4
- package/dist/src/typography/numeric/index.js.map +1 -1
- package/dist/src/typography/numeric/types.d.ts +1 -154
- package/dist/src/typography/numeric/types.d.ts.map +1 -1
- package/dist/src/typography/text/index.js +1 -1
- package/dist/src/typography/text/index.js.map +1 -1
- package/dist/test/collections/matrix.examples.d.ts +7 -3
- package/dist/test/collections/matrix.examples.d.ts.map +1 -1
- package/dist/test/collections/matrix.examples.js +55 -24
- package/dist/test/collections/matrix.examples.js.map +1 -1
- package/dist/test/collections/paged-source.examples.d.ts +4 -0
- package/dist/test/collections/paged-source.examples.d.ts.map +1 -1
- package/dist/test/collections/paged-source.examples.js +98 -13
- package/dist/test/collections/paged-source.examples.js.map +1 -1
- package/dist/test/collections/plan.examples.d.ts +101 -26
- package/dist/test/collections/plan.examples.d.ts.map +1 -1
- package/dist/test/collections/plan.examples.js +1481 -755
- package/dist/test/collections/plan.examples.js.map +1 -1
- package/dist/test/collections/sheet-link.examples.d.ts +7 -0
- package/dist/test/collections/sheet-link.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-link.examples.js +41 -0
- package/dist/test/collections/sheet-link.examples.js.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts +7 -0
- package/dist/test/collections/sheet-transactions.examples.d.ts.map +1 -0
- package/dist/test/collections/sheet-transactions.examples.js +58 -0
- package/dist/test/collections/sheet-transactions.examples.js.map +1 -0
- package/dist/test/collections/sheet.examples.d.ts +52 -5
- package/dist/test/collections/sheet.examples.d.ts.map +1 -1
- package/dist/test/collections/sheet.examples.js +500 -158
- package/dist/test/collections/sheet.examples.js.map +1 -1
- package/dist/test/collections/table.examples.d.ts +31 -3
- package/dist/test/collections/table.examples.d.ts.map +1 -1
- package/dist/test/collections/table.examples.js +188 -28
- package/dist/test/collections/table.examples.js.map +1 -1
- package/dist/test/contracts/editing.examples.d.ts +7 -0
- package/dist/test/contracts/editing.examples.d.ts.map +1 -0
- package/dist/test/contracts/editing.examples.js +58 -0
- package/dist/test/contracts/editing.examples.js.map +1 -0
- package/dist/test/layout/splitter.examples.d.ts.map +1 -1
- package/dist/test/layout/splitter.examples.js +3 -1
- package/dist/test/layout/splitter.examples.js.map +1 -1
- package/dist/test/platform/slice.examples.d.ts.map +1 -1
- package/dist/test/platform/slice.examples.js +1 -0
- package/dist/test/platform/slice.examples.js.map +1 -1
- package/dist/test/slice/slice.examples.d.ts.map +1 -1
- package/dist/test/slice/slice.examples.js +5 -2
- package/dist/test/slice/slice.examples.js.map +1 -1
- package/package.json +4 -3
- package/dist/src/collections/plan/data-forms.d.ts +0 -332
- package/dist/src/collections/plan/data-forms.d.ts.map +0 -1
- package/dist/src/collections/plan/data-forms.js +0 -212
- package/dist/src/collections/plan/data-forms.js.map +0 -1
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* positional surface, a `Dict<String, Row>` for a keyed one (#568). east-ui
|
|
12
12
|
* declares the shape; whoever can actually fetch windows produces a value of
|
|
13
13
|
* it. `Data.bindPaged` in `@elaraai/e3-ui` is the production implementation
|
|
14
|
-
* (dataset windows over an e3 workspace) and {@link Paged.of}
|
|
15
|
-
*
|
|
14
|
+
* (dataset windows over an e3 workspace) and {@link Paged.of} /
|
|
15
|
+
* {@link Paged.pinned} are the in-memory ones; e3 is never named here, and
|
|
16
|
+
* **nothing in this file imports e3**.
|
|
16
17
|
*
|
|
17
18
|
* # Why a variant, not a narrow struct
|
|
18
19
|
*
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
*
|
|
29
30
|
* @packageDocumentation
|
|
30
31
|
*/
|
|
31
|
-
import { type EastType, type ExprType, type SubtypeExprOrValue, ArrayType, BooleanType, DictType, FunctionType, IntegerType, OptionType, StringType, StructType, VariantType } from "@elaraai/east";
|
|
32
|
+
import { type EastType, type ExprType, type SubtypeExprOrValue, ArrayType, BooleanType, DictType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType } from "@elaraai/east";
|
|
32
33
|
/**
|
|
33
34
|
* Where a key query landed in a source's canonical row order.
|
|
34
35
|
*
|
|
@@ -127,10 +128,10 @@ export type SeekQueryType = typeof SeekQueryType;
|
|
|
127
128
|
*
|
|
128
129
|
* Parameterised on the COLLECTION, not on the row: a window of an `Array<R>`
|
|
129
130
|
* dataset is an `Array<R>`, a window of a `Dict<K, V>` dataset is a
|
|
130
|
-
* `Dict<K, V>`, and the Plan's canvas windows are
|
|
131
|
-
* (#
|
|
132
|
-
* `Option<T>` at the dataset's own type — so the
|
|
133
|
-
* instead of narrowing it to arrays.
|
|
131
|
+
* `Dict<K, V>`, and the Plan's canvas windows are its blocks — one
|
|
132
|
+
* `Array<PlanRow>` stream per series (#823). That is what `Data.bindPaged`
|
|
133
|
+
* already produces — it returns `Option<T>` at the dataset's own type — so the
|
|
134
|
+
* contract matches the producer instead of narrowing it to arrays.
|
|
134
135
|
*
|
|
135
136
|
* `page` and `total` follow the in-flight-is-`none` convention: a window still
|
|
136
137
|
* being fetched reads `none` and the call re-fires when it lands, so the reads
|
|
@@ -138,6 +139,28 @@ export type SeekQueryType = typeof SeekQueryType;
|
|
|
138
139
|
* source is exhausted at that offset — a reader that walks offsets terminates
|
|
139
140
|
* on an empty window, never on `none`.
|
|
140
141
|
*
|
|
142
|
+
* A window may also hold FEWER than `limit` elements while the source still
|
|
143
|
+
* has more: a source that bounds its pages serves what fits. e3 trims every
|
|
144
|
+
* page of a dataset to a byte budget — the same number of elements on every
|
|
145
|
+
* page of one dataset — so wide elements come back in short windows (#829).
|
|
146
|
+
* Only an EMPTY window means exhausted. Components never see a short window:
|
|
147
|
+
* {@link buildRowSource}'s derived `page` re-requests whatever a trimmed page
|
|
148
|
+
* left out, so every window it serves is whole.
|
|
149
|
+
*
|
|
150
|
+
* A window that CANNOT be read — a failed fetch, a page that does not decode —
|
|
151
|
+
* makes `page` THROW its reason; it never reads `none`, which means in flight,
|
|
152
|
+
* and a reader waiting on it would wait forever (#811). A component shows the
|
|
153
|
+
* failure where that window's rows would be and asks again when the user
|
|
154
|
+
* retries. A source may rate-limit repeat attempts (e3 relaunches a failed
|
|
155
|
+
* window on a read at least two seconds later), and an authoring error — a
|
|
156
|
+
* dataset that cannot be paged — keeps throwing. `seek` follows the same rule.
|
|
157
|
+
*
|
|
158
|
+
* A paged source names no snapshot, so a component reads each of its windows
|
|
159
|
+
* once: the same `id` serves the same rows for as long as the component holds
|
|
160
|
+
* it. A source whose content moves under one id — a dataset the view follows,
|
|
161
|
+
* a source the view writes — is a {@link PinnedSourceType}, which names the
|
|
162
|
+
* snapshot its windows, total and searches belong to.
|
|
163
|
+
*
|
|
141
164
|
* @typeParam C - The collection type one window carries.
|
|
142
165
|
* @param c - The collection type value.
|
|
143
166
|
* @returns The concrete `StructType` of a paged source over `c`.
|
|
@@ -148,11 +171,13 @@ export type SeekQueryType = typeof SeekQueryType;
|
|
|
148
171
|
* never re-renders when the source is swapped, and a window cache cannot key
|
|
149
172
|
* itself. Two sources with the same `id` must serve the same rows.
|
|
150
173
|
* @property page - `(offset, limit)` → that window's elements as a value of the
|
|
151
|
-
* collection type; `none` while in flight, an EMPTY collection at exhaustion
|
|
174
|
+
* collection type; `none` while in flight, an EMPTY collection at exhaustion,
|
|
175
|
+
* and possibly fewer than `limit` elements before it (see above). Throws when
|
|
176
|
+
* the window cannot be read.
|
|
152
177
|
* @property total - The source's total element count, once known; `none` until then.
|
|
153
178
|
* @property seek - The source's key-search capability ({@link SeekType}) —
|
|
154
179
|
* `none` when the source is not key-ordered (an Array-backed source cannot
|
|
155
|
-
* seek; there is nothing to binary-search).
|
|
180
|
+
* seek; there is nothing to binary-search). A search that fails throws.
|
|
156
181
|
*/
|
|
157
182
|
export declare const PagedSourceType: <C extends EastType>(c: C) => StructType<{
|
|
158
183
|
readonly id: StringType;
|
|
@@ -188,14 +213,83 @@ export declare const PagedSourceType: <C extends EastType>(c: C) => StructType<{
|
|
|
188
213
|
* @typeParam C - The collection type one window carries.
|
|
189
214
|
*/
|
|
190
215
|
export type PagedSource<C extends EastType> = ExprType<ReturnType<typeof PagedSourceType<C>>>;
|
|
216
|
+
/**
|
|
217
|
+
* A {@link PagedSourceType} that names its SNAPSHOT — the contract a component
|
|
218
|
+
* follows through changes to the source's content, and the one it edits.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* Every window, the total and every search belong to one snapshot, the
|
|
222
|
+
* source's `revision`, so rows from two snapshots never sit side by side. When
|
|
223
|
+
* the revision moves — the data was written, `refresh` was asked for — a
|
|
224
|
+
* component reads its windows again at the new one, and the rows it had stand
|
|
225
|
+
* in until each lands: the view never empties between two snapshots of its
|
|
226
|
+
* data (#821). An edit is checked against the snapshot it was drafted on, and
|
|
227
|
+
* the drafts retire once the source reads back at the snapshot the write made
|
|
228
|
+
* (#880) — which is why the Sheet and the Plan edit a paged source only
|
|
229
|
+
* through this contract.
|
|
230
|
+
*
|
|
231
|
+
* `Data.bindPaged` in `@elaraai/e3-ui` returns one, its revision the dataset's
|
|
232
|
+
* content hash, and {@link Paged.pinned} is the in-memory one.
|
|
233
|
+
*
|
|
234
|
+
* @typeParam C - The collection type one window carries.
|
|
235
|
+
* @param c - The collection type value.
|
|
236
|
+
* @returns The concrete `StructType` of a pinned source over `c`.
|
|
237
|
+
*
|
|
238
|
+
* @property id - The logical source's identity, as {@link PagedSourceType}'s;
|
|
239
|
+
* the rows it serves are its current revision's.
|
|
240
|
+
* @property page - As {@link PagedSourceType}'s, at the current revision.
|
|
241
|
+
* @property total - As {@link PagedSourceType}'s, at the current revision.
|
|
242
|
+
* @property seek - As {@link PagedSourceType}'s, at the current revision.
|
|
243
|
+
* @property revision - The snapshot the source serves; `none` while it is
|
|
244
|
+
* being found. A reader re-fires when the source moves to another.
|
|
245
|
+
* @property refresh - Move the source: `some(hash)` to that snapshot — after a
|
|
246
|
+
* write the view confirmed — or `none` to the one the source holds now.
|
|
247
|
+
*/
|
|
248
|
+
export declare const PinnedSourceType: <C extends EastType>(c: C) => StructType<{
|
|
249
|
+
readonly id: StringType;
|
|
250
|
+
readonly page: FunctionType<[IntegerType, IntegerType], OptionType<C>>;
|
|
251
|
+
readonly total: FunctionType<[], OptionType<IntegerType>>;
|
|
252
|
+
readonly seek: OptionType<FunctionType<[VariantType<{
|
|
253
|
+
readonly key: StringType;
|
|
254
|
+
readonly prefix: StringType;
|
|
255
|
+
readonly fields: StructType<{
|
|
256
|
+
readonly values: ArrayType<StringType>;
|
|
257
|
+
readonly prefix: OptionType<StringType>;
|
|
258
|
+
}>;
|
|
259
|
+
readonly range: StructType<{
|
|
260
|
+
readonly from: ArrayType<StringType>;
|
|
261
|
+
readonly to: ArrayType<StringType>;
|
|
262
|
+
}>;
|
|
263
|
+
}>], OptionType<StructType<{
|
|
264
|
+
readonly found: BooleanType;
|
|
265
|
+
readonly row: IntegerType;
|
|
266
|
+
readonly count: IntegerType;
|
|
267
|
+
}>>>>;
|
|
268
|
+
readonly revision: FunctionType<[], OptionType<StringType>>;
|
|
269
|
+
readonly refresh: FunctionType<[OptionType<StringType>], NullType>;
|
|
270
|
+
}>;
|
|
271
|
+
/**
|
|
272
|
+
* The TypeScript type of a {@link PinnedSourceType} over collection type `C` —
|
|
273
|
+
* the pinned sibling of {@link PagedSource}.
|
|
274
|
+
*
|
|
275
|
+
* @typeParam C - The collection type one window carries.
|
|
276
|
+
*/
|
|
277
|
+
export type PinnedSource<C extends EastType> = ExprType<ReturnType<typeof PinnedSourceType<C>>>;
|
|
191
278
|
/**
|
|
192
279
|
* How a component's rows arrive: inline, or from a windowed source.
|
|
193
280
|
*
|
|
194
281
|
* @remarks
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* `Dict<String,
|
|
198
|
-
*
|
|
282
|
+
* Every arm speaks the same COLLECTION type — inline is the whole of it, the
|
|
283
|
+
* windowed arms a window of it — so a keyed source (a Sheet's
|
|
284
|
+
* `Dict<String, Row>`), a positional one (a Table's `Array<Row>`) and a
|
|
285
|
+
* composite one (the Plan's blocks, one row stream per series) share one
|
|
286
|
+
* vocabulary without any shape leaking into the arm names (#568).
|
|
287
|
+
*
|
|
288
|
+
* The two windowed arms differ in one thing: whether the source names its
|
|
289
|
+
* snapshot. `paged` is the released arm — exported UIs carry it, so it never
|
|
290
|
+
* changes — and a component reads each of its windows once; `pinned` names the
|
|
291
|
+
* revision its windows belong to, which is what lets a component follow the
|
|
292
|
+
* source as its content changes, and edit it.
|
|
199
293
|
*
|
|
200
294
|
* @typeParam C - The collection type.
|
|
201
295
|
* @param c - The collection type value.
|
|
@@ -203,31 +297,29 @@ export type PagedSource<C extends EastType> = ExprType<ReturnType<typeof PagedSo
|
|
|
203
297
|
*
|
|
204
298
|
* @property inline - The whole collection, already in hand.
|
|
205
299
|
* @property paged - A {@link PagedSourceType} fetched a window at a time.
|
|
300
|
+
* @property pinned - A {@link PinnedSourceType} — windows at a named snapshot, followed from one to the next.
|
|
206
301
|
*/
|
|
207
|
-
export declare const RowSourceType: <C extends EastType>(c: C) =>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}>>>>;
|
|
229
|
-
}>;
|
|
230
|
-
}>;
|
|
302
|
+
export declare const RowSourceType: <C extends EastType>(c: C) => RowSourceType<C>;
|
|
303
|
+
/**
|
|
304
|
+
* The East type {@link RowSourceType} builds over collection type `C`, as a
|
|
305
|
+
* named interface.
|
|
306
|
+
*
|
|
307
|
+
* @remarks
|
|
308
|
+
* An interface is a symbol, so the declaration emitter names it wherever a
|
|
309
|
+
* component's type carries a row source, instead of writing the collection
|
|
310
|
+
* type out once per arm — which keeps `UIComponentType`'s declaration within
|
|
311
|
+
* the length TypeScript will serialize (TS7056; see `UIComponentNode`).
|
|
312
|
+
*
|
|
313
|
+
* @typeParam C - The collection type.
|
|
314
|
+
*/
|
|
315
|
+
export interface RowSourceType<C extends EastType> extends VariantType {
|
|
316
|
+
/** The arms, by name — {@link RowSourceType}'s three. */
|
|
317
|
+
readonly cases: {
|
|
318
|
+
readonly inline: C;
|
|
319
|
+
readonly paged: ReturnType<typeof PagedSourceType<C>>;
|
|
320
|
+
readonly pinned: ReturnType<typeof PinnedSourceType<C>>;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
231
323
|
/**
|
|
232
324
|
* The TypeScript type of a {@link RowSourceType} over collection type `C`.
|
|
233
325
|
*
|
|
@@ -258,9 +350,14 @@ export type RowSourceInput<C extends EastType> = SubtypeExprOrValue<C> | PagedSo
|
|
|
258
350
|
* element type recovered from it (an `Array`'s value, a `Set`'s key, a
|
|
259
351
|
* `Dict`'s value), and its KEY type when it has one.
|
|
260
352
|
*
|
|
261
|
-
* `keyType` is what a keyed component checks: the Plan requires
|
|
262
|
-
*
|
|
353
|
+
* `keyType` is what a keyed component checks: the Plan requires a `Dict`
|
|
354
|
+
* (any key type, #822) because a row's id starts with its entry's key, so an
|
|
263
355
|
* unkeyed source is refused rather than silently re-keyed (#568).
|
|
356
|
+
*
|
|
357
|
+
* `pinned` says whether a windowed source names its snapshot — `revision` and
|
|
358
|
+
* `refresh`, as {@link PinnedSourceType} has them — and so builds the `pinned`
|
|
359
|
+
* arm: the one a component follows through changes to the source, and the
|
|
360
|
+
* only one the Sheet and the Plan edit.
|
|
264
361
|
*/
|
|
265
362
|
export type ResolvedRowSource = {
|
|
266
363
|
kind: "inline";
|
|
@@ -268,12 +365,14 @@ export type ResolvedRowSource = {
|
|
|
268
365
|
collectionType: EastType;
|
|
269
366
|
elementType: EastType;
|
|
270
367
|
keyType: EastType | undefined;
|
|
368
|
+
live?: ExprType<StructType>;
|
|
271
369
|
} | {
|
|
272
370
|
kind: "paged";
|
|
273
371
|
source: ExprType<StructType>;
|
|
274
372
|
collectionType: EastType;
|
|
275
373
|
elementType: EastType;
|
|
276
374
|
keyType: EastType | undefined;
|
|
375
|
+
pinned: boolean;
|
|
277
376
|
} | {
|
|
278
377
|
kind: "ordered";
|
|
279
378
|
source: ExprType<StructType>;
|
|
@@ -283,7 +382,13 @@ export type ResolvedRowSource = {
|
|
|
283
382
|
keyType: EastType;
|
|
284
383
|
/** The order key the window is sorted by, off the element's `ik`. */
|
|
285
384
|
orderKeyType: EastType;
|
|
385
|
+
/** Whether the source names its snapshot — `revision` and `refresh`. */
|
|
386
|
+
pinned: boolean;
|
|
286
387
|
};
|
|
388
|
+
/** A resolved WINDOWED source — `paged`, or an `ordered` index window. */
|
|
389
|
+
export type ResolvedWindowedSource = Extract<ResolvedRowSource, {
|
|
390
|
+
kind: "paged" | "ordered";
|
|
391
|
+
}>;
|
|
287
392
|
/**
|
|
288
393
|
* Classify a component's rows prop at BUILD time — the one dispatch every
|
|
289
394
|
* collection shares, so no component re-sniffs shapes of its own.
|
|
@@ -291,7 +396,9 @@ export type ResolvedRowSource = {
|
|
|
291
396
|
* Accepted shapes, in order:
|
|
292
397
|
* - a collection expression / value (`Array<R>`, `Dict<K, V>`, `Set<R>`) ⇒ `inline`;
|
|
293
398
|
* - a struct carrying `page` + `total` ⇒ `paged` (a {@link PagedSourceType},
|
|
294
|
-
* or anything structurally matching it
|
|
399
|
+
* or anything structurally matching it), marked `pinned` when it also
|
|
400
|
+
* carries `revision` + `refresh` (a {@link PinnedSourceType} —
|
|
401
|
+
* `Data.bindPaged`'s handle, `Paged.pinned`);
|
|
295
402
|
* - a struct carrying `read` ⇒ a whole-value bind handle, which resolves by
|
|
296
403
|
* CALLING `read()` and recursing. The call becomes part of the surrounding
|
|
297
404
|
* East expression, so it is evaluated inside the component's reactive render
|
|
@@ -300,7 +407,7 @@ export type ResolvedRowSource = {
|
|
|
300
407
|
*
|
|
301
408
|
* @param data - The rows prop as the author passed it
|
|
302
409
|
* @param label - Component name for the error message (`"Plan"`, `"Table"`)
|
|
303
|
-
* @returns The resolved arm — see {@link ResolvedRowSource}
|
|
410
|
+
* @returns The resolved arm, retaining a live handle for invocation-time reads — see {@link ResolvedRowSource}
|
|
304
411
|
* @throws Error when the expression is none of the accepted shapes
|
|
305
412
|
*/
|
|
306
413
|
export declare function resolveRowSource(data: unknown, label: string): ResolvedRowSource;
|
|
@@ -320,26 +427,55 @@ export declare function resolveRowSource(data: unknown, label: string): Resolved
|
|
|
320
427
|
* component's rows inherit the source's keys, and flattening at the boundary
|
|
321
428
|
* would throw away exactly what makes a window's rows addressable (#568). A
|
|
322
429
|
* positional component (Table) receives its `Array<Row>`; a keyed one (Plan) a
|
|
323
|
-
* `Dict<
|
|
430
|
+
* `Dict<K, R>`.
|
|
324
431
|
*
|
|
325
432
|
* @typeParam Out - The component's own row COLLECTION type.
|
|
326
433
|
* @param resolved - The output of {@link resolveRowSource}
|
|
327
434
|
* @param outType - The component's row collection type
|
|
328
435
|
* @param make - The source collection → the component's row collection
|
|
329
|
-
* @param idSuffix - Appended to the paged source's `id` — see below
|
|
330
436
|
* @returns The `RowSourceType(outType)` value to store in the IR
|
|
331
437
|
*
|
|
332
438
|
* @remarks
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
439
|
+
* The derived source keeps the handle's `id`: `make` is part of what it
|
|
440
|
+
* serves, and a component whose `make` changes (a Plan whose series list a
|
|
441
|
+
* pick narrowed) serves other rows from the same handle — which a renderer
|
|
442
|
+
* tells apart by comparing the derived source whole, closures included
|
|
443
|
+
* (`equivalentFor`, #809), not by its id (#822).
|
|
444
|
+
*
|
|
445
|
+
* The derived `page` serves WHOLE windows (#829). A handle may answer
|
|
446
|
+
* `(offset, limit)` with fewer than `limit` elements while it still has more —
|
|
447
|
+
* e3 trims every page to a byte budget — and every component addresses its
|
|
448
|
+
* windows at `w × size`, so a short window would silently drop its tail. The
|
|
449
|
+
* derived `page` therefore re-requests `(offset + served, limit − served)`
|
|
450
|
+
* until the window holds `limit` elements, the source is exhausted (an empty
|
|
451
|
+
* piece, or `offset + served` reaching a known `total()`), or a piece is still
|
|
452
|
+
* in flight — in which case the whole window reads `none` and re-fires when the
|
|
453
|
+
* piece lands. The pieces join in the collection's own order (arrays
|
|
454
|
+
* concatenate; dicts and sets union, their pieces being disjoint and ascending)
|
|
455
|
+
* and `make` runs once over the whole window. Each piece stays its own request,
|
|
456
|
+
* so a runtime caches them at the size the source chose to serve.
|
|
457
|
+
*
|
|
458
|
+
* A source that names its snapshot (`resolved.pinned`, a
|
|
459
|
+
* {@link PinnedSourceType}) builds the `pinned` arm, its `revision` and
|
|
460
|
+
* `refresh` carried through as they are; any other builds `paged`, which has
|
|
461
|
+
* neither. The derived `page` is the same either way.
|
|
340
462
|
*/
|
|
341
|
-
export declare function buildRowSource<Out extends EastType>(resolved: ResolvedRowSource, outType: Out, make: (collection: ExprType<EastType>) => SubtypeExprOrValue<Out
|
|
342
|
-
/**
|
|
463
|
+
export declare function buildRowSource<Out extends EastType>(resolved: ResolvedRowSource, outType: Out, make: (collection: ExprType<EastType>) => SubtypeExprOrValue<Out>): RowSource<Out>;
|
|
464
|
+
/**
|
|
465
|
+
* The WHOLE window `(offset, limit)` of a paged source's own collection — the
|
|
466
|
+
* pieces a trimmed page left out asked for until the window holds `limit`
|
|
467
|
+
* elements, the source is exhausted, or a piece is in flight (the window then
|
|
468
|
+
* reads `none`, #829). What {@link buildRowSource}'s derived `page` maps its
|
|
469
|
+
* `make` over; a caller that must read the very windows a component reads —
|
|
470
|
+
* the Plan's editing reads its entries back (#880) — asks for them here, so
|
|
471
|
+
* each piece is the same request the component made.
|
|
472
|
+
*
|
|
473
|
+
* @param resolved - A resolved paged source ({@link resolveRowSource})
|
|
474
|
+
* @returns `(offset, limit)` → the window, `none` while a piece is in flight
|
|
475
|
+
*/
|
|
476
|
+
export declare function buildPagedWindow(resolved: ResolvedWindowedSource): ExprType<FunctionType<[IntegerType, IntegerType], OptionType<EastType>>>;
|
|
477
|
+
/** Options for {@link Paged.of} — `key` applies to the ARRAY form only,
|
|
478
|
+
* `pageLimit` to both. */
|
|
343
479
|
export interface PagedOfOptions<R extends EastType> {
|
|
344
480
|
/**
|
|
345
481
|
* Key accessor. Supplying it declares the rows are SORTED by that key and
|
|
@@ -351,6 +487,17 @@ export interface PagedOfOptions<R extends EastType> {
|
|
|
351
487
|
* are the row order and the search space.
|
|
352
488
|
*/
|
|
353
489
|
key?: (row: ExprType<R>) => SubtypeExprOrValue<StringType>;
|
|
490
|
+
/**
|
|
491
|
+
* Serve at most this many elements per window, whatever `limit` asks — the
|
|
492
|
+
* in-memory twin of a source that bounds its pages (e3 trims every page to
|
|
493
|
+
* a byte budget, so wide elements come back in short windows, #829).
|
|
494
|
+
*
|
|
495
|
+
* A component never sees the trim: `buildRowSource` re-requests what a
|
|
496
|
+
* short window left out, so every window it serves is whole. Set it to
|
|
497
|
+
* exercise that path in examples and tests. Must be a positive integer;
|
|
498
|
+
* omit it and a window is exactly what `limit` asks (clamped at the end).
|
|
499
|
+
*/
|
|
500
|
+
pageLimit?: number;
|
|
354
501
|
}
|
|
355
502
|
/**
|
|
356
503
|
* Build an in-memory {@link PagedSourceType} over a collection already in hand
|
|
@@ -362,17 +509,26 @@ export interface PagedOfOptions<R extends EastType> {
|
|
|
362
509
|
* whole paged path — windowing, exhaustion on `some([])`, totals, seek — with
|
|
363
510
|
* no server, no platform function and no bind. `@elaraai/e3-ui`'s
|
|
364
511
|
* `Data.bindPaged` is the same contract backed by real dataset windows.
|
|
512
|
+
* `pageLimit` adds the one thing a real server does that an in-memory source
|
|
513
|
+
* would not: short windows, as e3 serves wide elements under its byte budget.
|
|
365
514
|
*
|
|
366
515
|
* Windows follow the collection: an `Array` source serves array windows in
|
|
367
516
|
* stream order, a `Dict` source serves DICT windows in canonical key order —
|
|
368
517
|
* the same shape and the same order a keyed dataset's windows arrive in, which
|
|
369
518
|
* is what a keyed component (the Plan) requires of its source (#568).
|
|
370
519
|
*
|
|
520
|
+
* The source captures an immutable copy of the collection when it is created,
|
|
521
|
+
* so no window drifts with the input: changed content is a new source, under a
|
|
522
|
+
* new id. A view that edits its source, or follows it from one snapshot to the
|
|
523
|
+
* next, takes {@link Paged.pinned}.
|
|
524
|
+
*
|
|
371
525
|
* @typeParam R - The row type (array form) / the value type (dict form).
|
|
372
526
|
* @param id - Comparable identity for this source (see {@link PagedSourceType}).
|
|
373
527
|
* @param collection - The whole collection — an `Array<R>` or a `Dict<String, R>`.
|
|
374
|
-
* @param options - {@link PagedOfOptions} — array form only
|
|
528
|
+
* @param options - {@link PagedOfOptions} — `key` (array form only) enables `seek`;
|
|
529
|
+
* `pageLimit` trims every window, as a server bounding its pages does.
|
|
375
530
|
* @returns A `PagedSourceType` at the collection it was given.
|
|
531
|
+
* @throws {Error} When `pageLimit` is not a positive integer.
|
|
376
532
|
*
|
|
377
533
|
* @example
|
|
378
534
|
* ```tsx
|
|
@@ -387,9 +543,40 @@ export interface PagedOfOptions<R extends EastType> {
|
|
|
387
543
|
* ```
|
|
388
544
|
*/
|
|
389
545
|
declare function createPagedOf<R extends EastType>(id: SubtypeExprOrValue<StringType>, rows: SubtypeExprOrValue<ArrayType<R>>, options?: PagedOfOptions<R>): PagedSource<ArrayType<R>>;
|
|
390
|
-
declare function createPagedOf<V extends EastType>(id: SubtypeExprOrValue<StringType>, entries: SubtypeExprOrValue<DictType<StringType, V
|
|
546
|
+
declare function createPagedOf<V extends EastType>(id: SubtypeExprOrValue<StringType>, entries: SubtypeExprOrValue<DictType<StringType, V>>, options?: Pick<PagedOfOptions<V>, "pageLimit">): PagedSource<DictType<StringType, V>>;
|
|
547
|
+
/**
|
|
548
|
+
* Build an in-memory {@link PinnedSourceType} — {@link Paged.of} naming its
|
|
549
|
+
* snapshot, for a fixture a view edits or follows.
|
|
550
|
+
*
|
|
551
|
+
* @remarks
|
|
552
|
+
* The snapshot is the id, for good: `revision()` reads `some(id)`, a `refresh`
|
|
553
|
+
* to `none` or to the id keeps it, and a refresh to any other snapshot throws —
|
|
554
|
+
* an in-memory source cannot move, so a write it is told about is one it never
|
|
555
|
+
* saw. Everything else is {@link Paged.of}'s: the captured copy, the windows,
|
|
556
|
+
* the total, `seek` and `pageLimit`.
|
|
557
|
+
*
|
|
558
|
+
* @typeParam R - The row type (array form) / the value type (dict form).
|
|
559
|
+
* @param id - The source's identity, and its one snapshot.
|
|
560
|
+
* @param collection - The whole collection — an `Array<R>` or a `Dict<String, R>`.
|
|
561
|
+
* @param options - {@link PagedOfOptions}, as {@link Paged.of} takes them.
|
|
562
|
+
* @returns A `PinnedSourceType` at the collection it was given.
|
|
563
|
+
* @throws {Error} When `pageLimit` is not a positive integer.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* ```tsx
|
|
567
|
+
* const rows = $.const([{ id: "r1", quantity: 2.0 }], ArrayType(OrderRow));
|
|
568
|
+
* const source = $.let(Paged.pinned("orders:fixture-1", rows));
|
|
569
|
+
* // A dataset handle's lifecycle, over one snapshot that never moves.
|
|
570
|
+
* $(source.refresh(none));
|
|
571
|
+
* $(source.refresh(some("orders:fixture-1")));
|
|
572
|
+
* return <Text>{East.str`Snapshot: ${source.revision().unwrap("some")}`}</Text>;
|
|
573
|
+
* ```
|
|
574
|
+
*/
|
|
575
|
+
declare function createPagedPinned<R extends EastType>(id: SubtypeExprOrValue<StringType>, rows: SubtypeExprOrValue<ArrayType<R>>, options?: PagedOfOptions<R>): PinnedSource<ArrayType<R>>;
|
|
576
|
+
declare function createPagedPinned<V extends EastType>(id: SubtypeExprOrValue<StringType>, entries: SubtypeExprOrValue<DictType<StringType, V>>, options?: Pick<PagedOfOptions<V>, "pageLimit">): PinnedSource<DictType<StringType, V>>;
|
|
391
577
|
/**
|
|
392
|
-
* The `Paged` namespace — building a {@link PagedSourceType}
|
|
578
|
+
* The `Paged` namespace — building a {@link PagedSourceType} or a
|
|
579
|
+
* {@link PinnedSourceType} without a server.
|
|
393
580
|
*
|
|
394
581
|
* @remarks
|
|
395
582
|
* The contract itself is what components consume; this namespace is the
|
|
@@ -399,6 +586,8 @@ declare function createPagedOf<V extends EastType>(id: SubtypeExprOrValue<String
|
|
|
399
586
|
export declare const Paged: {
|
|
400
587
|
/** Build an in-memory paged source over a collection already in hand. */
|
|
401
588
|
readonly of: typeof createPagedOf;
|
|
589
|
+
/** Build an in-memory PINNED source — `of`, naming its one snapshot, for a fixture a view edits or follows. */
|
|
590
|
+
readonly pinned: typeof createPagedPinned;
|
|
402
591
|
/** East types — the contract, for `$.const` / `$.let` annotations. */
|
|
403
592
|
readonly Types: {
|
|
404
593
|
/** A windowed row source over a collection type. */
|
|
@@ -423,6 +612,30 @@ export declare const Paged: {
|
|
|
423
612
|
readonly count: IntegerType;
|
|
424
613
|
}>>>>;
|
|
425
614
|
}>;
|
|
615
|
+
/** A windowed row source that names its snapshot, over a collection type. */
|
|
616
|
+
readonly PinnedSource: <C extends EastType>(c: C) => StructType<{
|
|
617
|
+
readonly id: StringType;
|
|
618
|
+
readonly page: FunctionType<[IntegerType, IntegerType], OptionType<C>>;
|
|
619
|
+
readonly total: FunctionType<[], OptionType<IntegerType>>;
|
|
620
|
+
readonly seek: OptionType<FunctionType<[VariantType<{
|
|
621
|
+
readonly key: StringType;
|
|
622
|
+
readonly prefix: StringType;
|
|
623
|
+
readonly fields: StructType<{
|
|
624
|
+
readonly values: ArrayType<StringType>;
|
|
625
|
+
readonly prefix: OptionType<StringType>;
|
|
626
|
+
}>;
|
|
627
|
+
readonly range: StructType<{
|
|
628
|
+
readonly from: ArrayType<StringType>;
|
|
629
|
+
readonly to: ArrayType<StringType>;
|
|
630
|
+
}>;
|
|
631
|
+
}>], OptionType<StructType<{
|
|
632
|
+
readonly found: BooleanType;
|
|
633
|
+
readonly row: IntegerType;
|
|
634
|
+
readonly count: IntegerType;
|
|
635
|
+
}>>>>;
|
|
636
|
+
readonly revision: FunctionType<[], OptionType<StringType>>;
|
|
637
|
+
readonly refresh: FunctionType<[OptionType<StringType>], NullType>;
|
|
638
|
+
}>;
|
|
426
639
|
/** Where a key query landed in a source's row order. */
|
|
427
640
|
readonly SeekRange: StructType<{
|
|
428
641
|
readonly found: BooleanType;
|
|
@@ -442,31 +655,8 @@ export declare const Paged: {
|
|
|
442
655
|
readonly to: ArrayType<StringType>;
|
|
443
656
|
}>;
|
|
444
657
|
}>;
|
|
445
|
-
/** How a component's rows arrive (inline / paged), at a collection type. */
|
|
446
|
-
readonly RowSource: <C extends EastType>(c: C) =>
|
|
447
|
-
readonly inline: C;
|
|
448
|
-
readonly paged: StructType<{
|
|
449
|
-
readonly id: StringType;
|
|
450
|
-
readonly page: FunctionType<[IntegerType, IntegerType], OptionType<C>>;
|
|
451
|
-
readonly total: FunctionType<[], OptionType<IntegerType>>;
|
|
452
|
-
readonly seek: OptionType<FunctionType<[VariantType<{
|
|
453
|
-
readonly key: StringType;
|
|
454
|
-
readonly prefix: StringType;
|
|
455
|
-
readonly fields: StructType<{
|
|
456
|
-
readonly values: ArrayType<StringType>;
|
|
457
|
-
readonly prefix: OptionType<StringType>;
|
|
458
|
-
}>;
|
|
459
|
-
readonly range: StructType<{
|
|
460
|
-
readonly from: ArrayType<StringType>;
|
|
461
|
-
readonly to: ArrayType<StringType>;
|
|
462
|
-
}>;
|
|
463
|
-
}>], OptionType<StructType<{
|
|
464
|
-
readonly found: BooleanType;
|
|
465
|
-
readonly row: IntegerType;
|
|
466
|
-
readonly count: IntegerType;
|
|
467
|
-
}>>>>;
|
|
468
|
-
}>;
|
|
469
|
-
}>;
|
|
658
|
+
/** How a component's rows arrive (inline / paged / pinned), at a collection type. */
|
|
659
|
+
readonly RowSource: <C extends EastType>(c: C) => RowSourceType<C>;
|
|
470
660
|
};
|
|
471
661
|
};
|
|
472
662
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/contracts/source.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/contracts/source.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAGvB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EAEV,UAAU,EACV,UAAU,EACV,WAAW,EAKd,MAAM,eAAe,C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