@elaraai/east-node-io 0.0.1-beta.1 → 0.0.1-beta.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.
Files changed (114) hide show
  1. package/dist/compression/gzip.d.ts +108 -0
  2. package/dist/compression/gzip.d.ts.map +1 -0
  3. package/dist/compression/gzip.js +153 -0
  4. package/dist/compression/gzip.js.map +1 -0
  5. package/dist/compression/index.d.ts +308 -0
  6. package/dist/compression/index.d.ts.map +1 -0
  7. package/dist/compression/index.js +289 -0
  8. package/dist/compression/index.js.map +1 -0
  9. package/dist/compression/tar.d.ts +115 -0
  10. package/dist/compression/tar.d.ts.map +1 -0
  11. package/dist/compression/tar.js +254 -0
  12. package/dist/compression/tar.js.map +1 -0
  13. package/dist/compression/types.d.ts +124 -0
  14. package/dist/compression/types.d.ts.map +1 -0
  15. package/dist/compression/types.js +106 -0
  16. package/dist/compression/types.js.map +1 -0
  17. package/dist/compression/zip.d.ts +121 -0
  18. package/dist/compression/zip.d.ts.map +1 -0
  19. package/dist/compression/zip.js +200 -0
  20. package/dist/compression/zip.js.map +1 -0
  21. package/dist/connection/index.d.ts +78 -0
  22. package/dist/connection/index.d.ts.map +1 -0
  23. package/dist/connection/index.js +134 -0
  24. package/dist/connection/index.js.map +1 -0
  25. package/dist/format/csv.d.ts +210 -0
  26. package/dist/format/csv.d.ts.map +1 -0
  27. package/dist/format/csv.js +729 -0
  28. package/dist/format/csv.js.map +1 -0
  29. package/dist/format/index.d.ts +641 -0
  30. package/dist/format/index.d.ts.map +1 -0
  31. package/dist/format/index.js +463 -0
  32. package/dist/format/index.js.map +1 -0
  33. package/dist/format/types.d.ts +176 -0
  34. package/dist/format/types.d.ts.map +1 -0
  35. package/dist/format/types.js +122 -0
  36. package/dist/format/types.js.map +1 -0
  37. package/dist/format/xlsx.d.ts +178 -0
  38. package/dist/format/xlsx.d.ts.map +1 -0
  39. package/dist/format/xlsx.js +313 -0
  40. package/dist/format/xlsx.js.map +1 -0
  41. package/dist/format/xml.d.ts +302 -0
  42. package/dist/format/xml.d.ts.map +1 -0
  43. package/dist/format/xml.js +602 -0
  44. package/dist/format/xml.js.map +1 -0
  45. package/dist/index.d.ts +25 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +32 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/nosql/index.d.ts +503 -0
  50. package/dist/nosql/index.d.ts.map +1 -0
  51. package/dist/nosql/index.js +483 -0
  52. package/dist/nosql/index.js.map +1 -0
  53. package/dist/nosql/mongodb.d.ts +306 -0
  54. package/dist/nosql/mongodb.d.ts.map +1 -0
  55. package/dist/nosql/mongodb.js +552 -0
  56. package/dist/nosql/mongodb.js.map +1 -0
  57. package/dist/nosql/redis.d.ts +268 -0
  58. package/dist/nosql/redis.d.ts.map +1 -0
  59. package/dist/nosql/redis.js +371 -0
  60. package/dist/nosql/redis.js.map +1 -0
  61. package/dist/nosql/types.d.ts +70 -0
  62. package/dist/nosql/types.d.ts.map +1 -0
  63. package/dist/nosql/types.js +79 -0
  64. package/dist/nosql/types.js.map +1 -0
  65. package/dist/sql/index.d.ts +777 -0
  66. package/dist/sql/index.d.ts.map +1 -0
  67. package/dist/sql/index.js +515 -0
  68. package/dist/sql/index.js.map +1 -0
  69. package/dist/sql/mysql.d.ts +238 -0
  70. package/dist/sql/mysql.d.ts.map +1 -0
  71. package/dist/sql/mysql.js +396 -0
  72. package/dist/sql/mysql.js.map +1 -0
  73. package/dist/sql/postgres.d.ts +237 -0
  74. package/dist/sql/postgres.d.ts.map +1 -0
  75. package/dist/sql/postgres.js +381 -0
  76. package/dist/sql/postgres.js.map +1 -0
  77. package/dist/sql/sqlite.d.ts +217 -0
  78. package/dist/sql/sqlite.d.ts.map +1 -0
  79. package/dist/sql/sqlite.js +366 -0
  80. package/dist/sql/sqlite.js.map +1 -0
  81. package/dist/sql/types.d.ts +205 -0
  82. package/dist/sql/types.d.ts.map +1 -0
  83. package/dist/sql/types.js +175 -0
  84. package/dist/sql/types.js.map +1 -0
  85. package/dist/storage/index.d.ts +304 -0
  86. package/dist/storage/index.d.ts.map +1 -0
  87. package/dist/storage/index.js +234 -0
  88. package/dist/storage/index.js.map +1 -0
  89. package/dist/storage/s3.d.ts +373 -0
  90. package/dist/storage/s3.d.ts.map +1 -0
  91. package/dist/storage/s3.js +502 -0
  92. package/dist/storage/s3.js.map +1 -0
  93. package/dist/storage/types.d.ts +117 -0
  94. package/dist/storage/types.d.ts.map +1 -0
  95. package/dist/storage/types.js +94 -0
  96. package/dist/storage/types.js.map +1 -0
  97. package/dist/transfer/ftp.d.ts +333 -0
  98. package/dist/transfer/ftp.d.ts.map +1 -0
  99. package/dist/transfer/ftp.js +437 -0
  100. package/dist/transfer/ftp.js.map +1 -0
  101. package/dist/transfer/index.d.ts +456 -0
  102. package/dist/transfer/index.d.ts.map +1 -0
  103. package/dist/transfer/index.js +414 -0
  104. package/dist/transfer/index.js.map +1 -0
  105. package/dist/transfer/sftp.d.ts +333 -0
  106. package/dist/transfer/sftp.d.ts.map +1 -0
  107. package/dist/transfer/sftp.js +436 -0
  108. package/dist/transfer/sftp.js.map +1 -0
  109. package/dist/transfer/types.d.ts +108 -0
  110. package/dist/transfer/types.d.ts.map +1 -0
  111. package/dist/transfer/types.js +110 -0
  112. package/dist/transfer/types.js.map +1 -0
  113. package/dist/tsconfig.tsbuildinfo +1 -0
  114. package/package.json +6 -6
