@milaboratories/pl-model-middle-layer 1.30.1 → 1.30.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.
@@ -74,3 +74,85 @@ export interface PTableV11 extends Disposable {
74
74
  /** Deallocates all underlying resources */
75
75
  dispose(): void;
76
76
  }
77
+
78
+ /**
79
+ * Table view returned by `createTable`.
80
+ *
81
+ * Self-contained: does not extend any earlier per-table interface. Once this
82
+ * version is adopted, every earlier `PTableV*` interface is dropped, so this
83
+ * declaration repeats the full method surface rather than referencing the
84
+ * predecessors.
85
+ *
86
+ * Same surface as {@link PTableV11} except {@link PTableV12.export} moves
87
+ * `headers` into `ops` and passes them as an ordered list of
88
+ * `[unified column index, header name]` pairs instead of a
89
+ * `Record<number, string>` map.
90
+ *
91
+ * PTable can be thought as having a composite primary key, consisting
92
+ * of axes, and a set of data columns derived from PColumn values.
93
+ * The table's column spec is owned by the caller — selector → index
94
+ * resolution runs on the caller side via WASM-spec.
95
+ */
96
+ export interface PTableV12 extends Disposable {
97
+ /**
98
+ * Get PTable disk footprint in bytes.
99
+ *
100
+ * @param ops.withPredecessors When true, the footprint includes
101
+ * every registered predecessor table reachable through the
102
+ * query lineage. When false or omitted, only this table's own
103
+ * materialised data is counted.
104
+ *
105
+ * Warning: This call materializes the join.
106
+ */
107
+ getFootprint(ops?: { withPredecessors?: boolean; signal?: AbortSignal }): Promise<number>;
108
+
109
+ /**
110
+ * Unified table shape
111
+ * Warning: This call materializes the join.
112
+ */
113
+ getShape(ops?: { signal?: AbortSignal }): Promise<PTableShape>;
114
+
115
+ /**
116
+ * Retrieve the data from the table. To retrieve only data required, it can be
117
+ * sliced both horizontally ({@link columnIndices}) and vertically
118
+ * ({@link range}).
119
+ * This call materializes the join.
120
+ *
121
+ * @param columnIndices unified indices of columns to be retrieved
122
+ * @param range optionally limit the range of records to retrieve
123
+ * */
124
+ getData(
125
+ columnIndices: number[],
126
+ ops?: {
127
+ range?: TableRange;
128
+ signal?: AbortSignal;
129
+ },
130
+ ): Promise<PTableVector[]>;
131
+
132
+ /**
133
+ * Stream the sorted table to a file at `path`. The output format is
134
+ * selected from the file extension: `csv`, `tsv`, `parquet`, or `xlsx`.
135
+ * Writing is bounded-memory.
136
+ * This call materializes the join.
137
+ *
138
+ * @param path destination file path; its extension selects the format
139
+ * @param ops.headers list of `[unified column index, header name]` pairs
140
+ * (unified index: axes first, then data columns). Only the columns listed
141
+ * are exported, in ascending index order — the list both selects the
142
+ * columns and names them (the data layer is name-independent, so names
143
+ * are supplied by the caller).
144
+ *
145
+ * @remarks For `xlsx` the caller must ensure the row count is below Excel's
146
+ * 1,048,576-row per-sheet limit.
147
+ */
148
+ export(
149
+ path: string,
150
+ ops?: {
151
+ headers: [number, string][];
152
+ signal?: AbortSignal;
153
+ },
154
+ ): Promise<void>;
155
+
156
+ /** Deallocates all underlying resources */
157
+ dispose(): void;
158
+ }