@sheetxl/primitives 0.7.22 → 0.7.23-beta.2

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 (45) hide show
  1. package/browser/cjs/index.cjs +1 -6
  2. package/browser/esm/index.mjs +683 -307
  3. package/node/esm/index.mjs +684 -307
  4. package/package.json +1 -1
  5. package/types/index.d.ts +2 -1622
  6. package/types/src/ErrorPolicy.d.ts +78 -0
  7. package/types/src/ErrorPolicy.d.ts.map +1 -0
  8. package/types/src/Flatten.d.ts +34 -0
  9. package/types/src/Flatten.d.ts.map +1 -0
  10. package/types/src/FormulaContext.d.ts +227 -0
  11. package/types/src/FormulaContext.d.ts.map +1 -0
  12. package/types/src/FormulaError.d.ts +328 -0
  13. package/types/src/FormulaError.d.ts.map +1 -0
  14. package/types/src/IFormulaContext.d.ts +533 -0
  15. package/types/src/IFormulaContext.d.ts.map +1 -0
  16. package/types/src/IFunction.d.ts +608 -0
  17. package/types/src/IFunction.d.ts.map +1 -0
  18. package/types/src/IRange.d.ts +1091 -0
  19. package/types/src/IRange.d.ts.map +1 -0
  20. package/types/src/IRangeStats.d.ts +478 -0
  21. package/types/src/IRangeStats.d.ts.map +1 -0
  22. package/types/src/IReferenceRange.d.ts +22 -0
  23. package/types/src/IReferenceRange.d.ts.map +1 -0
  24. package/types/src/IRichData.d.ts +37 -0
  25. package/types/src/IRichData.d.ts.map +1 -0
  26. package/types/src/IRuntime.d.ts +65 -0
  27. package/types/src/IRuntime.d.ts.map +1 -0
  28. package/types/src/Lambda.d.ts +17 -0
  29. package/types/src/Lambda.d.ts.map +1 -0
  30. package/types/src/LocaleProfile.d.ts +79 -0
  31. package/types/src/LocaleProfile.d.ts.map +1 -0
  32. package/types/src/Observable.d.ts +46 -0
  33. package/types/src/Observable.d.ts.map +1 -0
  34. package/types/src/Omittable.d.ts +50 -0
  35. package/types/src/Omittable.d.ts.map +1 -0
  36. package/types/src/Repeating.d.ts +66 -0
  37. package/types/src/Repeating.d.ts.map +1 -0
  38. package/types/src/Scalar.d.ts +67 -0
  39. package/types/src/Scalar.d.ts.map +1 -0
  40. package/types/src/ScalarType.d.ts +109 -0
  41. package/types/src/ScalarType.d.ts.map +1 -0
  42. package/types/src/WildCard.d.ts +26 -0
  43. package/types/src/WildCard.d.ts.map +1 -0
  44. package/types/src/index.d.ts +20 -0
  45. package/types/src/index.d.ts.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRange.d.ts","sourceRoot":"","sources":["../../../src/IRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,MAAM,GAAC,MAAM;IAE7C;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,GACjB,MAAM,EAAE,CAAC;IAEZ;;;;;;;;;;;;OAYG;IACH,aAAa,CACX,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,EAClB,WAAW,CAAC,EAAE,OAAO,GACpB,MAAM,EAAE,CAAC;IAEZ;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,GAAC,CAAC,EAC3B,KAAK,EAAE,MAAM,GAAG,EAAE,EAClB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,E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pG;;;;;;;OAOG;IACH,KAAY,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC;IAE3E;;OAEG;IACH,UAAiB,kBAAkB,CAAC,CAAC,GAAC,GAAG;QACvC;;WAEG;QACH,CAAC,EAAE,UAAU,CAAC;QACd;;WAEG;QACH,CAAC,EAAE,CAAC,CAAA;KACL;IAED;;OAEG;IACH,KAAY,kBAAkB,CAAC,CAAC,GAAC,GAAG,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACtE;;;;OAIG;IACH,KAAY,aAAa,CAAC,CAAC,GAAC,GAAG,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAClF"}
