databonk 0.0.4 → 0.2.0

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/README.md +491 -96
  2. package/dist/dataframe-BggBYXYm.d.cts +886 -0
  3. package/dist/dataframe-BggBYXYm.d.ts +886 -0
  4. package/dist/index.cjs +5 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +366 -0
  7. package/dist/index.d.ts +354 -31
  8. package/dist/index.js +4 -40
  9. package/dist/index.js.map +1 -1
  10. package/dist/parallel-fv5h4BkA.d.cts +152 -0
  11. package/dist/parallel-fv5h4BkA.d.ts +152 -0
  12. package/dist/parquet.cjs +3 -0
  13. package/dist/parquet.cjs.map +1 -0
  14. package/dist/parquet.d.cts +57 -0
  15. package/dist/parquet.d.ts +57 -0
  16. package/dist/parquet.js +3 -0
  17. package/dist/parquet.js.map +1 -0
  18. package/dist/scalar.wasm +0 -0
  19. package/dist/simd-threads.wasm +0 -0
  20. package/dist/simd.wasm +0 -0
  21. package/dist/workers.cjs +102 -0
  22. package/dist/workers.cjs.map +1 -0
  23. package/dist/workers.d.cts +74 -0
  24. package/dist/workers.d.ts +74 -0
  25. package/dist/workers.js +102 -0
  26. package/dist/workers.js.map +1 -0
  27. package/package.json +93 -32
  28. package/build/release.d.ts +0 -719
  29. package/build/release.js +0 -774
  30. package/build/release.wasm +0 -0
  31. package/build/release.wasm.map +0 -1
  32. package/build/release.wat +0 -22633
  33. package/dist/dataframe.d.ts +0 -82
  34. package/dist/dataframe.d.ts.map +0 -1
  35. package/dist/dataframe.js +0 -318
  36. package/dist/dataframe.js.map +0 -1
  37. package/dist/index.d.ts.map +0 -1
  38. package/dist/loader.d.ts +0 -86
  39. package/dist/loader.d.ts.map +0 -1
  40. package/dist/loader.js +0 -147
  41. package/dist/loader.js.map +0 -1
  42. package/dist/shared-memory.d.ts +0 -64
  43. package/dist/shared-memory.d.ts.map +0 -1
  44. package/dist/shared-memory.js +0 -113
  45. package/dist/shared-memory.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,43 +1,366 @@
