/** * Object-output helpers for the public TDC class. * * Text rendering honours // wrappers. Object output ignores * those wrappers and reports the sequence registry as plain JavaScript records, * which is the API shape test code normally wants. * * Both go through `prepareRender`, and that is the whole point of this file being * as short as it is. It used to extract the config itself and always build the * in-memory engine, which meant two things: a second reading of `` that a new * attribute would silently not reach, and `getAt(9_999_999)` materialising ten * million rows to hand back one. Now the router picks the engine, exactly as it * does for text, and a streaming registry answers one row for the cost of one row. */ import type { RenderOptions } from '../processor/render.js'; import type { DocumentContext } from '../generated/TDCParser.js'; export type TdcObjectScalar = string | undefined; export type TdcObjectValue = TdcObjectScalar | Record; export type TdcObjectRow = Record; /** * One column of a run. * * A `Float64Array` when EVERY cell of that column is a finite number, and the * plain array otherwise. The rule is deliberately all-or-nothing: a typed array * cannot hold "no value", and filling the gaps with NaN would turn a cell that * `parent=` switched off into a number nobody generated — the same quiet * wrongness `` already refuses to produce. So a column with * one empty cell, or one label in it, comes back as text and says so by its * type. */ export type TdcColumn = Float64Array | readonly (string | undefined)[]; /** Every column of a run, keyed by sequence name. Compound and pool sequences * contribute one key per field, spelled `Name.field`. */ export type TdcColumns = Record; export declare function materializeObjectRows(document: DocumentContext, options?: RenderOptions): TdcObjectRow[]; export declare function iterateObjectRows(document: DocumentContext, options?: RenderOptions): Generator; export declare function getObjectRowAt(document: DocumentContext, index: number, options?: RenderOptions): TdcObjectRow; /** * Materialise the run as columns rather than rows. * * The rows API hands back strings, so a caller wanting numbers parses them back * — and a caller generating thousands of windows writes the same `split(',')` * and `Number()` every time. This gives them the column directly. * * Worth knowing what it is NOT: a way to skip the number-to-string conversion. * Sequences hold their values as text, so this parses them, and the conversion * still happens. Measured on a 3,600-row window of six formula columns, the * round trip is 0.54 ms against 22 ms of generation — 2.4 per cent. This is for * the ergonomics and for not building a 140 KB string per window, not for * speed. */ export declare function materializeColumns(document: DocumentContext, options?: RenderOptions): TdcColumns; //# sourceMappingURL=object.d.ts.map