@@ -0,0 +1,463 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * File format platform functions for East Node IO.
7
+ *
8
+ * Provides functions for reading and writing structured file formats like
9
+ * Excel (XLSX), CSV, and more.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { East, BlobType, IntegerType } from "@elaraai/east";
14
+ * import { Format } from "@elaraai/east-node-io";
15
+ *
16
+ * const countRows = East.function([BlobType], IntegerType, ($, xlsxBlob) => {
17
+ * const options = $.let({
18
+ * sheetName: { tag: "none", value: {} },
19
+ * });
20
+ *
21
+ * const sheet = $.let(Format.XLSX.read(xlsxBlob, options));
22
+ * return $.return(sheet.size());
23
+ * });
24
+ *
25
+ * const compiled = East.compile(countRows.toIR(), Format.XLSX.Implementation);
26
+ * const xlsxBlob = new Uint8Array([]); // XLSX file bytes
27
+ * compiled(xlsxBlob); // 100n
28
+ * ```
29
+ *
30
+ * @packageDocumentation
31
+ */
32
+ // Export types
33
+ export * from "./types.js";
34
+ // Export platform functions and implementation
35
+ export { xlsx_read, xlsx_write, xlsx_info, XlsxImpl } from "./xlsx.js";
36
+ export { csv_parse, csv_serialize, CsvImpl, CsvParseConfig, CsvSerializeConfig, CsvRowType, CsvDataType } from "./csv.js";
37
+ export { xml_parse, xml_serialize, XmlImpl, XmlParseConfig, XmlSerializeConfig, XmlNode } from "./xml.js";
38
+ // Import for grouped exports
39
+ import { xlsx_read, xlsx_write, xlsx_info, XlsxImpl } from "./xlsx.js";
40
+ import { csv_parse, csv_serialize, CsvImpl, CsvParseConfig, CsvSerializeConfig, CsvRowType, CsvDataType } from "./csv.js";
41
+ import { xml_parse, xml_serialize, XmlImpl, XmlParseConfig, XmlSerializeConfig, XmlNode } from "./xml.js";
42
+ import { XlsxCellType, XlsxRowType, XlsxSheetType, XlsxReadOptionsType, XlsxWriteOptionsType, XlsxSheetInfoType, XlsxInfoType, } from "./types.js";
43
+ /**
44
+ * File format platform functions grouped by format type.
45
+ *
46
+ * Provides organized access to format-specific operations for reading and
47
+ * writing structured data files in East programs.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * import { East, BlobType } from "@elaraai/east";
52
+ * import { Format } from "@elaraai/east-node-io";
53
+ *
54
+ * const createExcel = East.function([], BlobType, $ => {
55
+ * const data = $.let([
56
+ * [East.variant('String', "Name"), East.variant('String', "Age")],
57
+ * [East.variant('String', "Alice"), East.variant('Float', 30)],
58
+ * [East.variant('String', "Bob"), East.variant('Float', 25)],
59
+ * ]);
60
+ *
61
+ * const options = $.let({
62
+ * sheetName: { tag: "some", value: "People" },
63
+ * });
64
+ *
65
+ * const blob = $.let(Format.XLSX.write(data, options));
66
+ * return $.return(blob);
67
+ * });
68
+ *
69
+ * const compiled = East.compile(createExcel.toIR(), Format.XLSX.Implementation);
70
+ * const xlsxBlob = compiled(); // Uint8Array with XLSX file bytes
71
+ * ```
72
+ */
73
+ export const Format = {
74
+ /**
75
+ * XLSX (Excel) file format operations.
76
+ *
77
+ * Provides functions for reading and writing Excel files as 2D arrays
78
+ * of literal values (strings, numbers, booleans, null).
79
+ */
80
+ XLSX: {
81
+ /**
82
+ * Reads an XLSX file and returns a 2D array of cell values.
83
+ *
84
+ * Parses an Excel file from a blob and extracts data as ArrayType<ArrayType<LiteralValueType>>.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * import { East, BlobType, IntegerType, variant } from "@elaraai/east";
89
+ * import { Format } from "@elaraai/east-node-io";
90
+ *
91
+ * const countRows = East.function([BlobType], IntegerType, ($, xlsxBlob) => {
92
+ * const options = $.let({
93
+ * sheetName: variant('none', null),
94
+ * });
95
+ *
96
+ * const sheet = $.let(Format.XLSX.read(xlsxBlob, options));
97
+ * $.return(sheet.size());
98
+ * });
99
+ *
100
+ * const compiled = East.compile(countRows.toIR(), Format.XLSX.Implementation);
101
+ * const blob = new Uint8Array([]);
102
+ * compiled(blob); // 100n
103
+ * ```
104
+ */
105
+ read: xlsx_read,
106
+ /**
107
+ * Writes a 2D array of cell values to an XLSX file.
108
+ *
109
+ * Creates an Excel file from a 2D array of literal values.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * import { East, BlobType, variant } from "@elaraai/east";
114
+ * import { Format } from "@elaraai/east-node-io";
115
+ *
116
+ * const createExcel = East.function([], BlobType, $ => {
117
+ * const data = $.let([
118
+ * [variant('String', "Name"), variant('String', "Age")],
119
+ * [variant('String', "Alice"), variant('Float', 30)],
120
+ * ], Format.XLSX.Types.Sheet);
121
+ *
122
+ * const options = $.let({
123
+ * sheetName: variant('some', "People"),
124
+ * });
125
+ *
126
+ * const blob = $.let(Format.XLSX.write(data, options));
127
+ * $.return(blob);
128
+ * });
129
+ *
130
+ * const compiled = East.compile(createExcel.toIR(), Format.XLSX.Implementation);
131
+ * const xlsxBlob = compiled();
132
+ * ```
133
+ */
134
+ write: xlsx_write,
135
+ /**
136
+ * Gets metadata about an XLSX file.
137
+ *
138
+ * Returns sheet names and approximate sizes without reading all data.
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * import { East, BlobType, IntegerType, variant } from "@elaraai/east";
143
+ * import { Format } from "@elaraai/east-node-io";
144
+ *
145
+ * const countSheets = East.function([BlobType], IntegerType, ($, xlsxBlob) => {
146
+ * const info = $.let(Format.XLSX.info(xlsxBlob));
147
+ * $.return(info.sheets.size());
148
+ * });
149
+ *
150
+ * const compiled = East.compile(countSheets.toIR(), Format.XLSX.Implementation);
151
+ * const blob = new Uint8Array([]);
152
+ * compiled(blob); // 3n
153
+ * ```
154
+ */
155
+ info: xlsx_info,
156
+ /**
157
+ * Node.js implementation of XLSX platform functions.
158
+ *
159
+ * Pass this to {@link East.compile} to enable XLSX operations.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * import { East, BlobType, NullType, variant } from "@elaraai/east";
164
+ * import { Format } from "@elaraai/east-node-io";
165
+ *
166
+ * const myFunction = East.function([BlobType], NullType, ($, xlsxBlob) => {
167
+ * const options = $.let({
168
+ * sheetName: variant('none', null),
169
+ * });
170
+ * const sheet = $.let(Format.XLSX.read(xlsxBlob, options));
171
+ * $.return(null);
172
+ * });
173
+ *
174
+ * const compiled = East.compile(myFunction.toIR(), Format.XLSX.Implementation);
175
+ * const blob = new Uint8Array([]);
176
+ * compiled(blob);
177
+ * ```
178
+ */
179
+ Implementation: XlsxImpl,
180
+ /**
181
+ * Type definitions for XLSX operations.
182
+ */
183
+ Types: {
184
+ /**
185
+ * A single cell value in a spreadsheet (LiteralValueType).
186
+ */
187
+ Cell: XlsxCellType,
188
+ /**
189
+ * A row of cells in a spreadsheet.
190
+ */
191
+ Row: XlsxRowType,
192
+ /**
193
+ * A 2D array representing a complete worksheet.
194
+ */
195
+ Sheet: XlsxSheetType,
196
+ /**
197
+ * XLSX read options configuration.
198
+ */
199
+ ReadOptions: XlsxReadOptionsType,
200
+ /**
201
+ * XLSX write options configuration.
202
+ */
203
+ WriteOptions: XlsxWriteOptionsType,
204
+ /**
205
+ * Information about a single sheet in an XLSX file.
206
+ */
207
+ SheetInfo: XlsxSheetInfoType,
208
+ /**
209
+ * XLSX file metadata with sheet listing.
210
+ */
211
+ Info: XlsxInfoType,
212
+ },
213
+ },
214
+ /**
215
+ * CSV (Comma-Separated Values) file format operations.
216
+ *
217
+ * Provides functions for parsing and serializing CSV files as arrays of dictionaries,
218
+ * where each row is a dictionary mapping column names to optional string values.
219
+ */
220
+ CSV: {
221
+ /**
222
+ * Parses CSV data from a binary blob into structured row data.
223
+ *
224
+ * Converts CSV-formatted binary data into an array of row dictionaries,
225
+ * where each dictionary maps column names to optional string values.
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * import { East, BlobType, variant } from "@elaraai/east";
230
+ * import { Format } from "@elaraai/east-node-io";
231
+ *
232
+ * const parseCSV = East.function([BlobType], Format.CSV.Types.Data, ($, csvBlob) => {
233
+ * const config = $.let({
234
+ * delimiter: variant('none', null),
235
+ * quoteChar: variant('none', null),
236
+ * escapeChar: variant('none', null),
237
+ * newline: variant('none', null),
238
+ * hasHeader: true,
239
+ * nullString: variant('some', ""),
240
+ * skipEmptyLines: true,
241
+ * trimFields: false,
242
+ * });
243
+ *
244
+ * return $.return(Format.CSV.parse(csvBlob, config));
245
+ * });
246
+ *
247
+ * const compiled = East.compile(parseCSV.toIR(), Format.CSV.Implementation);
248
+ * const csvBlob = new TextEncoder().encode("name,age\nAlice,30\nBob,25");
249
+ * compiled(csvBlob); // Returns parsed CSV data
250
+ * ```
251
+ */
252
+ parse: csv_parse,
253
+ /**
254
+ * Serializes structured row data into CSV-formatted binary data.
255
+ *
256
+ * Converts an array of row dictionaries into CSV-formatted binary data
257
+ * with configurable formatting options.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * import { East, BlobType, variant } from "@elaraai/east";
262
+ * import { Format } from "@elaraai/east-node-io";
263
+ *
264
+ * const serializeCSV = East.function([Format.CSV.Types.Data], BlobType, ($, data) => {
265
+ * const config = $.let({
266
+ * delimiter: ",",
267
+ * quoteChar: '"',
268
+ * escapeChar: '"',
269
+ * newline: "\n",
270
+ * includeHeader: true,
271
+ * nullString: "",
272
+ * alwaysQuote: false,
273
+ * });
274
+ *
275
+ * return $.return(Format.CSV.serialize(data, config));
276
+ * });
277
+ *
278
+ * const compiled = East.compile(serializeCSV.toIR(), Format.CSV.Implementation);
279
+ * const data = [new Map([["name", variant("some", "Alice")], ["age", variant("some", "30")]])];
280
+ * compiled(data); // Returns CSV blob
281
+ * ```
282
+ */
283
+ serialize: csv_serialize,
284
+ /**
285
+ * Node.js implementation of CSV platform functions.
286
+ *
287
+ * Pass this to {@link East.compile} to enable CSV operations.
288
+ *
289
+ * @example
290
+ * ```ts
291
+ * import { East, BlobType } from "@elaraai/east";
292
+ * import { Format } from "@elaraai/east-node-io";
293
+ *
294
+ * const myFunction = East.function([BlobType], BlobType, ($, csvBlob) => {
295
+ * const parseConfig = $.let({
296
+ * delimiter: variant('none', null),
297
+ * quoteChar: variant('none', null),
298
+ * escapeChar: variant('none', null),
299
+ * newline: variant('none', null),
300
+ * hasHeader: true,
301
+ * nullString: variant('none', null),
302
+ * skipEmptyLines: true,
303
+ * trimFields: false,
304
+ * });
305
+ *
306
+ * const data = $.let(Format.CSV.parse(csvBlob, parseConfig));
307
+ *
308
+ * const serializeConfig = $.let({
309
+ * delimiter: ",",
310
+ * quoteChar: '"',
311
+ * escapeChar: '"',
312
+ * newline: "\n",
313
+ * includeHeader: true,
314
+ * nullString: "",
315
+ * alwaysQuote: false,
316
+ * });
317
+ *
318
+ * return $.return(Format.CSV.serialize(data, serializeConfig));
319
+ * });
320
+ *
321
+ * const compiled = East.compile(myFunction.toIR(), Format.CSV.Implementation);
322
+ * const csvBlob = new TextEncoder().encode("name,age\nAlice,30");
323
+ * compiled(csvBlob);
324
+ * ```
325
+ */
326
+ Implementation: CsvImpl,
327
+ /**
328
+ * Type definitions for CSV operations.
329
+ */
330
+ Types: {
331
+ /**
332
+ * CSV parse configuration options.
333
+ */
334
+ ParseConfig: CsvParseConfig,
335
+ /**
336
+ * CSV serialize configuration options.
337
+ */
338
+ SerializeConfig: CsvSerializeConfig,
339
+ /**
340
+ * A row in a CSV file (dictionary mapping column names to optional string values).
341
+ */
342
+ Row: CsvRowType,
343
+ /**
344
+ * CSV data as an array of rows.
345
+ */
346
+ Data: CsvDataType,
347
+ },
348
+ },
349
+ /**
350
+ * XML (Extensible Markup Language) file format operations.
351
+ *
352
+ * Provides functions for parsing and serializing XML files as recursive tree structures,
353
+ * where each node contains a tag name, attributes dictionary, and children array.
354
+ */
355
+ XML: {
356
+ /**
357
+ * Parses XML data from a binary blob into a recursive tree structure.
358
+ *
359
+ * Converts XML-formatted binary data into an XmlNode recursive structure.
360
+ * Supports XML declarations, namespaces, CDATA, entity decoding, and comments.
361
+ *
362
+ * @example
363
+ * ```ts
364
+ * import { East, BlobType } from "@elaraai/east";
365
+ * import { Format } from "@elaraai/east-node-io";
366
+ *
367
+ * const parseXML = East.function([BlobType], Format.XML.Types.Node, ($, xmlBlob) => {
368
+ * const config = $.let({
369
+ * preserveWhitespace: false,
370
+ * decodeEntities: true,
371
+ * });
372
+ *
373
+ * return $.return(Format.XML.parse(xmlBlob, config));
374
+ * });
375
+ *
376
+ * const compiled = East.compile(parseXML.toIR(), Format.XML.Implementation);
377
+ * const xmlBlob = new TextEncoder().encode("<book id='123'><title>East Guide</title></book>");
378
+ * compiled(xmlBlob); // Returns parsed XML tree
379
+ * ```
380
+ */
381
+ parse: xml_parse,
382
+ /**
383
+ * Serializes a recursive XML tree structure into XML-formatted binary data.
384
+ *
385
+ * Converts an XmlNode recursive structure into XML-formatted binary data.
386
+ * Supports indentation, XML declarations, entity encoding, and self-closing tags.
387
+ *
388
+ * @example
389
+ * ```ts
390
+ * import { East, BlobType, variant } from "@elaraai/east";
391
+ * import { Format } from "@elaraai/east-node-io";
392
+ *
393
+ * const serializeXML = East.function([Format.XML.Types.Node], BlobType, ($, doc) => {
394
+ * const config = $.let({
395
+ * indent: variant('some', " "),
396
+ * includeXmlDeclaration: true,
397
+ * encodeEntities: true,
398
+ * selfClosingTags: true,
399
+ * });
400
+ *
401
+ * return $.return(Format.XML.serialize(doc, config));
402
+ * });
403
+ *
404
+ * const compiled = East.compile(serializeXML.toIR(), Format.XML.Implementation);
405
+ * const xmlNode = { tag: "book", attributes: new Map([["id", "123"]]), children: [] };
406
+ * compiled(xmlNode); // Returns XML blob
407
+ * ```
408
+ */
409
+ serialize: xml_serialize,
410
+ /**
411
+ * Node.js implementation of XML platform functions.
412
+ *
413
+ * Pass this to {@link East.compile} to enable XML operations.
414
+ *
415
+ * @example
416
+ * ```ts
417
+ * import { East, BlobType, variant } from "@elaraai/east";
418
+ * import { Format } from "@elaraai/east-node-io";
419
+ *
420
+ * const myFunction = East.function([BlobType], BlobType, ($, xmlBlob) => {
421
+ * const parseConfig = $.let({
422
+ * preserveWhitespace: false,
423
+ * decodeEntities: true,
424
+ * });
425
+ *
426
+ * const doc = $.let(Format.XML.parse(xmlBlob, parseConfig));
427
+ *
428
+ * const serializeConfig = $.let({
429
+ * indent: variant('some', " "),
430
+ * includeXmlDeclaration: true,
431
+ * encodeEntities: true,
432
+ * selfClosingTags: true,
433
+ * });
434
+ *
435
+ * return $.return(Format.XML.serialize(doc, serializeConfig));
436
+ * });
437
+ *
438
+ * const compiled = East.compile(myFunction.toIR(), Format.XML.Implementation);
439
+ * const xmlBlob = new TextEncoder().encode("<book><title>East</title></book>");
440
+ * compiled(xmlBlob);
441
+ * ```
442
+ */
443
+ Implementation: XmlImpl,
444
+ /**
445
+ * Type definitions for XML operations.
446
+ */
447
+ Types: {
448
+ /**
449
+ * XML parsing configuration type.
450
+ */
451
+ ParseConfig: XmlParseConfig,
452
+ /**
453
+ * XML serialization configuration type.
454
+ */
455
+ SerializeConfig: XmlSerializeConfig,
456
+ /**
457
+ * XML node recursive type (element with tag, attributes, and children).
458
+ */
459
+ Node: XmlNode,
460
+ },
461
+ },
462
+ };
463
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * XLSX type definitions for East Node IO.
7
+ *
8
+ * Provides East type definitions for reading and writing Excel (XLSX) files,
9
+ * representing spreadsheets as 2D arrays of literal values.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+ import { StructType, OptionType, ArrayType, DictType, StringType, IntegerType } from "@elaraai/east";
14
+ /**
15
+ * A single cell value in a spreadsheet.
16
+ *
17
+ * Can be a string, number, boolean, or null. Matches the LiteralValueType
18
+ * which supports all primitive JavaScript values that can appear in Excel cells.
19
+ */
20
+ export declare const XlsxCellType: import("@elaraai/east").VariantType<{
21
+ Null: import("@elaraai/east").NullType;
22
+ Boolean: import("@elaraai/east").BooleanType;
23
+ Integer: IntegerType;
24
+ Float: import("@elaraai/east").FloatType;
25
+ String: StringType;
26
+ DateTime: import("@elaraai/east").DateTimeType;
27
+ Blob: import("@elaraai/east").BlobType;
28
+ }>;
29
+ /**
30
+ * A row of cells in a spreadsheet.
31
+ *
32
+ * Represents a single row as an array of cell values.
33
+ */
34
+ export declare const XlsxRowType: ArrayType<import("@elaraai/east").VariantType<{
35
+ Null: import("@elaraai/east").NullType;
36
+ Boolean: import("@elaraai/east").BooleanType;
37
+ Integer: IntegerType;
38
+ Float: import("@elaraai/east").FloatType;
39
+ String: StringType;
40
+ DateTime: import("@elaraai/east").DateTimeType;
41
+ Blob: import("@elaraai/east").BlobType;
42
+ }>>;
43
+ /**
44
+ * A 2D array representing a complete worksheet.
45
+ *
46
+ * Array of rows, where each row is an array of cell values.
47
+ * This is the main data structure for reading/writing XLSX files.
48
+ */
49
+ export declare const XlsxSheetType: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
50
+ Null: import("@elaraai/east").NullType;
51
+ Boolean: import("@elaraai/east").BooleanType;
52
+ Integer: IntegerType;
53
+ Float: import("@elaraai/east").FloatType;
54
+ String: StringType;
55
+ DateTime: import("@elaraai/east").DateTimeType;
56
+ Blob: import("@elaraai/east").BlobType;
57
+ }>>>;
58
+ /**
59
+ * XLSX read options configuration.
60
+ *
61
+ * Controls how Excel files are parsed when reading.
62
+ */
63
+ export declare const XlsxReadOptionsType: StructType<{
64
+ /**
65
+ * Name of the sheet to read.
66
+ * If not specified, reads the first sheet.
67
+ */
68
+ sheetName: OptionType<StringType>;
69
+ }>;
70
+ /**
71
+ * XLSX write options configuration.
72
+ *
73
+ * Controls how data is written to Excel files.
74
+ */
75
+ export declare const XlsxWriteOptionsType: StructType<{
76
+ /**
77
+ * Name of the sheet to create.
78
+ * Defaults to "Sheet1" if not specified.
79
+ */
80
+ sheetName: OptionType<StringType>;
81
+ }>;
82
+ /**
83
+ * Information about sheets in an XLSX file.
84
+ */
85
+ export declare const XlsxSheetInfoType: StructType<{
86
+ /** Sheet name */
87
+ name: StringType;
88
+ /** Number of rows (approximate) */
89
+ rowCount: IntegerType;
90
+ /** Number of columns (approximate) */
91
+ columnCount: IntegerType;
92
+ }>;
93
+ /**
94
+ * XLSX file metadata and sheet listing.
95
+ */
96
+ export declare const XlsxInfoType: StructType<{
97
+ /** List of sheets in the workbook */
98
+ sheets: ArrayType<StructType<{
99
+ /** Sheet name */
100
+ name: StringType;
101
+ /** Number of rows (approximate) */
102
+ rowCount: IntegerType;
103
+ /** Number of columns (approximate) */
104
+ columnCount: IntegerType;
105
+ }>>;
106
+ }>;
107
+ /**
108
+ * A single cell value in a CSV file.
109
+ *
110
+ * Can be a string, number, boolean, or null. Matches the LiteralValueType
111
+ * which supports all primitive JavaScript values that can appear in CSV cells.
112
+ */
113
+ export declare const CsvCellType: import("@elaraai/east").VariantType<{
114
+ Null: import("@elaraai/east").NullType;
115
+ Boolean: import("@elaraai/east").BooleanType;
116
+ Integer: IntegerType;
117
+ Float: import("@elaraai/east").FloatType;
118
+ String: StringType;
119
+ DateTime: import("@elaraai/east").DateTimeType;
120
+ Blob: import("@elaraai/east").BlobType;
121
+ }>;
122
+ /**
123
+ * A row of cells in a CSV file represented as a dictionary.
124
+ *
125
+ * Maps column names (from the header row) to cell values.
126
+ * This allows accessing cells by name rather than index.
127
+ */
128
+ export declare const CsvRowType: DictType<StringType, import("@elaraai/east").VariantType<{
129
+ Null: import("@elaraai/east").NullType;
130
+ Boolean: import("@elaraai/east").BooleanType;
131
+ Integer: IntegerType;
132
+ Float: import("@elaraai/east").FloatType;
133
+ String: StringType;
134
+ DateTime: import("@elaraai/east").DateTimeType;
135
+ Blob: import("@elaraai/east").BlobType;
136
+ }>>;
137
+ /**
138
+ * CSV data as an array of rows.
139
+ *
140
+ * Each row is a dictionary mapping column names to values.
141
+ * The first row of the CSV file is used as column headers.
142
+ */
143
+ export declare const CsvDataType: ArrayType<DictType<StringType, import("@elaraai/east").VariantType<{
144
+ Null: import("@elaraai/east").NullType;
145
+ Boolean: import("@elaraai/east").BooleanType;
146
+ Integer: IntegerType;
147
+ Float: import("@elaraai/east").FloatType;
148
+ String: StringType;
149
+ DateTime: import("@elaraai/east").DateTimeType;
150
+ Blob: import("@elaraai/east").BlobType;
151
+ }>>>;
152
+ /**
153
+ * CSV read options configuration.
154
+ *
155
+ * Controls how CSV files are parsed when reading.
156
+ */
157
+ export declare const CsvReadOptionsType: StructType<{
158
+ /**
159
+ * Delimiter character.
160
+ * Defaults to "," if not specified.
161
+ */
162
+ delimiter: OptionType<StringType>;
163
+ }>;
164
+ /**
165
+ * CSV write options configuration.
166
+ *
167
+ * Controls how data is written to CSV files.
168
+ */
169
+ export declare const CsvWriteOptionsType: StructType<{
170
+ /**
171
+ * Delimiter character.
172
+ * Defaults to "," if not specified.
173
+ */
174
+ delimiter: OptionType<StringType>;
175
+ }>;
176
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/format/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACH,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACd,MAAM,eAAe,CAAC;AAGvB;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;EAAmB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;GAA0B,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;IAAyB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;IAC5B;;;OAGG;;EAEL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAC7B;;;OAGG;;EAEL,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC1B,iBAAiB;;IAGjB,mCAAmC;;IAGnC,sCAAsC;;EAExC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;IACrB,qCAAqC;;QAdrC,iBAAiB;;QAGjB,mCAAmC;;QAGnC,sCAAsC;;;EAUxC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;EAAmB,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;;GAAoC,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;IAAwB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;IAC3B;;;OAGG;;EAEL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;IAC5B;;;OAGG;;EAEL,CAAC"}