1
+ import { D as DType, C as Column, a as Cell, E as Expr, F as FrameView, b as DfRuntime, c as DataFrame, d as FrameOptions } from './dataframe-BggBYXYm.js';
2
+ export { A as AggName, e as AggOp, f as AggRequest, g as AggSpec, h as ArithOp, B as BoolOp, i as ColumnBuffer, j as ColumnInput, k as ColumnView, l as CompareOp, m as DTYPES, n as DTypeInfo, o as DictUnifyResult, p as Dictionary, q as ExprLike, r as ExprNode, s as FrameWasm, G as GroupBy, t as GroupBySource, J as JoinHow, u as JoinOptions, v as JoinSource, K as KernelFn, w as KernelWasm, L as LoadOptions, M as MemoryContext, N as NamedColumn, R as Row, x as RowCursor, S as ScalarValue, y as Schema, z as Series, H as SortOptions, T as TExpr, I as TypedArrayCtor, V as ViewDType, O as ViewOf, W as WasmExports, P as WasmMemoryModule, Q as WithColumnOptions, U as aggResult, X as callKernel, Y as col, Z as columnToArray, _ as createColumn, $ as createMemoryContext, a0 as createViewOf, a1 as decodeDictionary, a2 as decodeSlot, a3 as decodeStats, a4 as defaultRuntime, a5 as detectSimd, a6 as dtypeInfo, a7 as freeColumn, a8 as freeDictionary, a9 as inferType, aa as init, ab as lit, ac as loadRuntime, ad as loadWasmModule, ae as resolve, af as runtimeFromExports, ag as schemaOf, ah as scope, ai as sliceColumn, aj as toExpr, ak as unifyDictionaries, al as useRuntime, am as writeDictionary } from './dataframe-BggBYXYm.js';
3
+ export { T as ThreadsConfig, a as ThreadsHandle } from './parallel-fv5h4BkA.js';
4
+
1
5
  /**
2
- * Databonk - High-performance DataFrame library
6
+ * Arrow validity-bitmap helpers (ABI §4.1): **LSB-first, `1 = valid`, `0 = null`**.
3
7
  *
4
- * A DataFrame library built with AssemblyScript and WASM,
5
- * featuring SIMD acceleration and SharedArrayBuffer support
6
- * for zero-copy data access.
8
+ * A bitmap is `ceil(len / 8)` bytes; element `i` is valid iff
9
+ * `bitmap[i >> 3] & (1 << (i & 7))` is nonzero. Bits past `len` in the final byte
10
+ * are padding and are written `0` (kernels must not depend on them). These helpers
11
+ * operate on a `Uint8Array` view obtained through `viewOf` — never a cached view.
12
+ *
13
+ * NOTE ON SLICES: a sliced column shares its parent's bitmap and reads it at a
14
+ * *bit offset* (`Column.validityBitOffset`). Callers pass `bitOffset + i` here, so
15
+ * these primitives stay offset-agnostic (`i` is an absolute bit index).
16
+ */
17
+ /** Bytes needed for a `len`-bit validity bitmap: `ceil(len / 8)`. */
18
+ declare function validityBytes(len: number): number;
19
+ /** True iff bit `i` is set (element valid) in an LSB-first bitmap. */
20
+ declare function getBit(bitmap: Uint8Array, i: number): boolean;
21
+ /** Set bit `i` (mark element valid). */
22
+ declare function setBit(bitmap: Uint8Array, i: number): void;
23
+ /** Clear bit `i` (mark element null). */
24
+ declare function clearBit(bitmap: Uint8Array, i: number): void;
25
+
26
+ /**
27
+ * Expression-layer errors (Phase 3, P3.1). Spec §4 ergonomics: dtype mismatches
28
+ * name **both** dtypes and the operation; unknown column names suggest the nearest
29
+ * match. All expression-time failures are {@link ExprError} so the frame layer can
30
+ * catch and re-surface them uniformly.
31
+ */
32
+
33
+ /** Base class for every expression compile/eval error. */
34
+ declare class ExprError extends Error {
35
+ constructor(message: string);
36
+ }
37
+ /**
38
+ * A binary op was handed two dtypes it cannot combine (dtypes.md §3.1: only
39
+ * int→float widening is implicit). Message names both dtypes and the op.
40
+ */
41
+ declare function dtypeMismatch(op: string, left: DType, right: DType, hint?: string): ExprError;
42
+ /** An op was applied to a dtype it does not support at all (e.g. arithmetic on utf8). */
43
+ declare function unsupportedDtype(op: string, dtype: DType, hint?: string): ExprError;
44
+ /** A cast that is not in the v1 matrix (dtypes.md §2, the ✗ cells). */
45
+ declare function unsupportedCast(from: DType, to: DType): ExprError;
46
+ /** Column `name` was not found; suggest the closest known column if any. */
47
+ declare function unknownColumn(name: string, known: readonly string[]): ExprError;
48
+ /** A literal value's JS type does not match the dtype it must adopt. */
49
+ declare function badLiteral(value: unknown, dtype: DType, op: string): ExprError;
50
+ /** Closest known name to `name` within a small edit distance, else `null`. */
51
+ declare function nearest(name: string, known: readonly string[]): string | null;
52
+
53
+ /**
54
+ * Compiler runtime (Phase 3, P3.1 deliverable §3 buffer lifecycle).
55
+ *
56
+ * A {@link Runtime} wraps a {@link FrameView}'s memory context + kernel exports and
57
+ * is the single owner of every **temporary** the compiler allocates. It:
58
+ *
59
+ * - allocates/free's through the arena, tracking live temp pointers so the plan
60
+ * leaves **zero** leaked buffers (verified against the arena high-water / free
61
+ * balance in the leak tests),
62
+ * - dispatches kernels by ABI name (ABI §6) and records an ordered {@link Trace}
63
+ * of kernel calls + allocations so fusion is verifiable by plan inspection,
64
+ * - hands out `viewOf` views (never cached — ADR-001).
65
+ *
66
+ * Ownership model: a pointer is in {@link Runtime.owned} iff the runtime allocated it
67
+ * and has neither freed nor *transferred* it. Source-column buffers are never owned.
68
+ * At the end of a plan the result's buffers are transferred out; everything else is
69
+ * freed.
70
+ */
71
+
72
+ /** Derived, test-friendly counters over a {@link Trace}. */
73
+ interface ExecStats {
74
+ /** Total kernel invocations. */
75
+ readonly kernelCalls: number;
76
+ /** Kernel names in call order. */
77
+ readonly kernels: readonly string[];
78
+ /** Total temp allocations. */
79
+ readonly allocations: number;
80
+ /** Data-buffer allocations only (the elementwise-fusion metric). */
81
+ readonly dataAllocations: number;
82
+ /** Mask-buffer allocations only (the compare→filter fusion metric). */
83
+ readonly maskAllocations: number;
84
+ /** Free calls issued. */
85
+ readonly frees: number;
86
+ }
87
+
88
+ /**
89
+ * Expression compiler + executor (Phase 3, P3.1 deliverables §3/§4).
90
+ *
91
+ * `compile(expr, frame)` type-checks (`./dtypes.ts`) then lowers the typed IR to an
92
+ * ordered sequence of Phase-2 kernel calls over the frame's {@link Column}s, and runs
93
+ * it. `compileFilter(predicate, frame)` produces a reusable {@link Selection} for the
94
+ * `df.filter` path.
95
+ *
96
+ * ## Validity handling (dtypes.md §5)
97
+ * Elementwise arithmetic/comparison kernels are data-only; null propagation is a
98
+ * separate `validity_and` / unary copy. Integer `div`/`mod` additionally null out
99
+ * zero-divisor rows (dtypes.md §3.2) via a `divisor != 0` mask AND'd into validity —
100
+ * the data-only kernels cannot express that themselves.
101
+ *
102
+ * ## Fusion (spec P3.1)
103
+ * - **compare → filter**: a comparison lowers straight to a 1-bit mask that `filter`
104
+ * consumes; no bool column is materialised (see {@link compileFilter} /
105
+ * {@link Selection.compact}). One mask, one compaction per column.
106
+ * - **elementwise chains**: an op whose operand is an *owned* temp writes its output
107
+ * **in place** into that buffer, so a linear chain reuses ONE data buffer instead
108
+ * of allocating one per node (see {@link Runtime}).
109
+ *
110
+ * ## Buffer lifecycle
111
+ * Every temporary is owned by the {@link Runtime}; the result's buffers are transferred
112
+ * out (fully owned by the returned {@link Column}) and everything else is freed — no
113
+ * leaks (verified against arena stats in the leak tests).
114
+ */
115
+
116
+ /** Whether a compiled expression yields a column or a single scalar (aggregation). */
117
+ type ResultKind = 'column' | 'scalar';
118
+ /** A scalar (aggregation) result. */
119
+ interface ScalarResult {
120
+ readonly value: Cell;
121
+ readonly dtype: DType;
122
+ }
123
+ /** The outcome of {@link CompiledPlan.execute}. */
124
+ interface PlanResult {
125
+ readonly kind: ResultKind;
126
+ /** Present iff `kind === 'column'`. Caller owns it — free via `freeColumn`. */
127
+ readonly column?: Column;
128
+ /** Present iff `kind === 'scalar'`. */
129
+ readonly scalar?: ScalarResult;
130
+ /** Kernel-call + allocation counters for the run (plan inspection). */
131
+ readonly stats: ExecStats;
132
+ }
133
+ /** A type-checked, ready-to-run expression. */
134
+ interface CompiledPlan {
135
+ /** Result dtype (`'bool'` for predicates; the scalar dtype for aggregations). */
136
+ readonly dtype: DType;
137
+ /** Whether {@link execute} yields a column or a scalar. */
138
+ readonly resultKind: ResultKind;
139
+ /** Run the plan over the bound frame, returning the result + stats. */
140
+ execute(): PlanResult;
141
+ }
142
+ /**
143
+ * Type-check `expr` against `frame` and bind it for execution. Throws
144
+ * {@link ExprError} on any dtype/column error (before running anything).
145
+ */
146
+ declare function compile(expr: Expr, frame: FrameView): CompiledPlan;
147
+ /**
148
+ * A compiled selection over a frame: the effective row mask plus a `compact` that
149
+ * materialises the kept rows of any column. Fusion (a): a bare comparison predicate
150
+ * lowers to ONE mask; each `compact` is ONE `filter` kernel — no bool column.
151
+ */
152
+ interface Selection {
153
+ /** Number of selected rows. */
154
+ readonly count: number;
155
+ /** Compact `col` to the selected rows (caller owns the result — `freeColumn`). */
156
+ compact(col: Column): Column;
157
+ /** Release the mask + scratch. Call once after all `compact`s. */
158
+ free(): void;
159
+ /** Live kernel/alloc counters (accumulates across `compact` calls). */
160
+ readonly stats: ExecStats;
161
+ }
162
+ /** A type-checked predicate ready to produce a {@link Selection}. */
163
+ interface CompiledFilter {
164
+ execute(): Selection;
165
+ }
166
+ /**
167
+ * Type-check `predicate` (must be boolean) and bind it as a filter. The `df.filter`
168
+ * path calls `execute()` once, then `compact`s each surviving column.
169
+ */
170
+ declare function compileFilter(predicate: Expr, frame: FrameView): CompiledFilter;
171
+
172
+ /** Frame-layer errors (spec §4): unknown column suggests the nearest name (shared
173
+ * Levenshtein), dtype mismatch names both dtypes + the op. FrameError extends Error. */
174
+
175
+ declare class FrameError extends Error {
176
+ constructor(message: string);
177
+ }
178
+
179
+ /**
180
+ * RFC-4180 CSV parser with typed column inference.
181
+ *
182
+ * Key features:
183
+ * - Quoted fields, escaped quotes (""), embedded newlines and delimiters.
184
+ * - CRLF and bare LF line endings; lone CR treated as data.
185
+ * - Streaming-friendly internal design: `ChunkParser` is a stateful, chunk-fed
186
+ * parser (feed(s)/finish()). `fromCSV` drives it synchronously over the full text.
187
+ * ReadableStream adapter is a v2 nice-to-have (see ponytail note below).
188
+ *
189
+ * Type inference ladder (applied column-by-column over a sample of up to
190
+ * `INFER_ROWS` rows after null-value stripping):
191
+ *
192
+ * 1. i32 — integer in [-(2^31), 2^31-1], no decimal point, no exponent.
193
+ * 2. i64 — integer text exceeding Number.MAX_SAFE_INTEGER (|x| > 2^53-1, per ADR-009).
194
+ * Promotes when any non-null cell is a valid strict-integer string whose
195
+ * absolute value is above 9_007_199_254_740_991 (2^53−1) but within i64 range.
196
+ * Once promoted, the column stays i64 even if later cells are in safe range.
197
+ * Cells whose BigInt value overflows i64 → utf8 fallback.
198
+ * 3. f64 — any string parseable by `Number()` that is finite (or ±Infinity),
199
+ * i.e. `!isNaN(n)` after trimming.
200
+ * 4. bool — case-insensitive "true" / "false".
201
+ * 5. utf8 — fallback.
202
+ *
203
+ * Explicit dtype overrides (`dtypes` option):
204
+ * - `'i64'` — parse via BigInt(text); throws on non-integer strings.
205
+ * - `'date32'` — parse via strict 'yyyy-MM-dd'; throws on invalid format.
206
+ * - `'timestamp'` — parse via strict ISO-8601 with 'Z' or explicit UTC offset;
207
+ * throws on ambiguous local-time strings (no silent tz guessing).
208
+ *
209
+ * Null values: the `nullValues` option (default `['', 'null', 'NA']`) is
210
+ * checked BEFORE inference. A null-value cell becomes `null` in any dtype column.
211
+ *
212
+ * v2 nice-to-have (not shipped): ReadableStream adapter wrapping ChunkParser.
213
+ * // ponytail: fromCSVStream(stream, opts) → v2 when ReadableStream usage is confirmed
7
214
  */
