@konstit/csv 0.4.1

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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +554 -0
  3. package/THIRD_PARTY_NOTICES.md +365 -0
  4. package/dist/api.d.ts +81 -0
  5. package/dist/api.js +515 -0
  6. package/dist/batches.d.ts +47 -0
  7. package/dist/batches.js +348 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +605 -0
  10. package/dist/file-stream.d.ts +11 -0
  11. package/dist/file-stream.js +290 -0
  12. package/dist/files.d.ts +8 -0
  13. package/dist/files.js +150 -0
  14. package/dist/filter.d.ts +8 -0
  15. package/dist/filter.js +82 -0
  16. package/dist/index.d.ts +6 -0
  17. package/dist/index.js +19 -0
  18. package/dist/native.d.ts +199 -0
  19. package/dist/native.js +275 -0
  20. package/dist/normalize.d.ts +56 -0
  21. package/dist/normalize.js +365 -0
  22. package/dist/options.d.ts +17 -0
  23. package/dist/options.js +12 -0
  24. package/dist/parser.d.ts +32 -0
  25. package/dist/parser.js +254 -0
  26. package/dist/runtime.d.ts +5 -0
  27. package/dist/runtime.js +12 -0
  28. package/dist/strict-schema.d.ts +12 -0
  29. package/dist/strict-schema.js +90 -0
  30. package/dist/types.d.ts +181 -0
  31. package/dist/types.js +0 -0
  32. package/dist/worker-count.d.ts +2 -0
  33. package/dist/worker-count.js +96 -0
  34. package/dist/worker-factory.d.ts +3 -0
  35. package/dist/worker-factory.js +9 -0
  36. package/dist/worker-filter.d.ts +29 -0
  37. package/dist/worker-filter.js +46 -0
  38. package/dist/worker-module.d.ts +1 -0
  39. package/dist/worker-module.js +4 -0
  40. package/dist/worker-pool.d.ts +17 -0
  41. package/dist/worker-pool.js +290 -0
  42. package/dist/worker-rows.d.ts +8 -0
  43. package/dist/worker-rows.js +118 -0
  44. package/dist/workers/count.worker.d.ts +1 -0
  45. package/dist/workers/count.worker.js +49 -0
  46. package/dist/workers/rows.worker.d.ts +1 -0
  47. package/dist/workers/rows.worker.js +85 -0
  48. package/dist/zip-reader.d.ts +2 -0
  49. package/dist/zip-reader.js +89 -0
  50. package/package.json +122 -0
  51. package/prebuilds/darwin-arm64/libcsv_native.dylib +0 -0
  52. package/prebuilds/darwin-x64/libcsv_native.dylib +0 -0
  53. package/prebuilds/linux-x64/libcsv_native.so +0 -0
  54. package/prebuilds/manifest.json +48 -0
  55. package/prebuilds/provenance/darwin-arm64.json +1 -0
  56. package/prebuilds/provenance/darwin-x64.json +1 -0
  57. package/prebuilds/provenance/linux-x64.json +1 -0
