/** * A list of same-shaped records, with the field names sent once. * * Every tool here that answers with a list of findings -- functions with their * complexity, exports with their signatures, symbols with their locations -- * sent the field names again on every element. Measured on a 13-function * source file, smart_complexity's per-function blocks cost 1639 tokens, and * about half of that was 24 key names repeated 13 times: "distinctOperators", * "logicalLinesOfCode" and "maintainabilityIndex" once per function, to label * numbers whose meaning had already been established by the first element. * * The names are structural, not content, so they belong in the header. This is * the same information in the shape a table has always had, and it is * reversible: decodeTable() rebuilds the records exactly, which is how the one * in-process consumer (smart_refactor, which reads smart_complexity's output) * keeps working on objects. */ /** A leaf value: what survives JSON without further structure. */ export type Cell = string | number | boolean | null | unknown[]; export interface Table { /** * Field paths, in first-seen order. A nested field is dotted -- * `complexity.halstead.volume` -- so the header stays flat and one row is * one record. */ columns: string[]; /** One array per record, positionally matching {@link columns}. */ rows: Cell[][]; } /** * Turns a list of records into a header plus rows. * * A field absent from one record is `null` in that row, and decodes back to * absent. A record contributing no fields at all still produces a row, so the * count of rows is the count of records. */ export declare function encodeTable(records: Record[]): Table; /** * Rebuilds the records a {@link Table} was encoded from. * * A `null` cell is treated as the field having been absent, which is the * inverse of what encodeTable() writes for a missing field. A record that * genuinely held `null` is therefore returned without that field; none of the * metric shapes here use null as a value, and the alternative -- a sentinel -- * would cost a token on every cell to preserve a case that does not arise. */ export declare function decodeTable(table: Table): T[]; //# sourceMappingURL=table.d.ts.map