@elaraai/e3 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.
Files changed (146) hide show
  1. package/README.md +4 -5
  2. package/dist/src/browser.d.ts +2 -0
  3. package/dist/src/browser.d.ts.map +1 -1
  4. package/dist/src/browser.js +6 -0
  5. package/dist/src/browser.js.map +1 -1
  6. package/dist/src/environment-capture.d.ts +21 -0
  7. package/dist/src/environment-capture.d.ts.map +1 -1
  8. package/dist/src/environment-capture.js +48 -0
  9. package/dist/src/environment-capture.js.map +1 -1
  10. package/dist/src/export.d.ts +10 -5
  11. package/dist/src/export.d.ts.map +1 -1
  12. package/dist/src/export.js +31 -47
  13. package/dist/src/export.js.map +1 -1
  14. package/dist/src/export.spec.js +27 -16
  15. package/dist/src/export.spec.js.map +1 -1
  16. package/dist/src/function.d.ts.map +1 -1
  17. package/dist/src/function.js.map +1 -1
  18. package/dist/src/functions-cache.d.ts +60 -0
  19. package/dist/src/functions-cache.d.ts.map +1 -0
  20. package/dist/src/functions-cache.js +165 -0
  21. package/dist/src/functions-cache.js.map +1 -0
  22. package/dist/src/functions-link.spec.js +191 -12
  23. package/dist/src/functions-link.spec.js.map +1 -1
  24. package/dist/src/functions-resolve.d.ts +52 -23
  25. package/dist/src/functions-resolve.d.ts.map +1 -1
  26. package/dist/src/functions-resolve.js +244 -96
  27. package/dist/src/functions-resolve.js.map +1 -1
  28. package/dist/src/index.d.ts +8 -61
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/index.js +3 -8
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/internal.d.ts +53 -0
  33. package/dist/src/internal.d.ts.map +1 -0
  34. package/dist/src/internal.js +29 -0
  35. package/dist/src/internal.js.map +1 -0
  36. package/dist/src/lazy-build.d.ts +25 -0
  37. package/dist/src/lazy-build.d.ts.map +1 -0
  38. package/dist/src/lazy-build.js +56 -0
  39. package/dist/src/lazy-build.js.map +1 -0
  40. package/dist/src/lazy-build.spec.d.ts +6 -0
  41. package/dist/src/lazy-build.spec.d.ts.map +1 -0
  42. package/dist/src/lazy-build.spec.js +153 -0
  43. package/dist/src/lazy-build.spec.js.map +1 -0
  44. package/dist/src/migration.d.ts +20 -163
  45. package/dist/src/migration.d.ts.map +1 -1
  46. package/dist/src/migration.js +37 -34
  47. package/dist/src/migration.js.map +1 -1
  48. package/dist/src/migration.spec.js +83 -78
  49. package/dist/src/migration.spec.js.map +1 -1
  50. package/dist/src/mutation-programs.spec.js +211 -118
  51. package/dist/src/mutation-programs.spec.js.map +1 -1
  52. package/dist/src/mutation.d.ts +37 -141
  53. package/dist/src/mutation.d.ts.map +1 -1
  54. package/dist/src/mutation.js +66 -28
  55. package/dist/src/mutation.js.map +1 -1
  56. package/dist/src/open-beast-link.spec.js +1 -1
  57. package/dist/src/open-beast-link.spec.js.map +1 -1
  58. package/dist/src/output.js.map +1 -1
  59. package/dist/src/package.d.ts +2 -38
  60. package/dist/src/package.d.ts.map +1 -1
  61. package/dist/src/package.js +42 -175
  62. package/dist/src/package.js.map +1 -1
  63. package/dist/src/record-area.d.ts +49 -37
  64. package/dist/src/record-area.d.ts.map +1 -1
  65. package/dist/src/record-area.js +211 -131
  66. package/dist/src/record-area.js.map +1 -1
  67. package/dist/src/record-area.spec.js +79 -62
  68. package/dist/src/record-area.spec.js.map +1 -1
  69. package/dist/src/record-arguments.d.ts +55 -0
  70. package/dist/src/record-arguments.d.ts.map +1 -0
  71. package/dist/src/record-arguments.js +72 -0
  72. package/dist/src/record-arguments.js.map +1 -0
  73. package/dist/src/record-builders.d.ts +547 -0
  74. package/dist/src/record-builders.d.ts.map +1 -0
  75. package/dist/src/record-builders.js +112 -0
  76. package/dist/src/record-builders.js.map +1 -0
  77. package/dist/src/record-declared.spec.d.ts +6 -0
  78. package/dist/src/record-declared.spec.d.ts.map +1 -0
  79. package/dist/src/record-declared.spec.js +251 -0
  80. package/dist/src/record-declared.spec.js.map +1 -0
  81. package/dist/src/record-guards.d.ts +114 -1
  82. package/dist/src/record-guards.d.ts.map +1 -1
  83. package/dist/src/record-guards.js +153 -2
  84. package/dist/src/record-guards.js.map +1 -1
  85. package/dist/src/record-index.d.ts +128 -350
  86. package/dist/src/record-index.d.ts.map +1 -1
  87. package/dist/src/record-index.js +44 -481
  88. package/dist/src/record-index.js.map +1 -1
  89. package/dist/src/record-index.spec.js +124 -90
  90. package/dist/src/record-index.spec.js.map +1 -1
  91. package/dist/src/record-interval.d.ts +57 -36
  92. package/dist/src/record-interval.d.ts.map +1 -1
  93. package/dist/src/record-interval.js +136 -94
  94. package/dist/src/record-interval.js.map +1 -1
  95. package/dist/src/record-interval.spec.js +48 -27
  96. package/dist/src/record-interval.spec.js.map +1 -1
  97. package/dist/src/record-keys.d.ts +146 -0
  98. package/dist/src/record-keys.d.ts.map +1 -0
  99. package/dist/src/record-keys.js +178 -0
  100. package/dist/src/record-keys.js.map +1 -0
  101. package/dist/src/record-nested-programs.d.ts +1457 -0
  102. package/dist/src/record-nested-programs.d.ts.map +1 -0
  103. package/dist/src/record-nested-programs.js +1974 -0
  104. package/dist/src/record-nested-programs.js.map +1 -0
  105. package/dist/src/record-nested.d.ts +284 -0
  106. package/dist/src/record-nested.d.ts.map +1 -0
  107. package/dist/src/record-nested.js +304 -0
  108. package/dist/src/record-nested.js.map +1 -0
  109. package/dist/src/record-nested.spec.d.ts +6 -0
  110. package/dist/src/record-nested.spec.d.ts.map +1 -0
  111. package/dist/src/record-nested.spec.js +1032 -0
  112. package/dist/src/record-nested.spec.js.map +1 -0
  113. package/dist/src/record-patches.d.ts +25 -0
  114. package/dist/src/record-patches.d.ts.map +1 -0
  115. package/dist/src/record-patches.js +27 -0
  116. package/dist/src/record-patches.js.map +1 -0
  117. package/dist/src/record-programs.d.ts +192 -26
  118. package/dist/src/record-programs.d.ts.map +1 -1
  119. package/dist/src/record-programs.js +858 -350
  120. package/dist/src/record-programs.js.map +1 -1
  121. package/dist/src/record-programs.spec.d.ts +6 -0
  122. package/dist/src/record-programs.spec.d.ts.map +1 -0
  123. package/dist/src/record-programs.spec.js +242 -0
  124. package/dist/src/record-programs.spec.js.map +1 -0
  125. package/dist/src/record-series.d.ts +101 -97
  126. package/dist/src/record-series.d.ts.map +1 -1
  127. package/dist/src/record-series.js +198 -149
  128. package/dist/src/record-series.js.map +1 -1
  129. package/dist/src/record-series.spec.js +241 -120
  130. package/dist/src/record-series.spec.js.map +1 -1
  131. package/dist/src/record-tiles.d.ts +328 -37
  132. package/dist/src/record-tiles.d.ts.map +1 -1
  133. package/dist/src/record-tiles.js +289 -100
  134. package/dist/src/record-tiles.js.map +1 -1
  135. package/dist/src/record.d.ts +66 -12
  136. package/dist/src/record.d.ts.map +1 -1
  137. package/dist/src/record.js +103 -34
  138. package/dist/src/record.js.map +1 -1
  139. package/dist/src/record.spec.js +48 -63
  140. package/dist/src/record.spec.js.map +1 -1
  141. package/dist/src/task.d.ts.map +1 -1
  142. package/dist/src/task.js +4 -1
  143. package/dist/src/task.js.map +1 -1
  144. package/dist/src/types.d.ts +103 -37
  145. package/dist/src/types.d.ts.map +1 -1
  146. package/package.json +7 -3