@@ -0,0 +1,365 @@
1
+ # Third-Party Notices
2
+
3
+ This file tracks third-party code incorporated into distributed native binaries and third-party test data, examples, and compatibility references used by this repository.
4
+
5
+ ## RE2
6
+
7
+ - Source: https://github.com/google/re2
8
+ - Version: 2025-11-05
9
+ - License: BSD-3-Clause
10
+ - Use in this project: compiled into the distributed native CSV library.
11
+
12
+ Copyright (c) 2009 The RE2 Authors. All rights reserved.
13
+
14
+ Redistribution and use in source and binary forms, with or without modification,
15
+ are permitted provided that the following conditions are met:
16
+
17
+ 1. Redistributions of source code must retain the above copyright notice, this
18
+ list of conditions and the following disclaimer.
19
+ 2. Redistributions in binary form must reproduce the above copyright notice,
20
+ this list of conditions and the following disclaimer in the documentation
21
+ and/or other materials provided with the distribution.
22
+ 3. Neither the name of Google Inc. nor the names of its contributors may be used
23
+ to endorse or promote products derived from this software without specific
24
+ prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
30
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+
37
+ ## Abseil
38
+
39
+ - Source: https://github.com/abseil/abseil-cpp
40
+ - Version: 20250814.1
41
+ - License: Apache-2.0
42
+ - Use in this project: RE2 support compiled into the distributed native CSV library.
43
+
44
+ Copyright 2017 The Abseil Authors.
45
+
46
+ Licensed under the Apache License, Version 2.0 (the "License");
47
+ you may not use this file except in compliance with the License.
48
+ You may obtain a copy of the License at
49
+
50
+ https://www.apache.org/licenses/LICENSE-2.0
51
+
52
+ Unless required by applicable law or agreed to in writing, software
53
+ distributed under the License is distributed on an "AS IS" BASIS,
54
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55
+ See the License for the specific language governing permissions and
56
+ limitations under the License.
57
+
58
+ ### Apache License 2.0
59
+
60
+ Apache License
61
+ Version 2.0, January 2004
62
+ https://www.apache.org/licenses/
63
+
64
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
65
+
66
+ 1. Definitions.
67
+
68
+ "License" shall mean the terms and conditions for use, reproduction,
69
+ and distribution as defined by Sections 1 through 9 of this document.
70
+
71
+ "Licensor" shall mean the copyright owner or entity authorized by
72
+ the copyright owner that is granting the License.
73
+
74
+ "Legal Entity" shall mean the union of the acting entity and all
75
+ other entities that control, are controlled by, or are under common
76
+ control with that entity. For the purposes of this definition,
77
+ "control" means (i) the power, direct or indirect, to cause the
78
+ direction or management of such entity, whether by contract or
79
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
80
+ outstanding shares, or (iii) beneficial ownership of such entity.
81
+
82
+ "You" (or "Your") shall mean an individual or Legal Entity
83
+ exercising permissions granted by this License.
84
+
85
+ "Source" form shall mean the preferred form for making modifications,
86
+ including but not limited to software source code, documentation
87
+ source, and configuration files.
88
+
89
+ "Object" form shall mean any form resulting from mechanical
90
+ transformation or translation of a Source form, including but
91
+ not limited to compiled object code, generated documentation,
92
+ and conversions to other media types.
93
+
94
+ "Work" shall mean the work of authorship, whether in Source or
95
+ Object form, made available under the License, as indicated by a
96
+ copyright notice that is included in or attached to the work
97
+ (an example is provided in the Appendix below).
98
+
99
+ "Derivative Works" shall mean any work, whether in Source or Object
100
+ form, that is based on (or derived from) the Work and for which the
101
+ editorial revisions, annotations, elaborations, or other modifications
102
+ represent, as a whole, an original work of authorship. For the purposes
103
+ of this License, Derivative Works shall not include works that remain
104
+ separable from, or merely link (or bind by name) to the interfaces of,
105
+ the Work and Derivative Works thereof.
106
+
107
+ "Contribution" shall mean any work of authorship, including
108
+ the original version of the Work and any modifications or additions
109
+ to that Work or Derivative Works thereof, that is intentionally
110
+ submitted to Licensor for inclusion in the Work by the copyright owner
111
+ or by an individual or Legal Entity authorized to submit on behalf of
112
+ the copyright owner. For the purposes of this definition, "submitted"
113
+ means any form of electronic, verbal, or written communication sent
114
+ to the Licensor or its representatives, including but not limited to
115
+ communication on electronic mailing lists, source code control systems,
116
+ and issue tracking systems that are managed by, or on behalf of, the
117
+ Licensor for the purpose of discussing and improving the Work, but
118
+ excluding communication that is conspicuously marked or otherwise
119
+ designated in writing by the copyright owner as "Not a Contribution."
120
+
121
+ "Contributor" shall mean Licensor and any individual or Legal Entity
122
+ on behalf of whom a Contribution has been received by Licensor and
123
+ subsequently incorporated within the Work.
124
+
125
+ 2. Grant of Copyright License. Subject to the terms and conditions of
126
+ this License, each Contributor hereby grants to You a perpetual,
127
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
128
+ copyright license to reproduce, prepare Derivative Works of,
129
+ publicly display, publicly perform, sublicense, and distribute the
130
+ Work and such Derivative Works in Source or Object form.
131
+
132
+ 3. Grant of Patent License. Subject to the terms and conditions of
133
+ this License, each Contributor hereby grants to You a perpetual,
134
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
135
+ (except as stated in this section) patent license to make, have made,
136
+ use, offer to sell, sell, import, and otherwise transfer the Work,
137
+ where such license applies only to those patent claims licensable
138
+ by such Contributor that are necessarily infringed by their
139
+ Contribution(s) alone or by combination of their Contribution(s)
140
+ with the Work to which such Contribution(s) was submitted. If You
141
+ institute patent litigation against any entity (including a
142
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
143
+ or a Contribution incorporated within the Work constitutes direct
144
+ or contributory patent infringement, then any patent licenses
145
+ granted to You under this License for that Work shall terminate
146
+ as of the date such litigation is filed.
147
+
148
+ 4. Redistribution. You may reproduce and distribute copies of the
149
+ Work or Derivative Works thereof in any medium, with or without
150
+ modifications, and in Source or Object form, provided that You
151
+ meet the following conditions:
152
+
153
+ (a) You must give any other recipients of the Work or
154
+ Derivative Works a copy of this License; and
155
+
156
+ (b) You must cause any modified files to carry prominent notices
157
+ stating that You changed the files; and
158
+
159
+ (c) You must retain, in the Source form of any Derivative Works
160
+ that You distribute, all copyright, patent, trademark, and
161
+ attribution notices from the Source form of the Work,
162
+ excluding those notices that do not pertain to any part of
163
+ the Derivative Works; and
164
+
165
+ (d) If the Work includes a "NOTICE" text file as part of its
166
+ distribution, then any Derivative Works that You distribute must
167
+ include a readable copy of the attribution notices contained
168
+ within such NOTICE file, excluding those notices that do not
169
+ pertain to any part of the Derivative Works, in at least one
170
+ of the following places: within a NOTICE text file distributed
171
+ as part of the Derivative Works; within the Source form or
172
+ documentation, if provided along with the Derivative Works; or,
173
+ within a display generated by the Derivative Works, if and
174
+ wherever such third-party notices normally appear. The contents
175
+ of the NOTICE file are for informational purposes only and
176
+ do not modify the License. You may add Your own attribution
177
+ notices within Derivative Works that You distribute, alongside
178
+ or as an addendum to the NOTICE text from the Work, provided
179
+ that such additional attribution notices cannot be construed
180
+ as modifying the License.
181
+
182
+ You may add Your own copyright statement to Your modifications and
183
+ may provide additional or different license terms and conditions
184
+ for use, reproduction, or distribution of Your modifications, or
185
+ for any such Derivative Works as a whole, provided Your use,
186
+ reproduction, and distribution of the Work otherwise complies with
187
+ the conditions stated in this License.
188
+
189
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
190
+ any Contribution intentionally submitted for inclusion in the Work
191
+ by You to the Licensor shall be under the terms and conditions of
192
+ this License, without any additional terms or conditions.
193
+ Notwithstanding the above, nothing herein shall supersede or modify
194
+ the terms of any separate license agreement you may have executed
195
+ with Licensor regarding such Contributions.
196
+
197
+ 6. Trademarks. This License does not grant permission to use the trade
198
+ names, trademarks, service marks, or product names of the Licensor,
199
+ except as required for reasonable and customary use in describing the
200
+ origin of the Work and reproducing the content of the NOTICE file.
201
+
202
+ 7. Disclaimer of Warranty. Unless required by applicable law or
203
+ agreed to in writing, Licensor provides the Work (and each
204
+ Contributor provides its Contributions) on an "AS IS" BASIS,
205
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
206
+ implied, including, without limitation, any warranties or conditions
207
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
208
+ PARTICULAR PURPOSE. You are solely responsible for determining the
209
+ appropriateness of using or redistributing the Work and assume any
210
+ risks associated with Your exercise of permissions under this License.
211
+
212
+ 8. Limitation of Liability. In no event and under no legal theory,
213
+ whether in tort (including negligence), contract, or otherwise,
214
+ unless required by applicable law (such as deliberate and grossly
215
+ negligent acts) or agreed to in writing, shall any Contributor be
216
+ liable to You for damages, including any direct, indirect, special,
217
+ incidental, or consequential damages of any character arising as a
218
+ result of this License or out of the use or inability to use the
219
+ Work (including but not limited to damages for loss of goodwill,
220
+ work stoppage, computer failure or malfunction, or any and all
221
+ other commercial damages or losses), even if such Contributor
222
+ has been advised of the possibility of such damages.
223
+
224
+ 9. Accepting Warranty or Additional Liability. While redistributing
225
+ the Work or Derivative Works thereof, You may choose to offer,
226
+ and charge a fee for, acceptance of support, warranty, indemnity,
227
+ or other liability obligations and/or rights consistent with this
228
+ License. However, in accepting such obligations, You may act only
229
+ on Your own behalf and on Your sole responsibility, not on behalf
230
+ of any other Contributor, and only if You agree to indemnify,
231
+ defend, and hold each Contributor harmless for any liability
232
+ incurred by, or claims asserted against, such Contributor by reason
233
+ of your accepting any such warranty or additional liability.
234
+
235
+ END OF TERMS AND CONDITIONS
236
+
237
+ APPENDIX: How to apply the Apache License to your work.
238
+
239
+ To apply the Apache License to your work, attach the following
240
+ boilerplate notice, with the fields enclosed by brackets "[]"
241
+ replaced with your own identifying information. (Don't include
242
+ the brackets!) The text should be enclosed in the appropriate
243
+ comment syntax for the file format. We also recommend that a
244
+ file or class name and description of purpose be included on the
245
+ same "printed page" as the copyright notice for easier
246
+ identification within third-party archives.
247
+
248
+ Copyright [yyyy] [name of copyright owner]
249
+
250
+ Licensed under the Apache License, Version 2.0 (the "License");
251
+ you may not use this file except in compliance with the License.
252
+ You may obtain a copy of the License at
253
+
254
+ https://www.apache.org/licenses/LICENSE-2.0
255
+
256
+ Unless required by applicable law or agreed to in writing, software
257
+ distributed under the License is distributed on an "AS IS" BASIS,
258
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
259
+ See the License for the specific language governing permissions and
260
+ limitations under the License.
261
+
262
+ ## Highway
263
+
264
+ - Source: https://github.com/google/highway
265
+ - License choice for this distribution: BSD-3-Clause
266
+ - Use in this project: compiled into the distributed native CSV library.
267
+
268
+ Copyright (c) The Highway Project Authors. All rights reserved.
269
+
270
+ Redistribution and use in source and binary forms, with or without modification,
271
+ are permitted provided that the following conditions are met:
272
+
273
+ 1. Redistributions of source code must retain the above copyright notice, this
274
+ list of conditions and the following disclaimer.
275
+
276
+ 2. Redistributions in binary form must reproduce the above copyright notice,
277
+ this list of conditions and the following disclaimer in the documentation
278
+ and/or other materials provided with the distribution.
279
+
280
+ 3. Neither the name of the copyright holder nor the names of its contributors
281
+ may be used to endorse or promote products derived from this software without
282
+ specific prior written permission.
283
+
284
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
285
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
286
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
287
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
288
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
289
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
290
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
291
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
292
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
293
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
294
+
295
+ ## unordered_dense
296
+
297
+ - Source: https://github.com/martinus/unordered_dense
298
+ - License: MIT
299
+ - Use in this project: incorporated into the distributed native CSV library.
300
+
301
+ MIT License
302
+
303
+ Copyright (c) 2022 Martin Leitner-Ankerl
304
+
305
+ Permission is hereby granted, free of charge, to any person obtaining a copy
306
+ of this software and associated documentation files (the "Software"), to deal
307
+ in the Software without restriction, including without limitation the rights
308
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
309
+ copies of the Software, and to permit persons to whom the Software is
310
+ furnished to do so, subject to the following conditions:
311
+
312
+ The above copyright notice and this permission notice shall be included in all
313
+ copies or substantial portions of the Software.
314
+
315
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
316
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
317
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
318
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
319
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
320
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
321
+ SOFTWARE.
322
+
323
+ ## zlib-ng
324
+
325
+ - Source: https://github.com/zlib-ng/zlib-ng
326
+ - Version: 2.3.3
327
+ - License: zlib License
328
+ - Use in this project: compiled into the distributed native library for streaming ZIP DEFLATE and CRC32 processing.
329
+
330
+ Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
331
+
332
+ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
333
+ liable for any damages arising from the use of this software.
334
+
335
+ Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter
336
+ it and redistribute it freely, subject to the following restrictions:
337
+
338
+ 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If
339
+ you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
340
+ required.
341
+ 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
342
+ software.
343
+ 3. This notice may not be removed or altered from any source distribution.
344
+
345
+ ## csv-spectrum
346
+
347
+ - Source: https://github.com/maxogden/csv-spectrum
348
+ - npm package: `csv-spectrum@2.0.0`
349
+ - License: BSD-2-Clause
350
+ - Use in this repo: compatibility fixtures loaded by `test/csv-parser/spectrum.test.ts`.
351
+ - Notice: csv-spectrum is copyright its authors and contributors. Redistribution of source or binary forms must retain the BSD-2-Clause copyright notice, conditions, and disclaimer.
352
+
353
+ ## csvkit
354
+
355
+ - Source: https://github.com/wireservice/csvkit
356
+ - License: MIT
357
+ - Use in this repo: compatibility attribution note for CSV examples/expectations derived from csvkit-related CSV parser corpus material.
358
+ - Notice: csvkit is copyright Christopher Groskopf and contributors. MIT-licensed material requires keeping the copyright and permission notice with substantial copied portions.
359
+
360
+ ## W3C CSV on the Web
361
+
362
+ - Source: https://github.com/w3c/csvw and https://w3c.github.io/csvw/tests/
363
+ - License note: W3C CSVW documents are covered by the W3C Document License. The CSVW test distribution also documents W3C test-suite licensing terms.
364
+ - Use in this repo: raw parser subset fixtures in `test/csv-parser/csvw-basic.test.ts`.
365
+ - Notice: W3C materials are copyright W3C and contributors. Keep W3C license notices with copied or adapted CSVW material.
package/dist/api.d.ts ADDED
@@ -0,0 +1,81 @@
1
+ import type { NativeCsvBatch } from './batches.js';
2
+ import { all, any, column, not, re } from './filter.js';
3
+ import type { CsvBatchesOptions, CsvColumnarBatchCallback, CsvColumnarBatchOptions, CsvColumns, CsvCountOptions, CsvParseOptions, CsvProjectedRow, CsvRowsOptions, CsvRowViewCallback, CsvRowViewsOptions, CsvShard, CsvShardingOptions, CsvWorkerPoolOptions } from './types.js';
4
+ import { parallelCount } from './worker-count.js';
5
+ import { CsvWorkerPool } from './worker-pool.js';
6
+ import { parallelRows } from './worker-rows.js';
7
+ /**
8
+ * Parse one in-memory chunk into materialized rows.
9
+ *
10
+ * Use this when you already own buffering and still want the high-level row API.
11
+ * Accepts only single-thread row options, so `workerCount` is intentionally unavailable.
12
+ */
13
+ export declare function parse<TColumns extends CsvColumns | undefined = undefined>(buffer: NodeJS.TypedArray | DataView, options?: CsvParseOptions<TColumns>): Promise<CsvProjectedRow<TColumns>[]>;
14
+ /**
15
+ * Stream materialized rows from a CSV file.
16
+ *
17
+ * Use this for the most direct high-level API. With `workerCount > 1`, the work
18
+ * fans out across Bun workers.
19
+ */
20
+ export declare function rows<TColumns extends CsvColumns | undefined = undefined>(path: string, options?: CsvRowsOptions<TColumns>): AsyncGenerator<CsvProjectedRow<TColumns>[], void>;
21
+ export { parallelRows };
22
+ export { CsvWorkerPool };
23
+ /**
24
+ * Stream native batches with explicit lifetime control.
25
+ *
26
+ * Use this when you want low-allocation access to row views or byte ranges and
27
+ * are comfortable closing each batch yourself.
28
+ */
29
+ export declare function batches(path: string, options?: CsvBatchesOptions): AsyncGenerator<NativeCsvBatch, void>;
30
+ export declare function withBatches(path: string, options: CsvBatchesOptions, callback: (batch: NativeCsvBatch) => void | Promise<void>): Promise<void>;
31
+ /**
32
+ * Stream reusable columnar batch views without materializing one JS string per field.
33
+ *
34
+ * When `columns` is defined, batch column indexes are relative to the projected
35
+ * output order. This API is synchronous by design so the view can be safely reused.
36
+ */
37
+ export declare function forEachColumnarBatches<TColumns extends CsvColumns | undefined = undefined>(path: string, options: CsvColumnarBatchOptions<TColumns>, callback: CsvColumnarBatchCallback<TColumns>): Promise<void>;
38
+ export declare function forEachColumnarBatches(path: string, options: CsvColumnarBatchOptions | undefined, callback: CsvColumnarBatchCallback): Promise<void>;
39
+ export declare function withColumnarBatches<TColumns extends CsvColumns | undefined = undefined>(path: string, options: CsvColumnarBatchOptions<TColumns>, callback: CsvColumnarBatchCallback<TColumns>): Promise<void>;
40
+ /**
41
+ * Stream reusable row views without materializing row arrays.
42
+ *
43
+ * `selectedColumns` on the row view is metadata only. Row accessors still use
44
+ * physical CSV column indexes; use `row.getPhysical()` for explicit call sites.
45
+ * This API is synchronous by design so the view can be safely reused.
46
+ */
47
+ export declare function forEachRowViews<TColumns extends CsvColumns | undefined = undefined>(path: string, options: CsvRowViewsOptions<TColumns>, callback: CsvRowViewCallback<TColumns>): Promise<void>;
48
+ export declare function forEachRowViews(path: string, options: CsvRowViewsOptions | undefined, callback: CsvRowViewCallback): Promise<void>;
49
+ export declare function withRowViews<TColumns extends CsvColumns | undefined = undefined>(path: string, options: CsvRowViewsOptions<TColumns>, callback: CsvRowViewCallback<TColumns>): Promise<void>;
50
+ /**
51
+ * Count rows without materializing them.
52
+ *
53
+ * Full filter support exists here because count has native fast paths for
54
+ * filters created with `csv.column()` and grouped with `csv.all()`, `csv.any()`, and `csv.not()`.
55
+ */
56
+ export declare function count(path: string, options?: CsvCountOptions): Promise<number>;
57
+ export { parallelCount };
58
+ export declare function findCsvSafeSplitOffsets(path: string, shardCount: number, options?: CsvShardingOptions): number[];
59
+ export declare function findCsvSafeShards(path: string, shardCount: number, options?: CsvShardingOptions): CsvShard[];
60
+ export declare function workerPool<TColumns extends CsvColumns | undefined = undefined>(path: string, options: CsvWorkerPoolOptions<TColumns>): CsvWorkerPool<TColumns>;
61
+ export declare const csv: {
62
+ all: typeof all;
63
+ any: typeof any;
64
+ column: typeof column;
65
+ not: typeof not;
66
+ re: typeof re;
67
+ workerPool: typeof workerPool;
68
+ parse: typeof parse;
69
+ rows: typeof rows;
70
+ parallelCount: typeof parallelCount;
71
+ parallelRows: typeof parallelRows;
72
+ batches: typeof batches;
73
+ withBatches: typeof withBatches;
74
+ forEachColumnarBatches: typeof forEachColumnarBatches;
75
+ withColumnarBatches: typeof withColumnarBatches;
76
+ forEachRowViews: typeof forEachRowViews;
77
+ withRowViews: typeof withRowViews;
78
+ count: typeof count;
79
+ findCsvSafeSplitOffsets: typeof findCsvSafeSplitOffsets;
80
+ findCsvSafeShards: typeof findCsvSafeShards;
81
+ };