8
- export { loadDatabonk, isSharedArrayBufferSupported } from './loader';
9
- export type { DatabonkModule, DatabonkWasm, LoaderOptions } from './loader';
10
- export { DatabonkDataFrame, GroupByBuilder } from './dataframe';
11
- export type { ColumnSpec } from './dataframe';
12
- export { ColumnType, ColumnView, getColumnTypeSize, createTypedArrayView, allocateAndCopy, copyToWasm, createSharedView } from './shared-memory';
215
+
216
+ interface FromCsvOptions {
217
+ /** Column delimiter (default: ','). */
218
+ readonly delimiter?: string;
219
+ /** If true (default), treat first row as column headers. */
220
+ readonly header?: boolean;
221
+ /**
222
+ * Override column names (used when header=false, or to rename columns).
223
+ * When header=true, these override the parsed header names.
224
+ */
225
+ readonly columns?: readonly string[];
226
+ /** Force specific dtypes (column name → dtype). Skips inference for those columns. */
227
+ readonly dtypes?: Readonly<Record<string, DType>>;
228
+ /**
229
+ * Values treated as null (case-sensitive). Default: `['', 'null', 'NA']`.
230
+ * An empty string means the empty field is null (the default for CSV).
231
+ */
232
+ readonly nullValues?: readonly string[];
233
+ /** Skip this many rows from the top (before header if present). */
234
+ readonly skipRows?: number;
235
+ /** Maximum number of data rows to read (not counting header or skipped rows). */
236
+ readonly maxRows?: number;
237
+ /** Runtime to use. If omitted, uses the default runtime. */
238
+ readonly runtime?: DfRuntime;
239
+ }
13
240
  /**
14
- * Quick start example:
241
+ * Stateful RFC-4180 CSV parser.
242
+ * Feed text chunks with `feed(s)` and call `finish()` to flush the last row.
243
+ * Each completed row is passed to the `onRow` callback.
244
+ *
245
+ * Design: simple state machine over a single `remaining` string. Performance is
246
+ * not critical here (CSV ingestion is I/O-bound); correctness is.
247
+ */
248
+ declare class ChunkParser {
249
+ private buf;
250
+ private row;
251
+ private field;
252
+ private inQuote;
253
+ private readonly delim;
254
+ private readonly onRow;
255
+ constructor(delimiter: string, onRow: (row: string[]) => void);
256
+ feed(chunk: string): void;
257
+ finish(): void;
258
+ private parse;
259
+ private emitRow;
260
+ }
261
+ /**
262
+ * Parse a CSV string into a DataFrame.
263
+ *
264
+ * @param text - Full CSV text (a chunk-fed path for streaming is internal).
265
+ * @param opts - Parsing and inference options.
15
266
  *
16
- * ```typescript
17
- * import { loadDatabonk, DatabonkDataFrame } from 'databonk';
267
+ * @throws If there are ragged rows (inconsistent column count) or unterminated quotes.
268
+ */
269
+ declare function fromCSV(text: string, opts?: FromCsvOptions): DataFrame;
270
+
271
+ /**
272
+ * JSON I/O thin wrappers.
18
273
  *
19
- * // Load the WASM module
20
- * const module = await loadDatabonk();
274
+ * The spec (§4 + §7) asks for fromJSON/toJSON — but DataFrame.fromRecords and
275
+ * df.toRecords() already ARE the JSON path:
21
276
  *
22
- * // Create a DataFrame from typed arrays
23
- * const df = await DatabonkDataFrame.fromTypedArrays(module, [
24
- * { name: 'id', data: new Int32Array([1, 2, 3, 4, 5]) },
25
- * { name: 'value', data: new Float32Array([1.5, 2.5, 3.5, 4.5, 5.5]) },
26
- * ]);
277
+ * df.toRecords() → Array<Record<string, Cell>> serialize with JSON.stringify
278
+ * DataFrame.fromRecords() DataFrame — parse with JSON.parse first
27
279
  *
28
- * // Aggregations
29
- * console.log('Sum:', df.sum('value'));
30
- * console.log('Mean:', df.mean('value'));
280
+ * This module exports `fromJSON` and `toJSON` as thin wrappers so callers have a
281
+ * discoverable one-liner, but the parallel implementation is intentionally avoided:
282
+ * these delegates call through to the existing frame-layer implementation (no duplicate
283
+ * column-building code). They add value only in ergonomics, not behavior.
31
284
  *
32
- * // Column math
33
- * df.scalarMul('value', 2.0, 'doubled');
285
+ * fromRecords / toRecords remain the canonical JSON path per the spec.
286
+ */
287
+
288
+ /**
289
+ * Parse a JSON array-of-records string into a DataFrame.
290
+ * Equivalent to `DataFrame.fromRecords(JSON.parse(json), opts)`.
34
291
  *
35
- * // Zero-copy column access
36
- * const view = df.getColumnView('value');
37
- * console.log('First value:', view?.get(0));
292
+ * @param json - A JSON string encoding an array of plain objects.
293
+ * @param opts - Forwarded to DataFrame.fromRecords.
294
+ * @throws SyntaxError if `json` is not valid JSON.
295
+ * @throws TypeError if the parsed value is not an array.
296
+ */
297
+ declare function fromJSON(json: string, opts?: FrameOptions): DataFrame;
298
+ /**
299
+ * Serialize a DataFrame to a compact JSON string (array of record objects).
300
+ * Equivalent to `JSON.stringify(df.toRecords())`.
38
301
  *
39
- * // Cleanup
40
- * df.free();
41
- * ```
302
+ * @param df - The DataFrame to serialize.
303
+ * @returns A JSON string. Null cells serialize as JSON `null`.
304
+ */
305
+ declare function toJSON(df: DataFrame): string;
306
+
307
+ /**
308
+ * Arrow IPC stream encode/decode for databonk DataFrames (ADR-002, ADR-009, ADR-010).
309
+ *
310
+ * Our layout is Arrow-compatible by design:
311
+ * - Numeric columns: contiguous TypedArray → Arrow primitive buffer (zero-transform).
312
+ * - Validity bitmaps: LSB-first, 1=valid — already Arrow format (zero-transform).
313
+ * - utf8 columns: i32 indices + (i32 offsets + u8 bytes) dict → Arrow Dict<Int32, Utf8>.
314
+ * - bool: u8[n] per-element → bit-pack to Arrow's 1-bit-per-element format (one transform).
315
+ * - i64 → Arrow Int(64, signed); date32 → Arrow Date(DAY); timestamp → Arrow Timestamp(MILLI, tz?).
316
+ *
317
+ * IPC stream per message: [int32 -1] [int32 meta_size] [meta bytes, pad→8B] [body bytes, pad→8B]
318
+ * EOS: [int32 -1] [int32 0]
319
+ *
320
+ * FlatBuffers field-index constants — sourced from the Arrow FlatBuffers IDL:
321
+ * Message: version(0), header_type(1), header(2), bodyLength(3)
322
+ * Schema: endianness(0), fields(1)
323
+ * Field: name(0), nullable(1), type_type(2), type(3), dictionary(4), children(5)
324
+ * RecordBatch: length(0), nodes(1), buffers(2)
325
+ * DictionaryBatch: id(0), data(1), isDelta(2)
326
+ * DictionaryEncoding: id(0), indexType(1), isOrdered(2)
327
+ * Int: bitWidth(0), isSigned(1)
328
+ * FloatingPoint: precision(0)
329
+ * Date: unit(0) — DateUnit: DAY=0, MILLISECOND=1 (FlatBuffers default=1)
330
+ * Timestamp: unit(0) — TimeUnit: SECOND=0, MILLISECOND=1, MICROSECOND=2, NANOSECOND=3;
331
+ * timezone(1) — optional IANA tz string
332
+ *
333
+ * MessageHeader union tags: Schema=1, DictionaryBatch=2, RecordBatch=3
334
+ * Type union tags: Int=2, FloatingPoint=3, Utf8=5, Bool=6, Date=8, Timestamp=10, LargeUtf8=20
335
+ * MetadataVersion V5=4
336
+ * FloatingPoint.Precision: HALF=0, SINGLE=1, DOUBLE=2
337
+ */
338
+
339
+ /**
340
+ * Encode a DataFrame to an Arrow IPC stream (Uint8Array).
341
+ *
342
+ * Stream: Schema message → DictionaryBatch per utf8 column → RecordBatch → EOS.
343
+ * Dictionary-encoded columns use Arrow Dict<Int32, Utf8>; our offsets/bytes
344
+ * buffers pass through directly (ADR-002 "nearly free").
345
+ * Bool columns are repacked from u8 to bit-packed (the ONE real transform).
346
+ */
347
+ declare function toArrow(df: DataFrame): Uint8Array;
348
+ /**
349
+ * Decode an Arrow IPC stream buffer into a DataFrame.
350
+ *
351
+ * Supported Arrow types: Int32, Int64, UInt32, Float32, Float64, Bool,
352
+ * Dict<Int32, Utf8> (written by our toArrow), plain Utf8 (builds a dict internally),
353
+ * Date32(DAY) (→ date32), Timestamp(any unit, optional tz) (→ timestamp, rescaled to ms).
354
+ * Any other type throws a clear error naming the type tag.
355
+ */
356
+ declare function fromArrow(buf: Uint8Array, rt: DfRuntime): DataFrame;
357
+
358
+ /**
359
+ * dataframe — columnar WASM dataframe library
42
360
  */
43
- //# sourceMappingURL=index.d.ts.map
361
+
362
+ declare const VERSION = "0.2.0";
363
+ /** Returns a greeting string. Placeholder retained for the scaffold smoke test. */
364
+ declare function hello(name?: string): string;
365
+
366
+ export { Cell, ChunkParser, Column, type CompiledFilter, type CompiledPlan, DType, DataFrame, DfRuntime, type ExecStats, Expr, ExprError, FrameError, FrameOptions, FrameView, type FromCsvOptions, type PlanResult, type ResultKind, type ScalarResult, type Selection, VERSION, badLiteral, clearBit, compile, compileFilter, dtypeMismatch, fromArrow, fromCSV, fromJSON, getBit, hello, nearest, setBit, toArrow, toJSON, unknownColumn, unsupportedCast, unsupportedDtype, validityBytes };