@@ -5,45 +5,7 @@
5
5
  /**
6
6
  * Package definitions for e3.
7
7
  */
8
- import { printType } from '@elaraai/east';
9
- import { nameProblem } from '@elaraai/e3-types';
10
- import { sameEastType } from './record-guards.js';
11
- /**
12
- * Creates a package definition from items.
13
- *
14
- * Automatically collects all dependencies from the provided items.
15
- * You only need to pass the "top-level" items - all inputs, intermediate
16
- * tasks, and datasets they depend on are included automatically.
17
- *
18
- * Organizes items into a discoverable structure:
19
- * - `pkg.datasets.inputs.*` - Input datasets
20
- * - `pkg.datasets.outputs.*` - Output datasets
21
- * - `pkg.tasks.*` - Tasks
22
- *
23
- * @param name - Package name
24
- * @param version - Package version
25
- * @param items - Items to include (datasets, tasks)
26
- * @returns A PackageDef with typed access to contents
27
- * @throws {Error} When the name or the version cannot be a file name — a
28
- * repository keeps the package at `packages/<name>/<version>` — when a
29
- * record is given two different mutations, indexes or migrations of one
30
- * name, or when a record's migrations are not one chain that leaves it as
31
- * its declared type
32
- *
33
- * @example
34
- * ```ts
35
- * const input_name = e3.input('name', StringType, variant('value', 'World'));
36
- * const say_hello = e3.task('say_hello', [input_name], ...);
37
- *
38
- * // Only need to pass the final task - input_name is included automatically
39
- * const pkg = e3.package('hello_world', '1.0.0', say_hello);
40
- *
41
- * // Typed access to contents
42
- * const nameInput = pkg.datasets.inputs.name;
43
- * const helloOutput = pkg.datasets.outputs.say_hello;
44
- * const helloTask = pkg.tasks.say_hello;
45
- * ```
46
- */
8
+ import { nameProblem, pathToString } from '@elaraai/e3-types';
47
9
  // NOTE: the return is deliberately `PackageDef<Record<string, unknown>>`, NOT
