@elaraai/e3-ui 1.0.11 → 1.0.12

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.
@@ -0,0 +1,611 @@
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
+ * The `Experiment` render contract — the **e3-ui-owned** boundary types the
7
+ * component reads and the developer's bound functions return.
8
+ *
9
+ * @remarks
10
+ * These are *not* causal-library types: `e3-ui` never imports
11
+ * `east-py-datascience`. They are the small contract a sign-flip experiment
12
+ * surface needs — the causal quantities (`effect` / `ci` / the ALE vectors /
13
+ * the refuter numbers) plus the two additions the surface requires (`naive`
14
+ * for the raw-vs-adjusted comparison and `balance` for the confounder table).
15
+ *
16
+ * The split follows the **string-vs-variant rule** ({@link ExperimentSpecType}):
17
+ *
18
+ * - **Closed choices are variants** — the user's Advanced estimator / target /
19
+ * trim selections ({@link EstimatorType}, {@link TargetUnitsType},
20
+ * {@link TrimType}). They mirror the causal vocabulary *structurally*, so the
21
+ * developer's ~10-line `spec → CausalEffectConfig` bridge is an identity map
22
+ * on these fields — but the type lives here, owned by the surface.
23
+ * - **Column references are strings** — `treatment` / `outcome` / `confounders`
24
+ * are field names introspected from the bound dataset's row struct (the
25
+ * `Table` pattern), so they are open over whatever columns the data has.
26
+ * - **Presentation is derived, never stored** — no `tone` / bar width / label /
27
+ * sentence appears here. The renderer composes every word and colour from the
28
+ * numbers + the user's chosen column names.
29
+ *
30
+ * Where a shape overlaps the library (`Ci`, the ALE vectors) it is
31
+ * **structurally identical**, so values unify by shape across the package
32
+ * boundary with no shared package and no conversion.
33
+ *
34
+ * Reached via `Experiment.Types.*` (like `Table.Types.*`), not public named
35
+ * exports — users only touch them to type the bound functions / seed datasets.
36
+ *
37
+ * @packageDocumentation
38
+ */
39
+ import { StringType, FloatType, IntegerType, BooleanType, NullType, DateTimeType, ArrayType, StructType, VariantType, OptionType, DictType, VectorType } from '@elaraai/east';
40
+ /**
41
+ * Inverse-propensity weighting scheme for the
42
+ * {@link EstimatorType | propensity-weighting} estimator. Structurally mirrors
43
+ * the causal library's weighting-scheme variant.
44
+ *
45
+ * @property ips_weight - Raw inverse propensity weights.
46
+ * @property ips_stabilized_weight - Stabilised weights (recommended; lower variance).
47
+ * @property ips_normalized_weight - Normalised inverse propensity weights.
48
+ */
49
+ export declare const WeightingSchemeType: VariantType<{
50
+ readonly ips_weight: NullType;
51
+ readonly ips_stabilized_weight: NullType;
52
+ readonly ips_normalized_weight: NullType;
53
+ }>;
54
+ /** Type alias for {@link WeightingSchemeType}. */
55
+ export type WeightingSchemeType = typeof WeightingSchemeType;
56
+ /**
57
+ * How the like-for-like comparison is estimated — the user's "method" choice in
58
+ * the Advanced panel. Closed set, so a variant; structurally mirrors the causal
59
+ * estimator vocabulary.
60
+ *
61
+ * @property linear_regression - Regress the outcome on treatment + confounders.
62
+ * @property propensity_score_weighting - Re-weight rows by treatment
63
+ * propensity (binary treatment); carries the optional
64
+ * {@link WeightingSchemeType}.
65
+ */
66
+ export declare const EstimatorType: VariantType<{
67
+ readonly linear_regression: NullType;
68
+ readonly propensity_score_weighting: StructType<{
69
+ readonly weighting_scheme: OptionType<VariantType<{
70
+ readonly ips_weight: NullType;
71
+ readonly ips_stabilized_weight: NullType;
72
+ readonly ips_normalized_weight: NullType;
73
+ }>>;
74
+ }>;
75
+ }>;
76
+ /** Type alias for {@link EstimatorType}. */
77
+ export type EstimatorType = typeof EstimatorType;
78
+ /**
79
+ * Which population the effect is reported for — the user's "who" choice. Closed
80
+ * set, so a variant; structurally mirrors the causal target-units vocabulary.
81
+ *
82
+ * @property ate - Everyone (average treatment effect).
83
+ * @property att - The treated group (average effect on the treated).
84
+ * @property atc - The untreated group (average effect on the controls).
85
+ */
86
+ export declare const TargetUnitsType: VariantType<{
87
+ readonly ate: NullType;
88
+ readonly att: NullType;
89
+ readonly atc: NullType;
90
+ }>;
91
+ /** Type alias for {@link TargetUnitsType}. */
92
+ export type TargetUnitsType = typeof TargetUnitsType;
93
+ /**
94
+ * Whether un-matchable rows are dropped before estimating — the user's "trim"
95
+ * choice. Closed set, so a variant; structurally mirrors the causal
96
+ * propensity-trim vocabulary.
97
+ *
98
+ * @property overlap - Keep only the common-support overlap of the two groups.
99
+ * @property bounds - Keep rows whose propensity is inside explicit `lower` /
100
+ * `upper` bounds.
101
+ */
102
+ export declare const TrimType: VariantType<{
103
+ readonly overlap: NullType;
104
+ readonly bounds: StructType<{
105
+ readonly lower: FloatType;
106
+ readonly upper: FloatType;
107
+ }>;
108
+ }>;
109
+ /** Type alias for {@link TrimType}. */
110
+ export type TrimType = typeof TrimType;
111
+ /**
112
+ * The experiment the user framed in the set-up rail — the staged value the
113
+ * pickers write and **Run** feeds to the bound `estimate` function.
114
+ *
115
+ * @remarks
116
+ * `treatment` / `outcome` / `confounders` / `categorical` are **column names**
117
+ * introspected from the bound dataset's row struct, so the surface re-frames
118
+ * over whatever columns the data has (the `Table` pattern). The Advanced
119
+ * choices ({@link EstimatorType}, {@link TargetUnitsType}, {@link TrimType}) are
120
+ * variants. `population` is an optional Slice-style predicate set that narrows
121
+ * the rows before estimating.
122
+ *
123
+ * @property treatment - The column whose change might cause the effect.
124
+ * @property outcome - The column it might move.
125
+ * @property confounders - The backdoor set — columns to adjust for.
126
+ * @property categorical - Which of the confounders hold category codes (one-hot
127
+ * encoded by the estimator).
128
+ * @property population - Optional row narrowing (AND-ed Slice predicates).
129
+ * @property method - Optional estimator override (default: linear regression).
130
+ * @property targetUnits - Optional population override (default: everyone).
131
+ * @property trim - Optional un-matchable-row trimming (propensity weighting only).
132
+ */
133
+ export declare const ExperimentSpecType: StructType<{
134
+ readonly treatment: StringType;
135
+ readonly outcome: StringType;
136
+ readonly confounders: ArrayType<StringType>;
137
+ readonly categorical: ArrayType<StringType>;
138
+ readonly population: OptionType<ArrayType<VariantType<{
139
+ readonly string: import("@elaraai/east").StructType<{
140
+ readonly fieldId: import("@elaraai/east").StringType;
141
+ readonly op: import("@elaraai/east").VariantType<{
142
+ readonly eq: import("@elaraai/east").StringType;
143
+ readonly neq: import("@elaraai/east").StringType;
144
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
145
+ readonly notIn: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
146
+ readonly contains: import("@elaraai/east").StringType;
147
+ readonly matches: import("@elaraai/east").StringType;
148
+ }>;
149
+ }>;
150
+ readonly integer: import("@elaraai/east").StructType<{
151
+ readonly fieldId: import("@elaraai/east").StringType;
152
+ readonly op: import("@elaraai/east").VariantType<{
153
+ readonly eq: import("@elaraai/east").IntegerType;
154
+ readonly neq: import("@elaraai/east").IntegerType;
155
+ readonly lt: import("@elaraai/east").IntegerType;
156
+ readonly lte: import("@elaraai/east").IntegerType;
157
+ readonly gt: import("@elaraai/east").IntegerType;
158
+ readonly gte: import("@elaraai/east").IntegerType;
159
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").IntegerType>;
160
+ }>;
161
+ }>;
162
+ readonly float: import("@elaraai/east").StructType<{
163
+ readonly fieldId: import("@elaraai/east").StringType;
164
+ readonly op: import("@elaraai/east").VariantType<{
165
+ readonly lt: import("@elaraai/east").FloatType;
166
+ readonly lte: import("@elaraai/east").FloatType;
167
+ readonly gt: import("@elaraai/east").FloatType;
168
+ readonly gte: import("@elaraai/east").FloatType;
169
+ }>;
170
+ }>;
171
+ readonly datetime: import("@elaraai/east").StructType<{
172
+ readonly fieldId: import("@elaraai/east").StringType;
173
+ readonly op: import("@elaraai/east").VariantType<{
174
+ readonly before: import("@elaraai/east").DateTimeType;
175
+ readonly after: import("@elaraai/east").DateTimeType;
176
+ readonly between: import("@elaraai/east").StructType<{
177
+ readonly from: import("@elaraai/east").DateTimeType;
178
+ readonly to: import("@elaraai/east").DateTimeType;
179
+ }>;
180
+ }>;
181
+ }>;
182
+ readonly boolean: import("@elaraai/east").StructType<{
183
+ readonly fieldId: import("@elaraai/east").StringType;
184
+ readonly op: import("@elaraai/east").VariantType<{
185
+ readonly is: import("@elaraai/east").BooleanType;
186
+ }>;
187
+ }>;
188
+ }>>>;
189
+ readonly method: OptionType<VariantType<{
190
+ readonly linear_regression: NullType;
191
+ readonly propensity_score_weighting: StructType<{
192
+ readonly weighting_scheme: OptionType<VariantType<{
193
+ readonly ips_weight: NullType;
194
+ readonly ips_stabilized_weight: NullType;
195
+ readonly ips_normalized_weight: NullType;
196
+ }>>;
197
+ }>;
198
+ }>>;
199
+ readonly targetUnits: OptionType<VariantType<{
200
+ readonly ate: NullType;
201
+ readonly att: NullType;
202
+ readonly atc: NullType;
203
+ }>>;
204
+ readonly trim: OptionType<VariantType<{
205
+ readonly overlap: NullType;
206
+ readonly bounds: StructType<{
207
+ readonly lower: FloatType;
208
+ readonly upper: FloatType;
209
+ }>;
210
+ }>>;
211
+ }>;
212
+ /** Type alias for {@link ExperimentSpecType}. */
213
+ export type ExperimentSpecType = typeof ExperimentSpecType;
214
+ /**
215
+ * A confidence interval. Structurally identical to the causal library's `ci`,
216
+ * so it unifies by shape across the package boundary.
217
+ *
218
+ * @property lower - Lower bound.
219
+ * @property upper - Upper bound.
220
+ */
221
+ export declare const CiType: StructType<{
222
+ readonly lower: FloatType;
223
+ readonly upper: FloatType;
224
+ }>;
225
+ /** Type alias for {@link CiType}. */
226
+ export type CiType = typeof CiType;
227
+ /**
228
+ * One confounder's before-adjustment imbalance — the two group means and the
229
+ * standardised difference. The renderer derives the bar width, tone and "6.1 vs
230
+ * 8.0" label from these numbers.
231
+ *
232
+ * @property column - The confounder column.
233
+ * @property treatedMean - Mean of the column in the treated group.
234
+ * @property controlMean - Mean of the column in the control group.
235
+ * @property stdDiff - Standardised mean difference (the imbalance magnitude).
236
+ */
237
+ export declare const BalanceRowType: StructType<{
238
+ readonly column: StringType;
239
+ readonly treatedMean: FloatType;
240
+ readonly controlMean: FloatType;
241
+ readonly stdDiff: FloatType;
242
+ }>;
243
+ /** Type alias for {@link BalanceRowType}. */
244
+ export type BalanceRowType = typeof BalanceRowType;
245
+ /**
246
+ * The `estimate` answer — the adjusted (like-for-like) effect, the naive (raw)
247
+ * effect for the sign-flip comparison, the sample accounting, and the
248
+ * confounder balance. Every word and colour on the surface is derived from
249
+ * these numbers.
250
+ *
251
+ * @property effect - The adjusted (like-for-like) effect estimate.
252
+ * @property ci - Optional confidence interval for `effect`.
253
+ * @property naive - The raw (unadjusted) mean difference.
254
+ * @property naiveCi - Optional confidence interval for `naive`.
255
+ * @property nTotal - Rows in the framed population.
256
+ * @property nTreated - Treated rows used.
257
+ * @property nControl - Control rows used.
258
+ * @property nDropped - Rows dropped by trimming / missing data.
259
+ * @property balance - Per-confounder before-adjustment imbalance, most
260
+ * imbalanced first.
261
+ */
262
+ export declare const ExperimentResultType: StructType<{
263
+ readonly effect: FloatType;
264
+ readonly ci: OptionType<StructType<{
265
+ readonly lower: FloatType;
266
+ readonly upper: FloatType;
267
+ }>>;
268
+ readonly naive: FloatType;
269
+ readonly naiveCi: OptionType<StructType<{
270
+ readonly lower: FloatType;
271
+ readonly upper: FloatType;
272
+ }>>;
273
+ readonly nTotal: IntegerType;
274
+ readonly nTreated: IntegerType;
275
+ readonly nControl: IntegerType;
276
+ readonly nDropped: IntegerType;
277
+ readonly balance: ArrayType<StructType<{
278
+ readonly column: StringType;
279
+ readonly treatedMean: FloatType;
280
+ readonly controlMean: FloatType;
281
+ readonly stdDiff: FloatType;
282
+ }>>;
283
+ }>;
284
+ /** Type alias for {@link ExperimentResultType}. */
285
+ export type ExperimentResultType = typeof ExperimentResultType;
286
+ /**
287
+ * Which robustness check a {@link RefuteCheckType} row is. Closed set → variant;
288
+ * the renderer derives the check's name, description and pass/fail from the kind
289
+ * plus the numbers.
290
+ *
291
+ * @property placebo - Fake treatment — the effect should vanish.
292
+ * @property random_common_cause - Inject a random cause — the effect should hold.
293
+ * @property data_subset - Re-estimate on subsets — the effect should be stable.
294
+ * @property unobserved - Simulated hidden confounder — a sensitivity curve.
295
+ */
296
+ export declare const RefuteKindType: VariantType<{
297
+ readonly placebo: NullType;
298
+ readonly random_common_cause: NullType;
299
+ readonly data_subset: NullType;
300
+ readonly unobserved: NullType;
301
+ }>;
302
+ /** Type alias for {@link RefuteKindType}. */
303
+ export type RefuteKindType = typeof RefuteKindType;
304
+ /**
305
+ * One robustness check — the real refuter numbers. The renderer turns these
306
+ * into the pass/fail row and (for `unobserved`) the sensitivity curve.
307
+ *
308
+ * @property kind - Which check this is ({@link RefuteKindType}).
309
+ * @property estimatedEffect - The original effect being challenged.
310
+ * @property newEffects - Effect(s) under the refutation — one entry for
311
+ * placebo / random-cause / subset; one per simulated strength for unobserved.
312
+ * @property strengths - For `unobserved` only: the simulated confounder
313
+ * strengths paired with `newEffects` (the sensitivity-curve x-axis). `none`
314
+ * for the single-shot checks.
315
+ * @property pValue - Refuter p-value where the check provides one.
316
+ */
317
+ export declare const RefuteCheckType: StructType<{
318
+ readonly kind: VariantType<{
319
+ readonly placebo: NullType;
320
+ readonly random_common_cause: NullType;
321
+ readonly data_subset: NullType;
322
+ readonly unobserved: NullType;
323
+ }>;
324
+ readonly estimatedEffect: FloatType;
325
+ readonly newEffects: VectorType<FloatType>;
326
+ readonly strengths: OptionType<VectorType<FloatType>>;
327
+ readonly pValue: OptionType<FloatType>;
328
+ }>;
329
+ /** Type alias for {@link RefuteCheckType}. */
330
+ export type RefuteCheckType = typeof RefuteCheckType;
331
+ /**
332
+ * The `refute` answer — the battery of robustness checks shown in the "Can we
333
+ * trust it?" tab.
334
+ *
335
+ * @property checks - The checks that were run.
336
+ */
337
+ export declare const RefuteResultType: StructType<{
338
+ readonly checks: ArrayType<StructType<{
339
+ readonly kind: VariantType<{
340
+ readonly placebo: NullType;
341
+ readonly random_common_cause: NullType;
342
+ readonly data_subset: NullType;
343
+ readonly unobserved: NullType;
344
+ }>;
345
+ readonly estimatedEffect: FloatType;
346
+ readonly newEffects: VectorType<FloatType>;
347
+ readonly strengths: OptionType<VectorType<FloatType>>;
348
+ readonly pValue: OptionType<FloatType>;
349
+ }>>;
350
+ }>;
351
+ /** Type alias for {@link RefuteResultType}. */
352
+ export type RefuteResultType = typeof RefuteResultType;
353
+ /**
354
+ * A per-segment dose-response sub-curve (e.g. one production line). The grid /
355
+ * effect / CI vectors mirror the top-level {@link DoseResultType} curve shape.
356
+ *
357
+ * @property label - Segment label ("Line A", "Acme", …).
358
+ * @property grid - Feature grid values.
359
+ * @property effect - Centered ALE effect at each grid value.
360
+ * @property lower - Optional lower CI at each grid value.
361
+ * @property upper - Optional upper CI at each grid value.
362
+ */
363
+ export declare const DoseSegmentType: StructType<{
364
+ readonly label: StringType;
365
+ readonly grid: VectorType<FloatType>;
366
+ readonly effect: VectorType<FloatType>;
367
+ readonly lower: OptionType<VectorType<FloatType>>;
368
+ readonly upper: OptionType<VectorType<FloatType>>;
369
+ }>;
370
+ /** Type alias for {@link DoseSegmentType}. */
371
+ export type DoseSegmentType = typeof DoseSegmentType;
372
+ /**
373
+ * The `dose` answer — an ALE dose-response curve for a chosen feature, plus the
374
+ * optional per-segment breakdown. The grid / effect / CI / size vectors are
375
+ * structurally identical to the causal library's ALE result.
376
+ *
377
+ * @property feature - The dose feature column.
378
+ * @property grid - Feature grid values (interval edges).
379
+ * @property effect - Centered ALE effect at each grid value (outcome units).
380
+ * @property lower - Optional lower CI at each grid value.
381
+ * @property upper - Optional upper CI at each grid value.
382
+ * @property size - Number of samples in each grid interval.
383
+ * @property segments - Optional per-segment sub-curves ({@link DoseSegmentType}).
384
+ */
385
+ export declare const DoseResultType: StructType<{
386
+ readonly feature: StringType;
387
+ readonly grid: VectorType<FloatType>;
388
+ readonly effect: VectorType<FloatType>;
389
+ readonly lower: OptionType<VectorType<FloatType>>;
390
+ readonly upper: OptionType<VectorType<FloatType>>;
391
+ readonly size: VectorType<IntegerType>;
392
+ readonly segments: OptionType<ArrayType<StructType<{
393
+ readonly label: StringType;
394
+ readonly grid: VectorType<FloatType>;
395
+ readonly effect: VectorType<FloatType>;
396
+ readonly lower: OptionType<VectorType<FloatType>>;
397
+ readonly upper: OptionType<VectorType<FloatType>>;
398
+ }>>>;
399
+ }>;
400
+ /** Type alias for {@link DoseResultType}. */
401
+ export type DoseResultType = typeof DoseResultType;
402
+ /**
403
+ * A committed experiment in the journal — the framed spec + the headline effect
404
+ * + who committed it when. The renderer derives the verdict words and colour
405
+ * from `effect` / `ci`.
406
+ *
407
+ * @property spec - The experiment that was committed ({@link ExperimentSpecType}).
408
+ * @property effect - The adjusted effect at commit time.
409
+ * @property ci - Optional confidence interval at commit time.
410
+ * @property committedAt - When it was committed.
411
+ * @property committedBy - Who committed it.
412
+ */
413
+ export declare const JournalRowType: StructType<{
414
+ readonly spec: StructType<{
415
+ readonly treatment: StringType;
416
+ readonly outcome: StringType;
417
+ readonly confounders: ArrayType<StringType>;
418
+ readonly categorical: ArrayType<StringType>;
419
+ readonly population: OptionType<ArrayType<VariantType<{
420
+ readonly string: import("@elaraai/east").StructType<{
421
+ readonly fieldId: import("@elaraai/east").StringType;
422
+ readonly op: import("@elaraai/east").VariantType<{
423
+ readonly eq: import("@elaraai/east").StringType;
424
+ readonly neq: import("@elaraai/east").StringType;
425
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
426
+ readonly notIn: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
427
+ readonly contains: import("@elaraai/east").StringType;
428
+ readonly matches: import("@elaraai/east").StringType;
429
+ }>;
430
+ }>;
431
+ readonly integer: import("@elaraai/east").StructType<{
432
+ readonly fieldId: import("@elaraai/east").StringType;
433
+ readonly op: import("@elaraai/east").VariantType<{
434
+ readonly eq: import("@elaraai/east").IntegerType;
435
+ readonly neq: import("@elaraai/east").IntegerType;
436
+ readonly lt: import("@elaraai/east").IntegerType;
437
+ readonly lte: import("@elaraai/east").IntegerType;
438
+ readonly gt: import("@elaraai/east").IntegerType;
439
+ readonly gte: import("@elaraai/east").IntegerType;
440
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").IntegerType>;
441
+ }>;
442
+ }>;
443
+ readonly float: import("@elaraai/east").StructType<{
444
+ readonly fieldId: import("@elaraai/east").StringType;
445
+ readonly op: import("@elaraai/east").VariantType<{
446
+ readonly lt: import("@elaraai/east").FloatType;
447
+ readonly lte: import("@elaraai/east").FloatType;
448
+ readonly gt: import("@elaraai/east").FloatType;
449
+ readonly gte: import("@elaraai/east").FloatType;
450
+ }>;
451
+ }>;
452
+ readonly datetime: import("@elaraai/east").StructType<{
453
+ readonly fieldId: import("@elaraai/east").StringType;
454
+ readonly op: import("@elaraai/east").VariantType<{
455
+ readonly before: import("@elaraai/east").DateTimeType;
456
+ readonly after: import("@elaraai/east").DateTimeType;
457
+ readonly between: import("@elaraai/east").StructType<{
458
+ readonly from: import("@elaraai/east").DateTimeType;
459
+ readonly to: import("@elaraai/east").DateTimeType;
460
+ }>;
461
+ }>;
462
+ }>;
463
+ readonly boolean: import("@elaraai/east").StructType<{
464
+ readonly fieldId: import("@elaraai/east").StringType;
465
+ readonly op: import("@elaraai/east").VariantType<{
466
+ readonly is: import("@elaraai/east").BooleanType;
467
+ }>;
468
+ }>;
469
+ }>>>;
470
+ readonly method: OptionType<VariantType<{
471
+ readonly linear_regression: NullType;
472
+ readonly propensity_score_weighting: StructType<{
473
+ readonly weighting_scheme: OptionType<VariantType<{
474
+ readonly ips_weight: NullType;
475
+ readonly ips_stabilized_weight: NullType;
476
+ readonly ips_normalized_weight: NullType;
477
+ }>>;
478
+ }>;
479
+ }>>;
480
+ readonly targetUnits: OptionType<VariantType<{
481
+ readonly ate: NullType;
482
+ readonly att: NullType;
483
+ readonly atc: NullType;
484
+ }>>;
485
+ readonly trim: OptionType<VariantType<{
486
+ readonly overlap: NullType;
487
+ readonly bounds: StructType<{
488
+ readonly lower: FloatType;
489
+ readonly upper: FloatType;
490
+ }>;
491
+ }>>;
492
+ }>;
493
+ readonly effect: FloatType;
494
+ readonly ci: OptionType<StructType<{
495
+ readonly lower: FloatType;
496
+ readonly upper: FloatType;
497
+ }>>;
498
+ readonly committedAt: DateTimeType;
499
+ readonly committedBy: StringType;
500
+ }>;
501
+ /** Type alias for {@link JournalRowType}. */
502
+ export type JournalRowType = typeof JournalRowType;
503
+ /** The journal dataset — committed experiments, newest first. */
504
+ export declare const JournalType: ArrayType<StructType<{
505
+ readonly spec: StructType<{
506
+ readonly treatment: StringType;
507
+ readonly outcome: StringType;
508
+ readonly confounders: ArrayType<StringType>;
509
+ readonly categorical: ArrayType<StringType>;
510
+ readonly population: OptionType<ArrayType<VariantType<{
511
+ readonly string: import("@elaraai/east").StructType<{
512
+ readonly fieldId: import("@elaraai/east").StringType;
513
+ readonly op: import("@elaraai/east").VariantType<{
514
+ readonly eq: import("@elaraai/east").StringType;
515
+ readonly neq: import("@elaraai/east").StringType;
516
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
517
+ readonly notIn: import("@elaraai/east").SetType<import("@elaraai/east").StringType>;
518
+ readonly contains: import("@elaraai/east").StringType;
519
+ readonly matches: import("@elaraai/east").StringType;
520
+ }>;
521
+ }>;
522
+ readonly integer: import("@elaraai/east").StructType<{
523
+ readonly fieldId: import("@elaraai/east").StringType;
524
+ readonly op: import("@elaraai/east").VariantType<{
525
+ readonly eq: import("@elaraai/east").IntegerType;
526
+ readonly neq: import("@elaraai/east").IntegerType;
527
+ readonly lt: import("@elaraai/east").IntegerType;
528
+ readonly lte: import("@elaraai/east").IntegerType;
529
+ readonly gt: import("@elaraai/east").IntegerType;
530
+ readonly gte: import("@elaraai/east").IntegerType;
531
+ readonly in: import("@elaraai/east").SetType<import("@elaraai/east").IntegerType>;
532
+ }>;
533
+ }>;
534
+ readonly float: import("@elaraai/east").StructType<{
535
+ readonly fieldId: import("@elaraai/east").StringType;
536
+ readonly op: import("@elaraai/east").VariantType<{
537
+ readonly lt: import("@elaraai/east").FloatType;
538
+ readonly lte: import("@elaraai/east").FloatType;
539
+ readonly gt: import("@elaraai/east").FloatType;
540
+ readonly gte: import("@elaraai/east").FloatType;
541
+ }>;
542
+ }>;
543
+ readonly datetime: import("@elaraai/east").StructType<{
544
+ readonly fieldId: import("@elaraai/east").StringType;
545
+ readonly op: import("@elaraai/east").VariantType<{
546
+ readonly before: import("@elaraai/east").DateTimeType;
547
+ readonly after: import("@elaraai/east").DateTimeType;
548
+ readonly between: import("@elaraai/east").StructType<{
549
+ readonly from: import("@elaraai/east").DateTimeType;
550
+ readonly to: import("@elaraai/east").DateTimeType;
551
+ }>;
552
+ }>;
553
+ }>;
554
+ readonly boolean: import("@elaraai/east").StructType<{
555
+ readonly fieldId: import("@elaraai/east").StringType;
556
+ readonly op: import("@elaraai/east").VariantType<{
557
+ readonly is: import("@elaraai/east").BooleanType;
558
+ }>;
559
+ }>;
560
+ }>>>;
561
+ readonly method: OptionType<VariantType<{
562
+ readonly linear_regression: NullType;
563
+ readonly propensity_score_weighting: StructType<{
564
+ readonly weighting_scheme: OptionType<VariantType<{
565
+ readonly ips_weight: NullType;
566
+ readonly ips_stabilized_weight: NullType;
567
+ readonly ips_normalized_weight: NullType;
568
+ }>>;
569
+ }>;
570
+ }>>;
571
+ readonly targetUnits: OptionType<VariantType<{
572
+ readonly ate: NullType;
573
+ readonly att: NullType;
574
+ readonly atc: NullType;
575
+ }>>;
576
+ readonly trim: OptionType<VariantType<{
577
+ readonly overlap: NullType;
578
+ readonly bounds: StructType<{
579
+ readonly lower: FloatType;
580
+ readonly upper: FloatType;
581
+ }>;
582
+ }>>;
583
+ }>;
584
+ readonly effect: FloatType;
585
+ readonly ci: OptionType<StructType<{
586
+ readonly lower: FloatType;
587
+ readonly upper: FloatType;
588
+ }>>;
589
+ readonly committedAt: DateTimeType;
590
+ readonly committedBy: StringType;
591
+ }>>;
592
+ /** Type alias for {@link JournalType}. */
593
+ export type JournalType = typeof JournalType;
594
+ /**
595
+ * Optional per-column metadata the developer supplies once. Lets the derived
596
+ * prose read "worse" instead of "lower" and show friendly labels / units.
597
+ * Keyed by column name.
598
+ *
599
+ * @property label - Friendly display label for the column.
600
+ * @property unit - Unit suffix ("MPa", "$", …).
601
+ * @property higherIsBetter - Whether a larger value is the good direction —
602
+ * flips "lower" → "worse" in the derived words.
603
+ */
604
+ export declare const ColumnMetaType: DictType<StringType, StructType<{
605
+ readonly label: OptionType<StringType>;
606
+ readonly unit: OptionType<StringType>;
607
+ readonly higherIsBetter: OptionType<BooleanType>;
608
+ }>>;
609
+ /** Type alias for {@link ColumnMetaType}. */
610
+ export type ColumnMetaType = typeof ColumnMetaType;
611
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/experiment/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EACH,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACb,MAAM,eAAe,CAAC;AAOvB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AACH,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC;AAE7D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;;;;;;EAKxB,CAAC;AACH,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;EAI1B,CAAC;AACH,8CAA8C;AAC9C,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;;;;;;EAMnB,CAAC;AACH,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AAMvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO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