@elaraai/east-ui 1.0.98 → 1.0.100
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/README.md +0 -1
- package/dist/src/contracts/editing.d.ts +4 -0
- package/dist/src/contracts/editing.d.ts.map +1 -1
- package/dist/src/contracts/editing.js +2 -1
- package/dist/src/contracts/editing.js.map +1 -1
- package/dist/src/contracts/indexed-source.d.ts +47 -10
- package/dist/src/contracts/indexed-source.d.ts.map +1 -1
- package/dist/src/contracts/indexed-source.js +44 -9
- package/dist/src/contracts/indexed-source.js.map +1 -1
- package/dist/src/contracts/source.d.ts +3 -0
- package/dist/src/contracts/source.d.ts.map +1 -1
- package/dist/src/contracts/source.js +59 -0
- package/dist/src/contracts/source.js.map +1 -1
- package/dist/src/internal.d.ts +2 -0
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +2 -0
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/snap-grid/index.d.ts +1 -0
- package/dist/src/layout/snap-grid/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.d.ts +2 -2
- package/dist/src/platform/slice/index.js +2 -2
- package/dist/src/platform/slice/record-area.d.ts +24 -18
- package/dist/src/platform/slice/record-area.d.ts.map +1 -1
- package/dist/src/platform/slice/record-area.js +25 -18
- package/dist/src/platform/slice/record-area.js.map +1 -1
- package/dist/src/platform/slice/record-chrome.d.ts +38 -88
- package/dist/src/platform/slice/record-chrome.d.ts.map +1 -1
- package/dist/src/platform/slice/record-interval.d.ts +31 -1
- package/dist/src/platform/slice/record-interval.d.ts.map +1 -1
- package/dist/src/platform/slice/record-interval.js +39 -3
- package/dist/src/platform/slice/record-interval.js.map +1 -1
- package/dist/src/platform/slice/record-on.d.ts +45 -0
- package/dist/src/platform/slice/record-on.d.ts.map +1 -0
- package/dist/src/platform/slice/record-on.js +71 -0
- package/dist/src/platform/slice/record-on.js.map +1 -0
- package/dist/src/platform/slice/record-plan.d.ts +45 -16
- package/dist/src/platform/slice/record-plan.d.ts.map +1 -1
- package/dist/src/platform/slice/record-plan.js +84 -60
- package/dist/src/platform/slice/record-plan.js.map +1 -1
- package/dist/src/platform/slice/record-series.d.ts +118 -52
- package/dist/src/platform/slice/record-series.d.ts.map +1 -1
- package/dist/src/platform/slice/record-series.js +169 -80
- package/dist/src/platform/slice/record-series.js.map +1 -1
- package/dist/src/platform/slice/record-sources.d.ts +6 -2
- package/dist/src/platform/slice/record-sources.d.ts.map +1 -1
- package/dist/src/platform/slice/record-sources.js.map +1 -1
- package/dist/src/platform/slice/record-types.d.ts +324 -757
- package/dist/src/platform/slice/record-types.d.ts.map +1 -1
- package/dist/src/platform/slice/record-types.js +62 -31
- package/dist/src/platform/slice/record-types.js.map +1 -1
- package/dist/src/platform/slice/record.d.ts +29 -16
- package/dist/src/platform/slice/record.d.ts.map +1 -1
- package/dist/src/platform/slice/record.js +58 -53
- package/dist/src/platform/slice/record.js.map +1 -1
- package/dist/src/runtime/record-slice-source.d.ts +5 -4
- package/dist/src/runtime/record-slice-source.d.ts.map +1 -1
- package/dist/src/runtime/record-slice-source.js.map +1 -1
- package/dist/src/runtime/record-slice.d.ts +30 -6
- package/dist/src/runtime/record-slice.d.ts.map +1 -1
- package/dist/src/runtime/record-slice.js +119 -21
- package/dist/src/runtime/record-slice.js.map +1 -1
- package/dist/src/slice/record/index.d.ts +19 -44
- package/dist/src/slice/record/index.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -109,12 +109,6 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
109
109
|
readonly to: import("@elaraai/east").StringType;
|
|
110
110
|
}>;
|
|
111
111
|
readonly prefix: import("@elaraai/east").StringType;
|
|
112
|
-
readonly window: StructType<{
|
|
113
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
114
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
115
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
116
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
117
|
-
}>;
|
|
118
112
|
}>>;
|
|
119
113
|
}>>;
|
|
120
114
|
}>;
|
|
@@ -126,12 +120,6 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
126
120
|
readonly to: import("@elaraai/east").StringType;
|
|
127
121
|
}>;
|
|
128
122
|
readonly prefix: import("@elaraai/east").StringType;
|
|
129
|
-
readonly window: StructType<{
|
|
130
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
131
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
132
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
133
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
134
|
-
}>;
|
|
135
123
|
}>>;
|
|
136
124
|
readonly preset: OptionType<import("@elaraai/east").StringType>;
|
|
137
125
|
readonly resolution: OptionType<VariantType<{
|
|
@@ -152,12 +140,6 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
152
140
|
readonly to: import("@elaraai/east").StringType;
|
|
153
141
|
}>;
|
|
154
142
|
readonly prefix: import("@elaraai/east").StringType;
|
|
155
|
-
readonly window: StructType<{
|
|
156
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
157
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
158
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
159
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
160
|
-
}>;
|
|
161
143
|
}>>;
|
|
162
144
|
readonly preset: OptionType<import("@elaraai/east").StringType>;
|
|
163
145
|
readonly resolution: OptionType<VariantType<{
|
|
@@ -176,20 +158,25 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
176
158
|
readonly clear: import("@elaraai/east").FunctionType<[import("@elaraai/east").StringType], NullType>;
|
|
177
159
|
readonly clearAll: import("@elaraai/east").FunctionType<[], NullType>;
|
|
178
160
|
readonly count: import("@elaraai/east").FunctionType<[], OptionType<import("@elaraai/east").IntegerType>>;
|
|
179
|
-
readonly countWhere: import("@elaraai/east").FunctionType<[
|
|
180
|
-
readonly
|
|
181
|
-
|
|
182
|
-
readonly
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
readonly
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
161
|
+
readonly countWhere: import("@elaraai/east").FunctionType<[StructType<{
|
|
162
|
+
readonly where: import("@elaraai/east").DictType<import("@elaraai/east").StringType, VariantType<{
|
|
163
|
+
readonly values: ArrayType<import("@elaraai/east").StringType>;
|
|
164
|
+
readonly range: StructType<{
|
|
165
|
+
readonly from: import("@elaraai/east").StringType;
|
|
166
|
+
readonly to: import("@elaraai/east").StringType;
|
|
167
|
+
}>;
|
|
168
|
+
readonly prefix: import("@elaraai/east").StringType;
|
|
169
|
+
}>>;
|
|
170
|
+
readonly area: OptionType<VariantType<{
|
|
171
|
+
readonly window: StructType<{
|
|
172
|
+
readonly minX: import("@elaraai/east").FloatType;
|
|
173
|
+
readonly minY: import("@elaraai/east").FloatType;
|
|
174
|
+
readonly maxX: import("@elaraai/east").FloatType;
|
|
175
|
+
readonly maxY: import("@elaraai/east").FloatType;
|
|
176
|
+
}>;
|
|
177
|
+
readonly unplaced: NullType;
|
|
178
|
+
}>>;
|
|
179
|
+
}>], OptionType<import("@elaraai/east").IntegerType>>;
|
|
193
180
|
readonly total: import("@elaraai/east").FunctionType<[], OptionType<import("@elaraai/east").IntegerType>>;
|
|
194
181
|
readonly domain: import("@elaraai/east").FunctionType<[import("@elaraai/east").StringType], OptionType<StructType<{
|
|
195
182
|
readonly from: import("@elaraai/east").StringType;
|
|
@@ -230,12 +217,6 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
230
217
|
readonly to: import("@elaraai/east").StringType;
|
|
231
218
|
}>;
|
|
232
219
|
readonly prefix: import("@elaraai/east").StringType;
|
|
233
|
-
readonly window: StructType<{
|
|
234
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
235
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
236
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
237
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
238
|
-
}>;
|
|
239
220
|
}>>, import("@elaraai/east").StringType], OptionType<import("@elaraai/east").BooleanType>>;
|
|
240
221
|
readonly containsRow: import("@elaraai/east").FunctionType<[import("@elaraai/east").DictType<import("@elaraai/east").StringType, VariantType<{
|
|
241
222
|
readonly values: ArrayType<import("@elaraai/east").StringType>;
|
|
@@ -244,12 +225,6 @@ export declare const RecordSliceChromeType: StructType<{
|
|
|
244
225
|
readonly to: import("@elaraai/east").StringType;
|
|
245
226
|
}>;
|
|
246
227
|
readonly prefix: import("@elaraai/east").StringType;
|
|
247
|
-
readonly window: StructType<{
|
|
248
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
249
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
250
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
251
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
252
|
-
}>;
|
|
253
228
|
}>>, import("@elaraai/east").StringType, import("@elaraai/east").BlobType], OptionType<import("@elaraai/east").BooleanType>>;
|
|
254
229
|
}>;
|
|
255
230
|
readonly affordances: ArrayType<VariantType<{
|
|
@@ -457,12 +432,6 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
457
432
|
readonly to: import("@elaraai/east").StringType;
|
|
458
433
|
}>;
|
|
459
434
|
readonly prefix: import("@elaraai/east").StringType;
|
|
460
|
-
readonly window: StructType<{
|
|
461
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
462
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
463
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
464
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
465
|
-
}>;
|
|
466
435
|
}>>;
|
|
467
436
|
}>>;
|
|
468
437
|
}>;
|
|
@@ -474,12 +443,6 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
474
443
|
readonly to: import("@elaraai/east").StringType;
|
|
475
444
|
}>;
|
|
476
445
|
readonly prefix: import("@elaraai/east").StringType;
|
|
477
|
-
readonly window: StructType<{
|
|
478
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
479
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
480
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
481
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
482
|
-
}>;
|
|
483
446
|
}>>;
|
|
484
447
|
readonly preset: OptionType<import("@elaraai/east").StringType>;
|
|
485
448
|
readonly resolution: OptionType<VariantType<{
|
|
@@ -500,12 +463,6 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
500
463
|
readonly to: import("@elaraai/east").StringType;
|
|
501
464
|
}>;
|
|
502
465
|
readonly prefix: import("@elaraai/east").StringType;
|
|
503
|
-
readonly window: StructType<{
|
|
504
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
505
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
506
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
507
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
508
|
-
}>;
|
|
509
466
|
}>>;
|
|
510
467
|
readonly preset: OptionType<import("@elaraai/east").StringType>;
|
|
511
468
|
readonly resolution: OptionType<VariantType<{
|
|
@@ -524,20 +481,25 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
524
481
|
readonly clear: import("@elaraai/east").FunctionType<[import("@elaraai/east").StringType], NullType>;
|
|
525
482
|
readonly clearAll: import("@elaraai/east").FunctionType<[], NullType>;
|
|
526
483
|
readonly count: import("@elaraai/east").FunctionType<[], OptionType<import("@elaraai/east").IntegerType>>;
|
|
527
|
-
readonly countWhere: import("@elaraai/east").FunctionType<[
|
|
528
|
-
readonly
|
|
529
|
-
|
|
530
|
-
readonly
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
readonly
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
484
|
+
readonly countWhere: import("@elaraai/east").FunctionType<[StructType<{
|
|
485
|
+
readonly where: import("@elaraai/east").DictType<import("@elaraai/east").StringType, VariantType<{
|
|
486
|
+
readonly values: ArrayType<import("@elaraai/east").StringType>;
|
|
487
|
+
readonly range: StructType<{
|
|
488
|
+
readonly from: import("@elaraai/east").StringType;
|
|
489
|
+
readonly to: import("@elaraai/east").StringType;
|
|
490
|
+
}>;
|
|
491
|
+
readonly prefix: import("@elaraai/east").StringType;
|
|
492
|
+
}>>;
|
|
493
|
+
readonly area: OptionType<VariantType<{
|
|
494
|
+
readonly window: StructType<{
|
|
495
|
+
readonly minX: import("@elaraai/east").FloatType;
|
|
496
|
+
readonly minY: import("@elaraai/east").FloatType;
|
|
497
|
+
readonly maxX: import("@elaraai/east").FloatType;
|
|
498
|
+
readonly maxY: import("@elaraai/east").FloatType;
|
|
499
|
+
}>;
|
|
500
|
+
readonly unplaced: NullType;
|
|
501
|
+
}>>;
|
|
502
|
+
}>], OptionType<import("@elaraai/east").IntegerType>>;
|
|
541
503
|
readonly total: import("@elaraai/east").FunctionType<[], OptionType<import("@elaraai/east").IntegerType>>;
|
|
542
504
|
readonly domain: import("@elaraai/east").FunctionType<[import("@elaraai/east").StringType], OptionType<StructType<{
|
|
543
505
|
readonly from: import("@elaraai/east").StringType;
|
|
@@ -578,12 +540,6 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
578
540
|
readonly to: import("@elaraai/east").StringType;
|
|
579
541
|
}>;
|
|
580
542
|
readonly prefix: import("@elaraai/east").StringType;
|
|
581
|
-
readonly window: StructType<{
|
|
582
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
583
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
584
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
585
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
586
|
-
}>;
|
|
587
543
|
}>>, import("@elaraai/east").StringType], OptionType<import("@elaraai/east").BooleanType>>;
|
|
588
544
|
readonly containsRow: import("@elaraai/east").FunctionType<[import("@elaraai/east").DictType<import("@elaraai/east").StringType, VariantType<{
|
|
589
545
|
readonly values: ArrayType<import("@elaraai/east").StringType>;
|
|
@@ -592,12 +548,6 @@ export declare const RecordSlicesChromeType: StructType<{
|
|
|
592
548
|
readonly to: import("@elaraai/east").StringType;
|
|
593
549
|
}>;
|
|
594
550
|
readonly prefix: import("@elaraai/east").StringType;
|
|
595
|
-
readonly window: StructType<{
|
|
596
|
-
readonly minX: import("@elaraai/east").FloatType;
|
|
597
|
-
readonly minY: import("@elaraai/east").FloatType;
|
|
598
|
-
readonly maxX: import("@elaraai/east").FloatType;
|
|
599
|
-
readonly maxY: import("@elaraai/east").FloatType;
|
|
600
|
-
}>;
|
|
601
551
|
}>>, import("@elaraai/east").StringType, import("@elaraai/east").BlobType], OptionType<import("@elaraai/east").BooleanType>>;
|
|
602
552
|
}>;
|
|
603
553
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-chrome.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-chrome.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qEAAqE;AACrE,OAAO,EAAE,SAAS,EAAc,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAkC,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7K,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,sEAAsE;AACtE,eAAO,MAAM,yBAAyB;;;;;;;;EAGpC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AACzE,8EAA8E;AAC9E,MAAM,MAAM,qBAAqB,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,eAA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,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAapG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC;AAEnE,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACtC,wEAAwE;IACxE,KAAK,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IAChD,uEAAuE;IACvE,WAAW,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC/C,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC7C;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAgBvG"}
|
|
@@ -6,19 +6,49 @@
|
|
|
6
6
|
import { type ValueTypeOf } from "@elaraai/east";
|
|
7
7
|
import type { SeekQueryType } from "../../contracts/source.js";
|
|
8
8
|
import type { RecordSliceChoiceType, RecordSliceIndexType } from "./record-types.js";
|
|
9
|
+
import type { RecordOnPrinter } from "./record-on.js";
|
|
9
10
|
type Interval = Extract<ValueTypeOf<RecordSliceIndexType>["interval"], {
|
|
10
11
|
type: "some";
|
|
11
12
|
}>["value"];
|
|
13
|
+
/** How an interval index reads a row's time, as a binding's index metadata carries it: its start and end fields. */
|
|
14
|
+
export interface IntervalMarker {
|
|
15
|
+
/** The row field an event starts at. */
|
|
16
|
+
readonly from: string;
|
|
17
|
+
/** The row field it ends at. */
|
|
18
|
+
readonly to: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The names of the struct `Data.bindPaged` marks an interval index with in a
|
|
22
|
+
* binding's index metadata — its kind's `interval` case (#1432), as an area
|
|
23
|
+
* index's names its box: its start and end fields, each named with its role
|
|
24
|
+
* (`from=…`, `to=…`). A marker's names are the kind's own, never a row field
|
|
25
|
+
* among the index's.
|
|
26
|
+
*
|
|
27
|
+
* @param marker - The index's start and end fields
|
|
28
|
+
* @returns The marker struct's field names, in order
|
|
29
|
+
*/
|
|
30
|
+
export declare function intervalMarkerFields(marker: IntervalMarker): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Read an interval index's start and end back from its marker's field names
|
|
33
|
+
* ({@link intervalMarkerFields}).
|
|
34
|
+
*
|
|
35
|
+
* @param names - The marker struct's field names
|
|
36
|
+
* @returns The fields, or `undefined` when the names are not an interval marker's
|
|
37
|
+
*/
|
|
38
|
+
export declare function readIntervalMarker(names: readonly string[]): IntervalMarker | undefined;
|
|
12
39
|
/**
|
|
13
40
|
* Each exact prefix has one start range and at most 54 carry-in ranges.
|
|
14
41
|
* Their event identities are disjoint: each interval lives at one ancestor;
|
|
15
42
|
* which side the lower bound lies on selects its start or end ordering.
|
|
16
43
|
* Counts therefore sum original events, without reading or deduplicating rows.
|
|
44
|
+
* The key is `{ on, node, at }` (#1432): a search of its own fields names `on`
|
|
45
|
+
* as one literal, a range bounds it flattened, the leading values one by one.
|
|
17
46
|
* @param prefix - Exact choices of every leading field.
|
|
18
47
|
* @param choice - Half-open overlap range, exact start values, or all starts.
|
|
19
48
|
* @param interval - The generated index's interval metadata.
|
|
49
|
+
* @param printOn - The index's `on` printer.
|
|
20
50
|
* @returns Disjoint ordinary key searches understood by every record backend.
|
|
21
51
|
*/
|
|
22
|
-
export declare function intervalQueries(prefix: readonly string[], choice: ValueTypeOf<RecordSliceChoiceType> | undefined, interval: Interval): ValueTypeOf<SeekQueryType>[];
|
|
52
|
+
export declare function intervalQueries(prefix: readonly string[], choice: ValueTypeOf<RecordSliceChoiceType> | undefined, interval: Interval, printOn: RecordOnPrinter): ValueTypeOf<SeekQueryType>[];
|
|
23
53
|
export {};
|
|
24
54
|
//# sourceMappingURL=record-interval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-interval.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-interval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,OAAO,EAA+F,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"record-interval.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-interval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,OAAO,EAA+F,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,KAAK,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,UAAU,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,OAAO,CAAC,CAAC;AAElG,oHAAoH;AACpH,MAAM,WAAW,cAAc;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,GAAG,SAAS,CAUvF;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,qBAAqB,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ,EACjI,OAAO,EAAE,eAAe,GAAG,WAAW,CAAC,aAAa,CAAC,EAAE,CAmC1D"}
|
|
@@ -4,6 +4,38 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/** Queries for e3's ordinary maintained centred interval index. */
|
|
6
6
|
import { DateTimeType, IntegerType, OptionType, none, parseFor, printFor, some, variant } from "@elaraai/east";
|
|
7
|
+
/**
|
|
8
|
+
* The names of the struct `Data.bindPaged` marks an interval index with in a
|
|
9
|
+
* binding's index metadata — its kind's `interval` case (#1432), as an area
|
|
10
|
+
* index's names its box: its start and end fields, each named with its role
|
|
11
|
+
* (`from=…`, `to=…`). A marker's names are the kind's own, never a row field
|
|
12
|
+
* among the index's.
|
|
13
|
+
*
|
|
14
|
+
* @param marker - The index's start and end fields
|
|
15
|
+
* @returns The marker struct's field names, in order
|
|
16
|
+
*/
|
|
17
|
+
export function intervalMarkerFields(marker) {
|
|
18
|
+
return [`from=${marker.from}`, `to=${marker.to}`];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read an interval index's start and end back from its marker's field names
|
|
22
|
+
* ({@link intervalMarkerFields}).
|
|
23
|
+
*
|
|
24
|
+
* @param names - The marker struct's field names
|
|
25
|
+
* @returns The fields, or `undefined` when the names are not an interval marker's
|
|
26
|
+
*/
|
|
27
|
+
export function readIntervalMarker(names) {
|
|
28
|
+
const roles = new Map();
|
|
29
|
+
for (const name of names) {
|
|
30
|
+
const at = name.indexOf("=");
|
|
31
|
+
const role = name.slice(0, Math.max(at, 0));
|
|
32
|
+
if (at <= 0 || (role !== "from" && role !== "to") || roles.has(role))
|
|
33
|
+
return undefined;
|
|
34
|
+
roles.set(role, name.slice(at + 1));
|
|
35
|
+
}
|
|
36
|
+
const from = roles.get("from"), to = roles.get("to");
|
|
37
|
+
return from === undefined || to === undefined ? undefined : { from, to };
|
|
38
|
+
}
|
|
7
39
|
const leaf = 3n * (1n << 53n);
|
|
8
40
|
const integerText = printFor(IntegerType);
|
|
9
41
|
/**
|
|
@@ -11,17 +43,21 @@ const integerText = printFor(IntegerType);
|
|
|
11
43
|
* Their event identities are disjoint: each interval lives at one ancestor;
|
|
12
44
|
* which side the lower bound lies on selects its start or end ordering.
|
|
13
45
|
* Counts therefore sum original events, without reading or deduplicating rows.
|
|
46
|
+
* The key is `{ on, node, at }` (#1432): a search of its own fields names `on`
|
|
47
|
+
* as one literal, a range bounds it flattened, the leading values one by one.
|
|
14
48
|
* @param prefix - Exact choices of every leading field.
|
|
15
49
|
* @param choice - Half-open overlap range, exact start values, or all starts.
|
|
16
50
|
* @param interval - The generated index's interval metadata.
|
|
51
|
+
* @param printOn - The index's `on` printer.
|
|
17
52
|
* @returns Disjoint ordinary key searches understood by every record backend.
|
|
18
53
|
*/
|
|
19
|
-
export function intervalQueries(prefix, choice, interval) {
|
|
54
|
+
export function intervalQueries(prefix, choice, interval, printOn) {
|
|
20
55
|
const starts = [...prefix, integerText(0n)];
|
|
56
|
+
const atRoot = [printOn(prefix), integerText(0n)];
|
|
21
57
|
if (choice === undefined)
|
|
22
|
-
return [variant("fields", { values:
|
|
58
|
+
return [variant("fields", { values: atRoot, prefix: none })];
|
|
23
59
|
if (choice.type === "values")
|
|
24
|
-
return [...new Set(choice.value)].map(value => variant("fields", { values: [...
|
|
60
|
+
return [...new Set(choice.value)].map(value => variant("fields", { values: [...atRoot, value], prefix: none }));
|
|
25
61
|
if (choice.type !== "range")
|
|
26
62
|
throw new Error("Choose a time range for interval overlap");
|
|
27
63
|
const type = interval.optional ? OptionType(DateTimeType) : DateTimeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-interval.js","sourceRoot":"","sources":["../../../../src/platform/slice/record-interval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAiC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"record-interval.js","sourceRoot":"","sources":["../../../../src/platform/slice/record-interval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAiC,MAAM,eAAe,CAAC;AAe9I;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACvD,OAAO,CAAC,QAAQ,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IACvD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG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,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,EAAE;YACzE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A generated index's `on` (#1432): the row fields it is led by, nested in its
|
|
7
|
+
* key beside e3's own parts — `{ on, node, at }`, `{ on, area }`,
|
|
8
|
+
* `{ on, tile, key }`. A range bounds the key flattened, so a planner's ranges
|
|
9
|
+
* name the leading values one by one; a search of the key's own fields names
|
|
10
|
+
* `on` as one literal, which this prints.
|
|
11
|
+
*/
|
|
12
|
+
import { type EastType, type StructType } from "@elaraai/east";
|
|
13
|
+
/**
|
|
14
|
+
* A generated index's leading values as one `.east` literal of its `on`: each
|
|
15
|
+
* value — a field's `.east` literal, in the index's order — parsed at its
|
|
16
|
+
* field's type, and the struct printed at `on`'s type, never text joined by
|
|
17
|
+
* hand.
|
|
18
|
+
*/
|
|
19
|
+
export type RecordOnPrinter = (values: readonly string[]) => string;
|
|
20
|
+
/** Each generated index's `on` printer, by its name: what a planner names its leading values with. */
|
|
21
|
+
export type RecordOnPrinters = (index: string) => RecordOnPrinter;
|
|
22
|
+
/**
|
|
23
|
+
* The `on` printer of a generated index, from its key's `on` type.
|
|
24
|
+
*
|
|
25
|
+
* @param on - The index key's `on`: a struct of the leading fields at their key types
|
|
26
|
+
* @returns The printer
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordOnPrinter(on: StructType): RecordOnPrinter;
|
|
29
|
+
/**
|
|
30
|
+
* A generated index's `on` type, read off its key type: the struct its key
|
|
31
|
+
* names `on`, or `undefined` for a plain index's key.
|
|
32
|
+
*
|
|
33
|
+
* @param keyType - The index's key type
|
|
34
|
+
* @returns Its `on`, or `undefined`
|
|
35
|
+
*/
|
|
36
|
+
export declare function recordOnTypeOf(keyType: EastType | undefined): StructType | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The `on` printers of a binding's generated indexes, from its index key types
|
|
39
|
+
* (`IndexedSourceType`'s `IK`, a variant over the indexes), each made once.
|
|
40
|
+
*
|
|
41
|
+
* @param indexKeys - The binding's index key types, by index name
|
|
42
|
+
* @returns The printers; refusing an index whose key holds no `on`
|
|
43
|
+
*/
|
|
44
|
+
export declare function recordOnPrinters(indexKeys: Readonly<Record<string, EastType>>): RecordOnPrinters;
|
|
45
|
+
//# sourceMappingURL=record-on.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-on.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-on.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC;AAEpE,sGAAsG;AACtG,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,UAAU,GAAG,eAAe,CAgB/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAIpF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,GAAG,gBAAgB,CAYhG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A generated index's `on` (#1432): the row fields it is led by, nested in its
|
|
7
|
+
* key beside e3's own parts — `{ on, node, at }`, `{ on, area }`,
|
|
8
|
+
* `{ on, tile, key }`. A range bounds the key flattened, so a planner's ranges
|
|
9
|
+
* name the leading values one by one; a search of the key's own fields names
|
|
10
|
+
* `on` as one literal, which this prints.
|
|
11
|
+
*/
|
|
12
|
+
import { parseFor, printFor } from "@elaraai/east";
|
|
13
|
+
/**
|
|
14
|
+
* The `on` printer of a generated index, from its key's `on` type.
|
|
15
|
+
*
|
|
16
|
+
* @param on - The index key's `on`: a struct of the leading fields at their key types
|
|
17
|
+
* @returns The printer
|
|
18
|
+
*/
|
|
19
|
+
export function recordOnPrinter(on) {
|
|
20
|
+
const names = Object.keys(on.fields);
|
|
21
|
+
const parsers = names.map((name) => parseFor(on.fields[name]));
|
|
22
|
+
const print = printFor(on);
|
|
23
|
+
return (values) => {
|
|
24
|
+
if (values.length !== names.length) {
|
|
25
|
+
throw new Error(`A generated index led by ${names.length} field${names.length === 1 ? "" : "s"} names ${values.length} leading value${values.length === 1 ? "" : "s"}`);
|
|
26
|
+
}
|
|
27
|
+
const parsed = {};
|
|
28
|
+
names.forEach((name, i) => {
|
|
29
|
+
const result = parsers[i](values[i]);
|
|
30
|
+
if (!result.success)
|
|
31
|
+
throw new Error(`'${name}' is not a value of its field: ${result.error}`);
|
|
32
|
+
parsed[name] = result.value;
|
|
33
|
+
});
|
|
34
|
+
return print(parsed);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A generated index's `on` type, read off its key type: the struct its key
|
|
39
|
+
* names `on`, or `undefined` for a plain index's key.
|
|
40
|
+
*
|
|
41
|
+
* @param keyType - The index's key type
|
|
42
|
+
* @returns Its `on`, or `undefined`
|
|
43
|
+
*/
|
|
44
|
+
export function recordOnTypeOf(keyType) {
|
|
45
|
+
if (keyType?.type !== "Struct")
|
|
46
|
+
return undefined;
|
|
47
|
+
const on = keyType.fields.on;
|
|
48
|
+
return on?.type === "Struct" ? on : undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The `on` printers of a binding's generated indexes, from its index key types
|
|
52
|
+
* (`IndexedSourceType`'s `IK`, a variant over the indexes), each made once.
|
|
53
|
+
*
|
|
54
|
+
* @param indexKeys - The binding's index key types, by index name
|
|
55
|
+
* @returns The printers; refusing an index whose key holds no `on`
|
|
56
|
+
*/
|
|
57
|
+
export function recordOnPrinters(indexKeys) {
|
|
58
|
+
const made = new Map();
|
|
59
|
+
return (index) => {
|
|
60
|
+
let printer = made.get(index);
|
|
61
|
+
if (printer === undefined) {
|
|
62
|
+
const on = recordOnTypeOf(indexKeys[index]);
|
|
63
|
+
if (on === undefined)
|
|
64
|
+
throw new Error(`'${index}' is no generated index: its key holds no on`);
|
|
65
|
+
printer = recordOnPrinter(on);
|
|
66
|
+
made.set(index, printer);
|
|
67
|
+
}
|
|
68
|
+
return printer;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=record-on.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-on.js","sourceRoot":"","sources":["../../../../src/platform/slice/record-on.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAkC,MAAM,eAAe,CAAC;AAanF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAc;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACrC,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AAC;IACrE,OAAO,EAAE,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAA6C;IAC1E,MAAM,IAAI,GAAG,IAAI,GAAG,EAA2B,CAAC;IAChD,OAAO,CAAC,KAAK,EAAE,EAAE;QACb,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YAC5C,IAAI,EAAE,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,8CAA8C,CAAC,CAAC;YAC/F,OAAO,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -5,9 +5,26 @@
|
|
|
5
5
|
/** Query planning shared by authoring validation and the record Slice runtime. */
|
|
6
6
|
import { type ValueTypeOf } from "@elaraai/east";
|
|
7
7
|
import type { SeekQueryType } from "../../contracts/source.js";
|
|
8
|
-
import type { RecordSliceChoiceType, RecordSliceIndexType } from "./record-types.js";
|
|
8
|
+
import type { RecordSliceAreaType, RecordSliceChoiceType, RecordSliceIndexType } from "./record-types.js";
|
|
9
|
+
import type { RecordOnPrinters } from "./record-on.js";
|
|
9
10
|
type Choice = ValueTypeOf<RecordSliceChoiceType>;
|
|
10
11
|
type Index = ValueTypeOf<RecordSliceIndexType>;
|
|
12
|
+
type Area = ValueTypeOf<RecordSliceAreaType>;
|
|
13
|
+
/**
|
|
14
|
+
* The row fields a narrowing reads an index by, in order (#1432): its own —
|
|
15
|
+
* a plain index's fields, a generated index's `on` — then an interval's start,
|
|
16
|
+
* which a range reads through it.
|
|
17
|
+
* @param index - Available field path.
|
|
18
|
+
* @returns Its fields, an interval's start after them.
|
|
19
|
+
*/
|
|
20
|
+
export declare function recordIndexFields(index: Index): readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Whether an index's key is generated (#1432): its row fields under `on`, e3's
|
|
23
|
+
* own parts beside them — an interval, an area, a series or a summary index's.
|
|
24
|
+
* @param index - Available field path.
|
|
25
|
+
* @returns Whether its key nests its leading fields.
|
|
26
|
+
*/
|
|
27
|
+
export declare function recordIndexGenerated(index: Index): boolean;
|
|
11
28
|
/** Bound the fan-out of a multi-choice path; never replace it with a row scan. */
|
|
12
29
|
export declare const MAX_RECORD_SLICE_RUNS = 64;
|
|
13
30
|
/** One supported index path and the disjoint key searches it needs. */
|
|
@@ -19,37 +36,49 @@ export interface RecordSlicePlan {
|
|
|
19
36
|
}
|
|
20
37
|
/**
|
|
21
38
|
* Whether one index can answer every clause without scanning or duplicate rows.
|
|
22
|
-
* A
|
|
23
|
-
* by an area index whose leading fields the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
39
|
+
* A read by area's clause — a window, or the unplaced clause — is answered
|
|
40
|
+
* only by an area index whose leading fields the narrowing fills exactly. A
|
|
41
|
+
* generated index names its leading values as one `on` (#1432), so a narrowing
|
|
42
|
+
* read through it chooses each of them exactly, an interval's start after
|
|
43
|
+
* them. A series or a summary index answers none (#1039): the one files a row
|
|
44
|
+
* past a year under each year it touches (#1433), and the other's entries name
|
|
45
|
+
* no row; a reader reads their cells (`record-series.ts`).
|
|
27
46
|
* @param index - Available field path.
|
|
28
47
|
* @param where - Current narrowing.
|
|
48
|
+
* @param area - A read by area's clause, beside the narrowing.
|
|
29
49
|
* @returns Whether it is a supported path.
|
|
30
50
|
*/
|
|
31
|
-
export declare function recordPathMatches(index: Index, where: ReadonlyMap<string, Choice
|
|
32
|
-
/**
|
|
33
|
-
|
|
51
|
+
export declare function recordPathMatches(index: Index, where: ReadonlyMap<string, Choice>, area?: Area): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Pick a supported path without executing or parsing its ranges.
|
|
54
|
+
* @param indexes - Available paths.
|
|
55
|
+
* @param where - Current narrowing.
|
|
56
|
+
* @param area - A read by area's clause, beside the narrowing.
|
|
57
|
+
* @returns The path, or `undefined` when none answers it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function recordPlanIndex(indexes: readonly Index[], where: ReadonlyMap<string, Choice>, area?: Area): Index | undefined;
|
|
34
60
|
/**
|
|
35
61
|
* Plan the record's narrowing as exact leading values followed by at most one
|
|
36
62
|
* prefix or half-open range. The server answers every query; no predicate runs
|
|
37
63
|
* over a fetched row. Completed ranges are sorted by their actual source offsets.
|
|
38
64
|
*
|
|
39
|
-
* A
|
|
40
|
-
*
|
|
65
|
+
* A read by area reads through an area index whose leading fields the
|
|
66
|
+
* narrowing fills exactly: its `window`, the disjoint searches of
|
|
41
67
|
* {@link areaQueries} a combination of their values, or the unplaced clause, the
|
|
42
|
-
* rows with no place.
|
|
68
|
+
* rows with no place. A generated index's searches of its key's own fields
|
|
69
|
+
* name its leading values as one `on` literal (#1432), through its printer.
|
|
43
70
|
*
|
|
44
71
|
* @param indexes - Available paths.
|
|
45
72
|
* @param where - Field choices, in any authored order.
|
|
46
73
|
* @param defaultIndex - Unfiltered source containing every primary row once.
|
|
74
|
+
* @param area - A read by area's clause, beside the narrowing; none for any other read.
|
|
75
|
+
* @param printOn - Each generated index's `on` printer, by its name.
|
|
47
76
|
* @returns One path and its key searches; null when no index answers it.
|
|
48
77
|
* @throws When a choice would exceed the bounded number of disjoint runs; when a
|
|
49
|
-
*
|
|
50
|
-
*
|
|
78
|
+
* read by area has no area index to read it, naming the one to declare; when
|
|
79
|
+
* the window is malformed; or when a generated index is read with no printer.
|
|
51
80
|
*/
|
|
52
|
-
export declare function planRecordSlice(indexes: readonly Index[], where: ReadonlyMap<string, Choice>, defaultIndex: string): RecordSlicePlan | null;
|
|
81
|
+
export declare function planRecordSlice(indexes: readonly Index[], where: ReadonlyMap<string, Choice>, defaultIndex: string, area?: Area, printOn?: RecordOnPrinters): RecordSlicePlan | null;
|
|
53
82
|
/**
|
|
54
83
|
* What a field's choice of a kind needs chosen first, by the narrowing as it
|
|
55
84
|
* stands: the fields an index that takes that kind of choice on the field
|
|
@@ -66,7 +95,7 @@ export declare function planRecordSlice(indexes: readonly Index[], where: Readon
|
|
|
66
95
|
* @param indexes - Available field paths.
|
|
67
96
|
* @param current - Current narrowing.
|
|
68
97
|
* @param field - The field being chosen.
|
|
69
|
-
* @param kind - The kind of its choice: exact values, a range or a prefix
|
|
98
|
+
* @param kind - The kind of its choice: exact values, a range or a prefix.
|
|
70
99
|
* @param offered - The fields the rail offers: one it does not can never be chosen first.
|
|
71
100
|
* @returns The fields still to choose, in their index's order — none where none is — or null.
|
|
72
101
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-plan.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-plan.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kFAAkF;AAClF,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"record-plan.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-plan.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kFAAkF;AAClF,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG1G,OAAO,KAA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