48
10
  // `PackageDef<MergeDatasets<TItems>>`. The precise merged-datasets map (used only
49
11
  // for the optional `pkg.datasets.tasks.x.output` typed-access convenience) inlines
@@ -63,16 +25,8 @@ export function package_(name, version, ...items) {
63
25
  // Functions have no deps and never enter the data tree — collected by
64
26
  // name, separately from all_items.
65
27
  const functions = {};
66
- // Mutations are collected by owning record name, like functions; they are
67
- // folded onto their record below. Records themselves are datasets, so they
68
- // ride `all_items` and only need a separate RecordObject channel.
69
- const mutationsByRecord = new Map();
70
- // Indexes are collected onto their record the same way, and for the same
71
- // reason: an index is declared beside the record and belongs to it.
72
- const indexesByRecord = new Map();
73
- // Migrations are collected onto their record too, each with the steps before
74
- // it, which its `after` names: passing a chain's last step passes the chain.
75
- const migrationsByRecord = new Map();
28
+ // Records are datasets, so they ride `all_items`, each whole with its parts;
29
+ // an imported package's records arrive here as well.
76
30
  const importedRecords = {};
77
31
  function collect(item) {
78
32
  if (visited.has(item))
@@ -96,160 +50,73 @@ export function package_(name, version, ...items) {
96
50
  else if (item.kind === "function") {
97
51
  functions[item.name] = item;
98
52
  }
99
- else if (item.kind === "mutation") {
100
- // Pull in the owning record's dataset and register the mutation onto it.
101
- collect(item.record);
102
- mutationsByRecord.set(item.record.name, [...(mutationsByRecord.get(item.record.name) ?? []), item]);
103
- }
104
- else if (item.kind === "recordIndex") {
105
- collect(item.record);
106
- indexesByRecord.set(item.record.name, [...(indexesByRecord.get(item.record.name) ?? []), item]);
107
- }
108
- else if (item.kind === "migration") {
109
- collect(item.record);
110
- const steps = migrationsByRecord.get(item.record.name) ?? [];
111
- for (let step = item; step !== undefined; step = step.after)
112
- steps.push(step);
113
- migrationsByRecord.set(item.record.name, steps);
114
- }
115
53
  else {
54
+ refusePart(name, item);
116
55
  collect(item);
117
56
  }
118
57
  }
58
+ // The package's datasets as a tree, each under its path's names; each tree
59
+ // kept by its path too, the root's ''.
119
60
  const datasets = {};
61
+ const trees = new Map([['', datasets]]);
120
62
  const tasks = {};
121
- // all_items is in topological order by construction
63
+ // all_items is in topological order by construction: a tree before what it holds
122
64
  for (const item of all_items) {
123
- if (item.kind === 'datatree') {
124
- let current = datasets;
125
- for (let i = 0; i < item.path.length - 1; i++) { // TODO should this path be the parent path?
126
- const segment = item.path[i];
127
- if (segment.type === 'field') {
128
- current = current[segment.value];
129
- if (current === undefined) {
130
- throw new Error(`Parent tree not found in package(): ${segment.value}`);
131
- }
132
- }
133
- else {
134
- throw new Error(`Unsupported path segment type in package(): ${segment.type}`);
135
- }
65
+ if (item.kind === 'datatree' || item.kind === 'dataset') {
66
+ const parentPath = pathToString(item.path.slice(0, -1));
67
+ const parent = trees.get(parentPath);
68
+ if (parent === undefined) {
69
+ throw new Error(`Parent tree not found in package(): '${parentPath}'`);
136
70
  }
137
- // the only tree type is struct for now
138
- current[item.name] = {};
139
- }
140
- else if (item.kind === 'dataset') {
141
- let current = datasets;
142
- for (let i = 0; i < item.path.length - 1; i++) { // TODO should this path be the parent path?
143
- const segment = item.path[i];
144
- if (segment.type === 'field') {
145
- current = current[segment.value];
146
- if (current === undefined) {
147
- throw new Error(`Parent tree not found in package(): ${segment.value}`);
148
- }
149
- }
150
- else {
151
- throw new Error(`Unsupported path segment type in package(): ${segment.type}`);
152
- }
71
+ if (item.kind === 'datatree') {
72
+ // the only tree type is struct for now
73
+ const tree = {};
74
+ parent[item.name] = tree;
75
+ trees.set(pathToString(item.path), tree);
76
+ }
77
+ else {
78
+ parent[item.name] = item;
153
79
  }
154
- current[item.name] = item;
155
80
  }
156
81
  else if (item.kind === 'task') {
157
82
  // TODO - check task inputs and output exist with correct types?
158
83
  tasks[item.name] = item;
159
84
  }
160
85
  }
161
- // One declaration per name on a record: given two different mutations, or
162
- // two different indexes, under one name, the record would keep whichever
163
- // came last.
164
- const byName = (record, kind, defs) => {
165
- const named = {};
166
- for (const def of defs) {
167
- const taken = named[def.name];
168
- if (taken !== undefined && taken !== def) {
169
- throw new Error(`e3.package '${name}': record '${record}' declares two ${kind} named '${def.name}' — pass each declaration once`);
170
- }
171
- named[def.name] = def;
172
- }
173
- return named;
174
- };
175
- // A record's migrations in the order they run. They are one chain: exactly
176
- // one step has no `after`, no two name the same one, and the last leaves the
177
- // record as it is declared, since a deploy leaves a migrated record at the
178
- // package's type.
179
- const chainOf = (rec, steps) => {
180
- const all = Object.values(byName(rec.name, 'migrations', steps));
181
- if (all.length === 0)
182
- return [];
183
- const where = `e3.package '${name}': record '${rec.name}'`;
184
- const firsts = all.filter((step) => step.after === undefined);
185
- if (firsts.length !== 1) {
186
- throw new Error(`${where} has ${firsts.length} migrations with no 'after' (${firsts.map((step) => `'${step.name}'`).join(', ')}) — ` +
187
- `its migrations are one chain, and only the first step names none`);
188
- }
189
- const next = new Map();
190
- for (const step of all) {
191
- if (step.after === undefined)
192
- continue;
193
- const taken = next.get(step.after.name);
194
- if (taken !== undefined) {
195
- throw new Error(`${where} has two migrations after '${step.after.name}', '${taken.name}' and '${step.name}' — ` +
196
- `its migrations are one chain`);
197
- }
198
- next.set(step.after.name, step);
199
- }
200
- const chain = [firsts[0]];
201
- for (let step = next.get(firsts[0].name); step !== undefined; step = next.get(step.name))
202
- chain.push(step);
203
- const last = chain[chain.length - 1];
204
- if (!sameEastType(last.to, rec.type)) {
205
- throw new Error(`${where} is declared as ${printType(rec.type)}, but its last migration, '${last.name}', ` +
206
- `leaves it as ${printType(last.to)}`);
207
- }
208
- return chain;
209
- };
210
- // Assemble records: a record's dataset rides `all_items`; fold in any
211
- // mutations collected for it. A record imported via a package arrives twice —
212
- // its bare dataset (mutations `{}`) in `all_items` and its already-assembled
213
- // form in `importedRecords` — so merge the existing entry's mutations rather
214
- // than rebuilding from the bare `rec.mutations`, or the import's folded
215
- // mutations would be clobbered to empty.
86
+ // Each record whole, as `e3.record` declared it.
216
87
  const records = { ...importedRecords };
217
88
  for (const item of all_items) {
218
89
  if (item.kind === 'dataset' && 'recordKind' in item && item.recordKind === 'record') {
219
90
  const rec = item;
220
- records[rec.name] = {
221
- ...rec,
222
- mutations: byName(rec.name, 'mutations', [
223
- ...Object.values(records[rec.name]?.mutations ?? {}),
224
- ...Object.values(rec.mutations),
225
- ...(mutationsByRecord.get(rec.name) ?? []),
226
- ]),
227
- indexes: byName(rec.name, 'indexes', [
228
- ...Object.values(records[rec.name]?.indexes ?? {}),
229
- ...Object.values(rec.indexes),
230
- ...(indexesByRecord.get(rec.name) ?? []),
231
- ]),
232
- migrations: chainOf(rec, [
233
- ...(records[rec.name]?.migrations ?? []),
234
- ...rec.migrations,
235
- ...(migrationsByRecord.get(rec.name) ?? []),
236
- ]),
237
- };
238
- }
239
- }
240
- for (const recName of mutationsByRecord.keys()) {
241
- if (!records[recName]) {
242
- throw new Error(`Mutation references record '${recName}' which is not in the package`);
91
+ records[rec.name] = rec;
243
92
  }
244
93
  }
245
94
  return {
246
95
  kind: 'package',
247
96
  name,
248
97
  version,
249
- datasets: datasets,
98
+ datasets,
250
99
  contents: [...all_items],
251
100
  functions,
252
101
  records,
253
102
  };
254
103
  }
104
+ /** What each part of a record is called, by its kind. */
105
+ const PART_WORDS = { recordIndex: 'index', mutation: 'mutation', migration: 'migration' };
106
+ /**
107
+ * Refuses a record's part given apart from its record, naming the record: its
108
+ * parts are declared in `e3.record`, and a package takes the record whole.
109
+ *
110
+ * @param name - The package
111
+ * @param item - What it was given
112
+ * @throws {Error} When the item is an index, a mutation or a migration
113
+ */
114
+ function refusePart(name, item) {
115
+ const part = item;
116
+ const words = PART_WORDS[part.kind];
117
+ if (words === undefined)
118
+ return;
119
+ throw new Error(`e3.package '${name}': the ${words} '${part.name}' is part of record '${part.record?.name}' — a record is declared ` +
120
+ `whole, its ${words === 'index' ? 'indexes' : `${words}s`} in e3.record, so pass the record`);
121
+ }
255
122
  //# sourceMappingURL=package.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,8EAA8E;AAC9E,kFAAkF;AAClF,mFAAmF;AACnF,gFAAgF;AAChF,mFAAmF;AACnF,wEAAwE;AACxE,6EAA6E;AAC7E,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,OAAe,EACf,GAAG,KAAoG;IAEvG,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAU,EAAE,CAAC;QACvF,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,IAAI,OAAO,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,kEAAkE;IAClE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAe,CAAC;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AU,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAE5H;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAY,EAAE,IAAa;IAC7C,MAAM,IAAI,GAAG,IAAqG,CAAC;IACnH,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,MAAM,IAAI,KAAK,CACb,eAAe,IAAI,UAAU,KAAK,KAAK,IAAI,CAAC,IAAI,wBAAwB,IAAI,CAAC,MAAM,EAAE,IAAI,2BAA2B;QACpH,cAAc,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,mCAAmC,CAC7F,CAAC;AACJ,CAAC"}
@@ -21,14 +21,13 @@
21
21
  * runtime — TypeScript, C, Python — files a row under the same key, which is
22
22
  * what lets a maintained index equal its rebuild byte for byte.
23
23
  */
24
- import { FloatType, IntegerType, StructType, type EastType } from '@elaraai/east';
25
- import type { IndexFunction } from './record-index.js';
24
+ import { FloatType, IntegerType } from '@elaraai/east';
25
+ import type { RecordDef, RecordIndexDef } from './types.js';
26
+ import { type IndexConstructor } from './record-guards.js';
26
27
  /** The finest level: a level-28 cell is `cell` wide. */
27
28
  export declare const AREA_FINEST_LEVEL = 28;
28
29
  /** The key of a row with no place: its `x` or its `y` is `none`. */
29
30
  export declare const AREA_UNPLACED = -1n;
30
- /** The reserved name of the area index's generated key field. */
31
- export declare const AREA_FIELD = "__area";
32
31
  /** How an area index reads a row's box: the fields naming it, and whether `x`, `y` is its centre or its minimum corner. */
33
32
  export interface AreaBox {
34
33
  /** The field holding the box's `x`: its minimum corner's, or its centre's. */
@@ -46,49 +45,62 @@ export interface AreaBox {
46
45
  * The exponent of the largest power of two at most `cell`: the finest cell's
47
46
  * side, as the index files rows by it.
48
47
  *
48
+ * @param constructor - The declaration, for the refusal
49
49
  * @param name - The index, for the refusal
50
50
  * @param cell - The finest cell's side the author declared, in world units
51
51
  * @returns `e`, with `2^e ≤ cell < 2^(e+1)`
52
52
  * @throws {Error} When `cell` is not a positive finite number, or is so large or
53
53
  * small that the domain, `2^(e+27)` either side of zero, is not a finite Float
54
54
  */
55
- export declare function areaCellExponent(name: string, cell: number): number;
55
+ export declare function areaCellExponent(constructor: IndexConstructor, name: string, cell: number): number;
56
+ /** What an area index's declaration names (`index.area`). */
57
+ export interface AreaSpec {
58
+ readonly on?: readonly string[];
59
+ readonly x: string;
60
+ readonly y: string;
61
+ readonly width?: string;
62
+ readonly height?: string;
63
+ readonly at?: 'corner' | 'centre';
64
+ readonly cell: number;
65
+ }
56
66
  /**
57
- * The `__area` key of a box, from its centre and its larger side: an East
58
- * function, so every runtime computes it alike.
67
+ * An area index's definition (`index.area`): its key function, one
68
+ * entry per row — one per combination of its leading values where a Set among
69
+ * them fans out — `{ on: { …on }, area }`, the row's leading fields under `on`
70
+ * and the cell's code beside them (#1432); and its projection, the whole row,
71
+ * so a window reads the index alone and no record segment (D29). It stays an
72
+ * ordinary maintained index: mutation, rebuild, storage and transport are
73
+ * shared.
59
74
  *
60
- * @param exponent - The finest cell's side is `2^exponent` world units
61
- * @returns `(cx, cy, side) → Integer`: the level-28 Morton code of the box's
62
- * cell, times 32, plus its level; `0`, the root, for a box outside the domain,
63
- * not finite, or larger than half the domain
75
+ * @param constructor - The declaration, as a refusal names it
76
+ * @param name - The index
77
+ * @param rec - Its record
78
+ * @param spec - The box's fields, whether `x`, `y` is its centre or its corner, the finest cell, and the optional leading `on`
79
+ * @param config - Its runner selection
80
+ * @returns The definition
81
+ * @throws {Error} When a field is not of its option's type, naming the option, the field and its type; when `x` and `y`
82
+ * are not both Options or neither; when `width` and `height` are not given together; or on any guard every index applies
64
83
  */
65
- export declare function areaCode(exponent: number): import("@elaraai/east").CallableFunctionExpr<[FloatType, FloatType, FloatType], IntegerType>;
84
+ export declare function areaDefinition(constructor: IndexConstructor, name: string, rec: RecordDef, spec: AreaSpec, config: {
85
+ runner?: RecordIndexDef['runner'];
86
+ } | undefined): RecordIndexDef;
66
87
  /**
67
- * Generate the area index's pure key function: one entry per row (one per
68
- * element of a Set among the leading `on` fields), `{ …on, __area }`, using
69
- * the field index's generated function for the leading fields, as the
70
- * interval index does. It stays an ordinary maintained index: mutation,
71
- * rebuild, storage and transport are shared.
72
- *
73
- * @param name - The index, for the refusals
74
- * @param keyType - The record's key type
75
- * @param valueType - The record's row type
76
- * @param on - The exact leading fields
77
- * @param box - How the row's box is read
78
- * @param exponent - The finest cell's side is `2^exponent`
79
- * @param prefix - The leading fields' generated key function
80
- * @returns The key function, whether it fans out, and whether `x` and `y` are Options
81
- * @throws {Error} When a field is not of its option's type, naming the option,
82
- * the field and its type; when `x` and `y` are not both Options or neither;
83
- * when `width` and `height` are not given together; or when the row has a
84
- * field named `__area`, which is reserved
88
+ * The area index's East functions, each built the first time it is read, with
89
+ * no location captured ({@link lazyBuilds}, #1466): importing the SDK builds
90
+ * none of them.
85
91
  */
86
- export declare function areaKey(name: string, keyType: EastType, valueType: EastType, on: readonly string[], box: AreaBox, exponent: number, prefix?: {
87
- fn: IndexFunction;
88
- multi: boolean;
89
- }): {
90
- fn: import("@elaraai/east").CallableFunctionExpr<[never, StructType<Record<string, EastType>>], never>;
91
- multi: boolean;
92
- optional: boolean;
92
+ export declare const AREA_FNS: {
93
+ /**
94
+ * The `area` part of a box's key, from its centre, its larger side and the
95
+ * finest cell's side, a power of two: the level-28 Morton code of the box's
96
+ * cell, times 32, plus its level; `0`, the root, for a box outside the domain,
97
+ * not finite, or larger than half the domain. Every step is exact, so every
98
+ * runtime computes it alike.
99
+ *
100
+ * `(cx, cy, side, cell) → Integer`
101
+ */
102
+ readonly areaCode: import("@elaraai/east").CallableFunctionExpr<[FloatType, FloatType, FloatType, FloatType], IntegerType>;
103
+ /** `(width, height) → the larger of their sizes`: a box's larger side. */
104
+ readonly largerSide: import("@elaraai/east").CallableFunctionExpr<[FloatType, FloatType], FloatType>;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