@rowsncolumns/toolkit 24.5.17 → 24.5.19

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 (53) hide show
  1. package/dist/cjs/excel-parser/defined-names.d.ts +18 -0
  2. package/dist/cjs/excel-parser/defined-names.d.ts.map +1 -0
  3. package/dist/cjs/excel-parser/defined-names.js +59 -0
  4. package/dist/cjs/excel-parser/interface.d.ts +7 -1
  5. package/dist/cjs/excel-parser/interface.d.ts.map +1 -1
  6. package/dist/cjs/excel-parser/plugins/xlsb/function-table.d.ts +17 -0
  7. package/dist/cjs/excel-parser/plugins/xlsb/function-table.d.ts.map +1 -0
  8. package/dist/cjs/excel-parser/plugins/xlsb/function-table.js +988 -0
  9. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts +45 -3
  10. package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
  11. package/dist/cjs/excel-parser/plugins/xlsb/index.js +406 -374
  12. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts +43 -9
  13. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -1
  14. package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.js +422 -478
  15. package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
  16. package/dist/cjs/excel-parser/plugins/xlsx/index.js +147 -191
  17. package/dist/cjs/excel-parser/types.d.ts +17 -0
  18. package/dist/cjs/excel-parser/types.d.ts.map +1 -1
  19. package/dist/cjs/excel-parser/workbook.d.ts +1 -0
  20. package/dist/cjs/excel-parser/workbook.d.ts.map +1 -1
  21. package/dist/cjs/excel-parser/workbook.js +4 -0
  22. package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -1
  23. package/dist/cjs/exporter/ods/ods-export.js +6 -3
  24. package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -1
  25. package/dist/cjs/exporter/xlsx/xlsx-export.js +47 -23
  26. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  27. package/dist/esm/excel-parser/defined-names.d.ts +18 -0
  28. package/dist/esm/excel-parser/defined-names.d.ts.map +1 -0
  29. package/dist/esm/excel-parser/defined-names.js +67 -0
  30. package/dist/esm/excel-parser/interface.d.ts +7 -1
  31. package/dist/esm/excel-parser/interface.d.ts.map +1 -1
  32. package/dist/esm/excel-parser/plugins/xlsb/function-table.d.ts +17 -0
  33. package/dist/esm/excel-parser/plugins/xlsb/function-table.d.ts.map +1 -0
  34. package/dist/esm/excel-parser/plugins/xlsb/function-table.js +988 -0
  35. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts +45 -3
  36. package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
  37. package/dist/esm/excel-parser/plugins/xlsb/index.js +266 -205
  38. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts +43 -9
  39. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -1
  40. package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.js +405 -472
  41. package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
  42. package/dist/esm/excel-parser/plugins/xlsx/index.js +9 -58
  43. package/dist/esm/excel-parser/types.d.ts +17 -0
  44. package/dist/esm/excel-parser/types.d.ts.map +1 -1
  45. package/dist/esm/excel-parser/workbook.d.ts +1 -0
  46. package/dist/esm/excel-parser/workbook.d.ts.map +1 -1
  47. package/dist/esm/excel-parser/workbook.js +3 -0
  48. package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -1
  49. package/dist/esm/exporter/ods/ods-export.js +6 -3
  50. package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -1
  51. package/dist/esm/exporter/xlsx/xlsx-export.js +28 -6
  52. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  53. package/package.json +2 -2
@@ -1,18 +1,52 @@
1
1
  /**
2
- * Parse Rgce (Reverse Polish Notation Compiled Expression) - binary formula format in XLSB
3
- * This converts binary Ptg (Parsed Token) tokens into a formula string
2
+ * Decoder for a BIFF12 formula's token stream (`rgce`, [MS-XLSB] 2.2.2 / 2.5.97.88):
3
+ * reverse-Polish tokens rebuilt into the formula's text.
4
4
  *
5
- * @param rgceBytes - The binary formula data
6
- * @returns The formula string (without leading "=")
5
+ * Strict by design: a formula decodes completely or not at all. A token it
6
+ * does not know, a function outside the table, a read past the end of the
7
+ * stream or a stack that does not end with exactly one expression throws
8
+ * {@link RgceUnsupportedError}, and the caller keeps the cell's cached value
9
+ * instead of writing a formula that computes something else.
7
10
  */
11
+ /** The formula cannot be decoded exactly; keep the cell's cached value. */
12
+ export declare class RgceUnsupportedError extends Error {
13
+ constructor(message: string);
14
+ }
15
+ export type RgceContext = {
16
+ /** The sheet an XTI index names (`PtgRef3d`/`PtgArea3d`); `undefined` when unknown. */
17
+ sheetName?: (ixti: number) => string | undefined;
18
+ /**
19
+ * The name a 1-based `PtgName` index refers to, already qualified with its
20
+ * sheet when the formula's sheet must say which one (`Sheet2!Local`).
21
+ */
22
+ definedName?: (index: number) => string | undefined;
23
+ /** The cell relative references (`PtgRefN`/`PtgAreaN`) are relative to, 1-based. */
24
+ baseCell?: {
25
+ row: number;
26
+ col: number;
27
+ };
28
+ };
8
29
  /**
9
- * Parse Rgce with sheet names for cross-sheet references
10
- * @param rgceBytes - The binary formula data
11
- * @param sheetNames - Array of sheet names for resolving external references
12
- * @returns The formula string (without leading "=")
30
+ * A sheet name as a reference prefix: quoted unless it is a plain ASCII
31
+ * identifier no reader could take for a cell (`A1`, `R1C1`, `R`) or a
32
+ * boolean. Quoting is always valid, so anything else is quoted.
33
+ */
34
+ export declare const quoteSheetName: (name: string) => string;
35
+ /**
36
+ * Decode a formula's tokens into its text, without the leading `=`.
37
+ *
38
+ * Throws {@link RgceUnsupportedError} when any part of the formula cannot be
39
+ * decoded exactly.
40
+ */
41
+ export declare function decodeRgce(rgce: Uint8Array, context?: RgceContext): string;
42
+ /**
43
+ * A formula's text, or `""` when it cannot be decoded exactly — never a part of
44
+ * one. Prefer {@link decodeRgce}, which says why.
45
+ *
46
+ * @deprecated the lenient form of {@link decodeRgce}.
13
47
  */
14
48
  export declare function parseRgce(rgceBytes: Uint8Array, sheetRefResolver?: string[] | ((ixti: number) => string | undefined), baseCell?: {
15
49
  row: number;
16
50
  col: number;
17
- }, debug?: boolean): string;
51
+ }): string;
18
52
  //# sourceMappingURL=rgce-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rgce-parser.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsb/rgce-parser.ts"],"names":[],"mappings":"AAuHA;;;;;;GAMG;AACH;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,UAAU,EACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,EACpE,QAAQ,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,KAAK,UAAQ,GACZ,MAAM,CAqaR"}
1
+ {"version":3,"file":"rgce-parser.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsb/rgce-parser.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,uFAAuF;IACvF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACjD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD,oFAAoF;IACpF,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,CAAC;AA+FF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,MAMT,CAAC;AA2DtC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CAoR9E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,UAAU,EACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,EACpE,QAAQ,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtC,MAAM,CAYR"}