@@ -0,0 +1,478 @@
1
+ import { IRange } from './IRange';
2
+ import { Scalar } from './Scalar';
3
+ import { ScalarType } from './ScalarType';
4
+ import { FormulaError } from './FormulaError';
5
+ /**
6
+ * Provides statistical summaries and queries over a range of cell values.
7
+ *
8
+ * @remarks
9
+ * Prefer `IRangeStats` over iterating cells manually when you need aggregate or order-statistic
10
+ * results. Implementations operate directly on the engine's internal value storage — no
11
+ * intermediate array allocation is needed for most operations — and results are cached per
12
+ * calculation cycle, so repeated calls within the same cycle are effectively free.
13
+ *
14
+ * This makes `IRangeStats` the right choice for:
15
+ * 1. Formula fast-path calculations (e.g. `SUM`, `LARGE`, `RANK`, `PERCENTILE`)
16
+ * 2. Status-bar aggregates (sum, count, average, min, max)
17
+ * 3. AutoFilter distinct-value dropdowns and filter-match lookups
18
+ * 4. Data-wrangling and profiling UIs
19
+ * 5. Quick introspection without triggering a full range scan
20
+ */
21
+ export interface IRangeStats {
22
+ /**
23
+ * Returns the total number of cells in the range, including empty cells.
24
+ *
25
+ * @remarks
26
+ * This is the raw cell count (rows × columns across all coords), not the count of populated
27
+ * values. To count only non-empty cells use `getCount()`. To count only numbers use
28
+ * `getAggregates().numericalCount`.
29
+ */
30
+ getSize(): number;
31
+ /**
32
+ * Returns the total count of non-empty values in the range.
33
+ *
34
+ * @remarks
35
+ * Counts all value types — numbers, strings, booleans, errors. Blank/empty cells are excluded.
36
+ * To count only numbers, use `getAggregates().numericalCount`.
37
+ *
38
+ * Never throws on error values — errors are population here, not faults — regardless of
39
+ * the `onError` iterator policy the stats were created with (same contract as
40
+ * {@link getTypedCounts}).
41
+ */
42
+ getCount(): number;
43
+ /**
44
+ * Returns common numeric summary statistics: sum, min, max, average, variance, stdDev.
45
+ *
46
+ * @param options Per-call overrides of the iterator options the stats were created with.
47
+ * The primary use is `{ onError: 'ignore' }` — reporting surfaces degrade (aggregate the
48
+ * numeric population, count the errors elsewhere) where the default `'throw'` policy treats
49
+ * an error value as a fault. Results for an options-carrying call are not cached on the
50
+ * instance; the shared segment cache still applies.
51
+ *
52
+ * @remarks
53
+ * All values in the result are composable: sub-range results can be merged without re-scanning
54
+ * the data, which makes this efficient even over very large ranges.
55
+ *
56
+ * Returns `null` for numeric fields when the range contains no numbers.
57
+ */
58
+ getAggregates(options?: IRange.IteratorOptions): Readonly<IRangeStats.Aggregates>;
59
+ /**
60
+ * Returns the sum as Excel's `SUM` reports it — {@link getAggregates}'s `sum` with Excel's
61
+ * cancellation-to-zero rule applied.
62
+ *
63
+ * @param total A total the caller accumulated across SEVERAL stats instances. Omit for a
64
+ * single range, where this range's own sum is used.
65
+ *
66
+ * @returns `0` when the total cancelled; otherwise the total unchanged.
67
+ *
68
+ * @remarks
69
+ * Collapses a total to exactly zero when it lands at least 50 binary exponents below the
70
+ * operands that produced it, so `SUM(0.1,0.2,-0.3)` is `0` rather than `5.55111512312578E-17`.
71
+ * Use this wherever you mean "the number Excel's SUM would show" — a status bar, a report
72
+ * total, a formula. Use `getAggregates().sum` where you mean the true total of the data.
73
+ *
74
+ * The two genuinely differ, and neither is a rounding of the other:
75
+ *
76
+ * - The rule is RELATIVE, never an absolute floor. `SUM(2E-13,-1E-13)` is `1E-13`.
77
+ * - It applies to `SUM`, `AVERAGE`, `AVERAGEA`, `SUBTOTAL(1|9|101|109)`, `AGGREGATE(1|9)`
78
+ * and `PERCENTOF`, and to NOTHING else — `SUMIF`, `SUMPRODUCT`, `SERIESSUM`, `DSUM`, the
79
+ * `SUMX2MY2` family and every binary operator all keep the residue over the same values.
80
+ * That is why this is a method you call and not a change to `getAggregates`.
81
+ * - `AVERAGE` divides THIS, not the raw sum: snapping the mean instead is measurably wrong.
82
+ *
83
+ * It is also cheap when it does not fire: a bound derived from `min`/`max` rejects any
84
+ * ordinary total without re-reading the range.
85
+ *
86
+ * **Multiple ranges.** Excel evaluates the rule on the *final* accumulation step, so a total
87
+ * spanning several ranges must be judged against the range holding the LAST value — pass the
88
+ * running total as `total` and call this on that range. (Snapping each range separately gets
89
+ * `SUM(A1:A3,0)` and `SUM(A1:A1,A2:A2,A3:A3)` wrong in opposite directions.) A composite
90
+ * stats instance already does this across its children.
91
+ */
92
+ getSnappedSum(total?: number): number;
93
+ /**
94
+ * Returns order-statistic queries over the numeric values in the range: percentiles, quartiles,
95
+ * rank, k-th largest/smallest, and binary search (floor/ceiling).
96
+ *
97
+ * @remarks
98
+ * Use this when the *position* of a value within the sorted population matters, not just its
99
+ * aggregate contribution.
100
+ *
101
+ * **Prefer this over `getRanked`** when working with numbers and you need an exact position
102
+ * (k-th value), interpolated quantile, or rank of a known value. Non-numeric values are
103
+ * excluded automatically.
104
+ *
105
+ * Also provides `findFloor` / `findCeiling` for binary-search lookups for numeric values.
106
+ */
107
+ getSortedNumbers(): IRangeStats.ISortedNumbers;
108
+ /**
109
+ * Returns the top-N values in the range as a lazily-evaluated iterator, with optional
110
+ * filtering, custom comparison, and deduplication.
111
+ *
112
+ * @remarks
113
+ * Use this when you need a *short list* of the highest or lowest values across any scalar type
114
+ * (numbers, strings, dates via custom `compareFn`), typically for display purposes such as
115
+ * StatusBar top-values, AutoFilter previews, or data-profiling UIs.
116
+ *
117
+ * **Prefer `getSortedNumbers`** when you need exact numeric rank, percentile, or a full
118
+ * sorted population — `getRanked` is not designed for whole-population order statistics.
119
+ * The key distinction: `getRanked` is *bounded* (limited output, any type);
120
+ * `getSortedNumbers` is *complete* (all numeric values, full sorted order).
121
+ */
122
+ getRanked(options?: IRangeStats.GetRankedOptions): IterableIterator<Scalar>;
123
+ /**
124
+ * Returns the distribution of distinct values in the range — how many times each unique
125
+ * value appears — along with unique-value enumeration and occurrence counts.
126
+ *
127
+ * @remarks
128
+ * Use this for filter dropdowns (AutoFilter distinct values), data-profiling summaries,
129
+ * pivot-like grouping, and any formula that needs `COUNTIF`-style frequency data
130
+ * (`MODE`, `FREQUENCY`). Provides pandas-like `value_counts()` behavior.
131
+ *
132
+ * For purely numeric summary statistics use `getAggregates()`.
133
+ * For sorted-order queries (rank, percentile) use `getSortedNumbers()`.
134
+ */
135
+ getFrequencies(options?: IRangeStats.GetFrequenciesOptions): IRangeStats.IFrequency;
136
+ /**
137
+ * Returns a breakdown of how many cells contain each native value type: number, string,
138
+ * boolean, error, rich data, and blank.
139
+ *
140
+ * @param types Restrict the result to only the specified types. Omit to count all types.
141
+ *
142
+ * @remarks
143
+ * Use this for data-profiling UIs ("this column has 420 numbers, 3 errors, 12 blanks"),
144
+ * schema inference, and formula validation helpers. Covers the native spreadsheet scalar
145
+ * types; does not distinguish semantic sub-types such as dates (which are stored as numbers).
146
+ *
147
+ * - Every requested type (all types when omitted) is present with an explicit count —
148
+ * a `0` is a fact about the range, a missing key would be ambiguous.
149
+ * - Blanks report under {@link ScalarType.Null}: total cells minus non-empty values.
150
+ * - Never throws on error values — errors are population here, not faults — regardless of
151
+ * the `onError` iterator policy the stats were created with.
152
+ */
153
+ getTypedCounts(types?: readonly ScalarType[]): {
154
+ [key in ScalarType]?: number;
155
+ };
156
+ /**
157
+ * For runtime type checking.
158
+ */
159
+ readonly isIRangeStats: true;
160
+ }
161
+ export declare namespace IRangeStats {
162
+ const Aggregate: {
163
+ /**
164
+ * A count of all non-empty values — numbers, strings, booleans, and errors.
165
+ *
166
+ * @remarks
167
+ * The same population as {@link IRangeStats.getCount}. For numbers only use
168
+ * {@link IRangeStats.Aggregate.NumericalCount}.
169
+ */
170
+ readonly Count: "count";
171
+ /**
172
+ * A count of number values.
173
+ */
174
+ readonly NumericalCount: "numericalCount";
175
+ /**
176
+ * The sum of numeric values.
177
+ */
178
+ readonly Sum: "sum";
179
+ /**
180
+ * The average of numeric values.
181
+ */
182
+ readonly Average: "average";
183
+ /**
184
+ * The standard deviation of numeric values.
185
+ */
186
+ readonly StdDev: "stdDev";
187
+ /**
188
+ * The standard deviation of the entire population of numeric values.
189
+ */
190
+ readonly PopulationStdDev: "stdDevP";
191
+ /**
192
+ * The variance of numeric values.
193
+ */
194
+ readonly Variance: "var";
195
+ /**
196
+ * The variance of the entire population of numeric values.
197
+ */
198
+ readonly PopulationVariance: "varP";
199
+ /**
200
+ * The minimum numeric value.
201
+ */
202
+ readonly Min: "min";
203
+ /**
204
+ * The maximum numeric value.
205
+ */
206
+ readonly Max: "max";
207
+ };
208
+ type Aggregate = typeof Aggregate[keyof typeof Aggregate];
209
+ /**
210
+ * Contains the numeric aggregate results.
211
+ *
212
+ * @remarks
213
+ * Every {@link IRangeStats.Aggregate} key is always present — a `0` count or a `null`
214
+ * numeric field is a fact about the range; a missing key would be ambiguous (the same
215
+ * contract as {@link IRangeStats.getTypedCounts}).
216
+ *
217
+ * A numeric field is `null` when no numbers were encountered; `var`/`stdDev` additionally
218
+ * require at least 2 numbers. The two counts are never `null`.
219
+ */
220
+ type Aggregates = {
221
+ [K in Exclude<IRangeStats.Aggregate, 'count' | 'numericalCount'>]: number | null;
222
+ } & {
223
+ count: number;
224
+ numericalCount: number;
225
+ };
226
+ /**
227
+ * Returns sorted numeric values in a range.
228
+ *
229
+ * @remarks
230
+ * Sorting requires materializing the full numeric population (O(n log n), one allocation).
231
+ * Unlike `Aggregates`, sorted views are **not composable across sub-ranges**.
232
+ *
233
+ * Covers the following Excel functions (all share one sort per coords per calc cycle):
234
+ * - `LARGE`, `SMALL`
235
+ * - `MEDIAN`, `PERCENTILE`, `PERCENTILE.INC`, `PERCENTILE.EXC`
236
+ * - `QUARTILE`, `QUARTILE.INC`, `QUARTILE.EXC` (q1 = k=0.25, q3 = k=0.75)
237
+ * - `RANK`, `RANK.EQ`, `RANK.AVG`
238
+ * - `PERCENTRANK`, `PERCENTRANK.INC`, `PERCENTRANK.EXC`
239
+ * - `MATCH type 1/-1`, `VLOOKUP sorted`, `XLOOKUP` (via `findFloor`/`findCeiling`)
240
+ */
241
+ interface ISortedNumbers {
242
+ /**
243
+ * Returns the k-th largest numeric value (1-based).
244
+ *
245
+ * @param k The rank of the value to return, where 1 is the largest value. Must be a positive integer.
246
+ * @returns `null` if k is out of range.
247
+ *
248
+ * @remarks
249
+ * Equivalent to Excel `LARGE(array, k)`.
250
+ */
251
+ getLarge(k: number): number | null;
252
+ /**
253
+ * Returns the k-th smallest numeric value (1-based).
254
+ *
255
+ * @param k The rank of the value to return, where 1 is the smallest value. Must be a positive integer.
256
+ * @returns `null` if k is out of range.
257
+ *
258
+ * @remarks
259
+ * Equivalent to Excel `SMALL(array, k)`.
260
+ */
261
+ getSmall(k: number): number | null;
262
+ /**
263
+ * Returns the value at quantile k.
264
+ *
265
+ * @param k Quantile in [0, 1] inclusive (or (0, 1) exclusive). Maps directly to Excel's k parameter.
266
+ * - k=0.5 → `MEDIAN`
267
+ * - k=0.25 → Q1 (`QUARTILE` quart=1)
268
+ * - k=0.75 → Q3 (`QUARTILE` quart=3)
269
+ * @param exclusive If true, uses the exclusive interpolation formula (PERCENTILE.EXC / QUARTILE.EXC).
270
+ * @returns The value at the specified quantile, or `null` if k is out of range or no numbers in range.
271
+ *
272
+ * @remarks
273
+ * Equivalent to Excel `PERCENTILE.INC` (exclusive=false) or `PERCENTILE.EXC` (exclusive=true).
274
+ */
275
+ getPercentile(k: number, exclusive?: boolean): number | null;
276
+ /**
277
+ * Returns the rank of value x in the sorted population (1-based, descending by default).
278
+ *
279
+ * @param x The value whose rank to find.
280
+ * @param descending If true (default), rank 1 = largest. If false, rank 1 = smallest.
281
+ * @param average If true, tied values receive the average of their rank positions (RANK.AVG).
282
+ * @returns The rank of x, or `null` if x is not found or no numbers in range.
283
+ *
284
+ * @remarks
285
+ * Equivalent to Excel `RANK.EQ` (average=false) or `RANK.AVG` (average=true).
286
+ */
287
+ getRankOf(x: number, descending?: boolean, average?: boolean): number | null;
288
+ /**
289
+ * Returns the fractional rank of value x as a value in [0, 1].
290
+ *
291
+ * @param x The value whose percent rank to find. A value between two members is interpolated;
292
+ * one outside the population is not found.
293
+ * @param exclusive If true, uses exclusive formula (0 and 1 are excluded).
294
+ * @param significance Number of DECIMAL PLACES to TRUNCATE the result to — despite what
295
+ * Excel's own help calls the argument, it is not significant digits and it does not round.
296
+ * Truncated toward zero first (1.9 places means 1), and must be at least 1. Omit it for the
297
+ * exact untruncated rank, which is also the only form that cannot fail.
298
+ * @returns The percent rank of x; `null` if x is not found or there are no numbers in range.
299
+ */
300
+ getPercentRankOf(x: number, exclusive?: boolean, significance?: number): number | FormulaError.Known | null;
301
+ /**
302
+ * Returns all numeric values in the range, sorted ascending.
303
+ */
304
+ getValues(): readonly number[];
305
+ /**
306
+ * Binary search: returns the largest value ≤ x, or `null` if none exists.
307
+ *
308
+ * @param x The value to search for.
309
+ *
310
+ * @remarks
311
+ * Used by `MATCH type 1` and `VLOOKUP sorted=true` (approximate match, sorted ascending).
312
+ */
313
+ findFloor(x: number): number | null;
314
+ /**
315
+ * Binary search: returns the smallest value ≥ x, or `null` if none exists.
316
+ *
317
+ * @param x The value to search for.
318
+ *
319
+ * @remarks
320
+ * Used by `MATCH type -1` (sorted descending approximate match).
321
+ */
322
+ findCeiling(x: number): number | null;
323
+ }
324
+ /**
325
+ * Options for finding frequency statistics in a range.
326
+ *
327
+ */
328
+ interface GetFrequenciesOptions {
329
+ /**
330
+ * The maximum distinct values to count.
331
+ *
332
+ * @defaultValue No limit
333
+ */
334
+ limit?: number;
335
+ /**
336
+ * If `true` blank will be given its own distinct count.
337
+ *
338
+ * @defaultValue `false`
339
+ */
340
+ includeBlanks?: boolean;
341
+ /**
342
+ * Custom function to define distinctness.
343
+ *
344
+ * @defaultValue Uses internal canonicalization (type + value comparison)
345
+ */
346
+ keyFn?: (v: Scalar) => string | number;
347
+ /**
348
+ * Custom comparison used for ordering results (e.g. for UI display).
349
+ *
350
+ * @defaultValue Internal default comparison
351
+ */
352
+ compareFn?: (a: Scalar, b: Scalar) => number;
353
+ /**
354
+ * If `true` the ordering is reversed.
355
+ *
356
+ * @defaultValue `false`
357
+ */
358
+ reverse?: boolean;
359
+ /**
360
+ * Optionally restricts the population (e.g. numbers only).
361
+ */
362
+ filterFn?: (v: Scalar) => boolean;
363
+ }
364
+ /**
365
+ * Frequency distribution results for a range.
366
+ *
367
+ * @remarks Provides pandas-like value_counts() functionality.
368
+ */
369
+ interface IFrequency {
370
+ /**
371
+ * Returns an iterator of distinct values found (respecting options).
372
+ *
373
+ * @remarks Iterator can be consumed only once.
374
+ *
375
+ * Example:
376
+ * Data: ["Red", "Red", "Red", "Blue", "Blue", "Green"]
377
+ * getUniqueValues() -> Iterator("Red", "Blue", "Green")
378
+ */
379
+ getUniqueValues(): IterableIterator<Scalar>;
380
+ /**
381
+ * Returns the frequency (occurrence count) of a specific value.
382
+ *
383
+ * @param value The value to look up
384
+ * @returns Number of times the value appears, or 0 if not found
385
+ */
386
+ getFrequency(value: Scalar): number;
387
+ /**
388
+ * Returns unique values with their frequencies as an iterator.
389
+ *
390
+ * @param options.sortBy How to sort results
391
+ * @param options.descending Sort direction
392
+ * @returns Iterator of [value, count] tuples, sorted by frequency (descending) by default
393
+ *
394
+ * @remarks
395
+ * - First item is the mode (most frequent value)
396
+ * - Values of equal count hold the order they were first seen
397
+ * - Matches pandas value_counts() behavior
398
+ * - Iterator can be consumed only once
399
+ *
400
+ * @example
401
+ * ```typescript
402
+ * // Get mode (most common)
403
+ * const [mode, count] = stats.getValueCounts().next().value;
404
+ *
405
+ * // Get top 3
406
+ * const top3 = Array.from(stats.getValueCounts()).slice(0, 3);
407
+ *
408
+ * // All values for dropdown
409
+ * const all = Array.from(stats.getValueCounts());
410
+ * ```
411
+ */
412
+ getValueCounts(options?: {
413
+ sortBy?: 'value' | 'frequency';
414
+ descending?: boolean;
415
+ }): IterableIterator<[Scalar, number]>;
416
+ /**
417
+ * Total count of distinct values in the range (respecting options).
418
+ */
419
+ getUniqueCount(): number;
420
+ /**
421
+ * Number of cells visited in the source range iteration.
422
+ *
423
+ * @remarks May be less than total range size if `limit` was hit.
424
+ */
425
+ getVisitedCount(): number;
426
+ /**
427
+ * Total count of values in the range (respecting options).
428
+ */
429
+ getTotalCount(): number;
430
+ /**
431
+ * Indicates if results were truncated due to the `limit` option.
432
+ *
433
+ * @remarks When `true`, there may be additional distinct values that weren't counted.
434
+ * This is a convenience method (visitedCount < totalCount)
435
+ */
436
+ isTruncated(): boolean;
437
+ }
438
+ /**
439
+ * Options for finding top values in a range.
440
+ */
441
+ interface GetRankedOptions {
442
+ /**
443
+ * Maximum number of values to return.
444
+ *
445
+ * @defaultValue `10`
446
+ */
447
+ limit?: number;
448
+ /**
449
+ * If `true` blank will be considered when ordering.
450
+ *
451
+ * @defaultValue `false`
452
+ */
453
+ includeBlanks?: boolean;
454
+ /**
455
+ * If `true` duplicate values collapse to a single entry.
456
+ *
457
+ * @defaultValue `false`
458
+ */
459
+ distinct?: boolean;
460
+ /**
461
+ * Custom comparison used for ordering results (e.g. for UI display).
462
+ *
463
+ * @defaultValue Internal default comparison
464
+ */
465
+ compareFn?: (a: Scalar, b: Scalar) => number;
466
+ /**
467
+ * If `true` the ordering is reversed (lowest values first).
468
+ *
469
+ * @defaultValue `false`
470
+ */
471
+ reverse?: boolean;
472
+ /**
473
+ * Optionally restricts the population (e.g. numbers only).
474
+ */
475
+ filterFn?: (v: Scalar) => boolean;
476
+ }
477
+ }
478
+ //# sourceMappingURL=IRangeStats.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;OAEG;IAEH,UAAiB,gBAAgB;QAC/B;;;;WAIG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;;;WAIG;QAEH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;QAC7C;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;WAEG;QACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;KACnC;CACF"}
@@ -0,0 +1,22 @@
1
+ import { Scalar } from './Scalar';
2
+ import { IRange } from './IRange';
3
+ /**
4
+ * A reference range is a range that also has coordinates.
5
+ *
6
+ * @remarks
7
+ * IReferenceRange can be used in functions that need ranges with coordinates.
8
+ * Work example (e.g. INDEX, OFFSET, etc).
9
+ * * Returning an IReferenceRange will create a dynamic dependency that will
10
+ * call the function if the data at those bounds are updated. This should be used sparingly.
11
+ */
12
+ export interface IReferenceRange<T extends Scalar = Scalar> extends IRange<T> {
13
+ /**
14
+ * Adds coordinates to a range reference.
15
+ */
16
+ getCoords(): Readonly<IRange.Coords>;
17
+ /**
18
+ * For runtime type checking.
19
+ */
20
+ get isIReferenceRange(): true;
21
+ }
22
+ //# sourceMappingURL=IReferenceRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IReferenceRange.d.ts","sourceRoot":"","sources":["../../../src/IReferenceRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAC,MAAM,CAAE,SAAQ,MAAM,CAAC,CAAC,CAAC;IACzE;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC;;OAEG;IACH,IAAI,iBAAiB,IAAI,IAAI,CAAC;CAC/B"}
@@ -0,0 +1,37 @@
1
+ import { Scalar } from './Scalar';
2
+ /**
3
+ * A complex object type. This allows for more complex data types to be stored in a cell.
4
+ */
5
+ export interface IRichData {
6
+ /**
7
+ * Reference to either a known typename or a JSON Type Definition.
8
+ * * {@link https://jsontypedef.com/}
9
+ */
10
+ getType(): string;
11
+ /**
12
+ * @param name The name of the property to retrieve.
13
+ */
14
+ getProperty(name: string): Scalar;
15
+ /**
16
+ * For clients that don't support IRichData.
17
+ *
18
+ * @remarks
19
+ * `toString()` can used when a Rich Data is not supported for example clipboard and sorting.
20
+ */
21
+ toString(): string;
22
+ /**
23
+ * Indicates this is an IRichData type.
24
+ */
25
+ toJSON?(): IRichData.JSON | Promise<IRichData.JSON>;
26
+ /**
27
+ * For runtime type checking.
28
+ */
29
+ get isIRichData(): true;
30
+ }
31
+ export declare namespace IRichData {
32
+ interface JSON {
33
+ type: string;
34
+ data?: any;
35
+ }
36
+ }
37
+ //# sourceMappingURL=IRichData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRichData.d.ts","sourceRoot":"","sources":["../../../src/IRichData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IAEH,OAAO,IAAI,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACpD;;OAEG;IACH,IAAI,WAAW,IAAI,IAAI,CAAC;CACzB;AAED,yBAAiB,SAAS,CAAC;IACzB,UAAiB,IAAI;QACnB,IAAI,EAAE,MAAM,CAAC;QAGb,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ;CACF"}
@@ -0,0 +1,65 @@
1
+ import { LocaleProfile } from './LocaleProfile';
2
+ /**
3
+ * Describes the host environment the calculation engine is running in.
4
+ *
5
+ * Accessible via `FormulaContext.getRuntime()`, this is primarily used by
6
+ * built-in functions that need to adapt to locale, date system, or platform
7
+ * (e.g. `INFO`, `TEXT`, date parsing). Most formula authors will not need it
8
+ * directly.
9
+ */
10
+ export interface IRuntime {
11
+ /**
12
+ * Returns a description of the runtime environment.
13
+ */
14
+ getDescription(): string;
15
+ /**
16
+ * The version of the runtime, e.g. "1.0.0".
17
+ */
18
+ getVersion(): string;
19
+ /**
20
+ * Returns the locale of the runtime, e.g. "en-US".
21
+ *
22
+ * @remarks
23
+ * This is the single authority for regional behavior (number/date formatting
24
+ * and parsing, separators, collation). For a workbook-owned runtime this
25
+ * resolves to the workbook's persisted locale.
26
+ */
27
+ getLocale(): string;
28
+ /**
29
+ * Returns true if the date calculation is using the 1904 date system.
30
+ */
31
+ isDate1904(): boolean;
32
+ /**
33
+ * If the primary address scheme is R1C1, returns true. Otherwise, returns false.
34
+ */
35
+ isR1C1(): boolean;
36
+ /**
37
+ * Returns the resolved regional behavior for {@link IRuntime.getLocale}.
38
+ *
39
+ * @remarks
40
+ * Separators, currency, date patterns, and collation all come from here --
41
+ * this is the single source of truth, so never derive them independently.
42
+ *
43
+ * Takes no argument by design: it answers "what is *this* runtime's locale".
44
+ * To build a profile for some other tag, use `getLocaleProfile(tag)` from
45
+ * `@sheetxl/sdk`.
46
+ */
47
+ getLocaleProfile(): LocaleProfile;
48
+ /**
49
+ * The location of the runtime, e.g. "browser", "node", etc.
50
+ */
51
+ getLocation(): string;
52
+ /**
53
+ * Returns the OS string of the runtime.
54
+ */
55
+ getOS(): string;
56
+ /**
57
+ * Returns the current timestamp as a serialized number.
58
+ */
59
+ getNow: () => number;
60
+ /**
61
+ * Returns the current user or `null` if no user information is provided.
62
+ */
63
+ getUser(): string | null;
64
+ }
65
+ //# sourceMappingURL=IRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRuntime.d.ts","sourceRoot":"","sources":["../../../src/IRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,cAAc,IAAI,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,IAAI,MAAM,CAAC;IAErB;;;;;;;OAOG;IACH,SAAS,IAAI,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC;IAEtB;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC;IAElB;;;;;;;;;;OAUG;IACH,gBAAgB,IAAI,aAAa,CAAC;IAElC;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,IAAI,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC;CAC1B"}
@@ -0,0 +1,17 @@
1
+ import { Scalar } from './Scalar';
2
+ /**
3
+ * A function value, equivalent to Excel's LAMBDA — the type of a lambda-consuming
4
+ * parameter (`BYROW`'s `fn`) and of the value `LAMBDA` itself returns.
5
+ *
6
+ * The first type argument is the parameter list as a tuple, the second is the return type:
7
+ *
8
+ * - `Lambda<[accumulator: Scalar, value: Scalar], Scalar>` — a `REDUCE`/`SCAN` accumulator.
9
+ * - `Lambda<[row: IRange], Scalar>` — `BYROW`'s one-parameter lambda.
10
+ * - `Lambda<[rowIndex: number, colIndex: number], Scalar>` — `MAKEARRAY`'s builder.
11
+ * - `Lambda<Scalar[], Scalar>` — variadic, when the arity is decided per call (`MAP`).
12
+ *
13
+ * @typeParam Args The parameter tuple. Defaults to variadic scalars.
14
+ * @typeParam R The return type. Defaults to `Scalar`.
15
+ */
16
+ export type Lambda<Args extends readonly any[] = Scalar[], R = Scalar> = (...args: Args) => R;
17
+ //# sourceMappingURL=Lambda.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lambda.d.ts","sourceRoot":"","sources":["../../../src/Lambda.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,MAAM,CAAC,IAAI,SAAS,SAAS,GAAG,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC"}