@rowsncolumns/fast-formula-parser 6.2.35 → 6.2.36

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.
package/index.d.ts CHANGED
@@ -109,6 +109,17 @@ declare module "@rowsncolumns/fast-formula-parser" {
109
109
  row?: number;
110
110
  sheet?: string;
111
111
  }) => CellRange | FormulaError | undefined;
112
+ /**
113
+ * Resolve a 3-D reference span (`Sheet1:Sheet3!A1`): return every sheet
114
+ * name between `first` and `last` in tab order (inclusive, regardless of
115
+ * which endpoint is written first), or a `FormulaError` (`#REF!`) when an
116
+ * endpoint is not a sheet (`undefined` is treated as `#REF!`). Without the
117
+ * callback the prefix is looked up as a single sheet name (legacy reading).
118
+ */
119
+ onSheetRange?: (
120
+ first: string,
121
+ last: string,
122
+ ) => string[] | FormulaError | undefined;
112
123
  /**
113
124
  * Report row visibility so SUBTOTAL can exclude hidden rows.
114
125
  * Filtered-out rows are excluded for every function_number;
@@ -118,6 +129,16 @@ declare module "@rowsncolumns/fast-formula-parser" {
118
129
  sheet?: string;
119
130
  row: number;
120
131
  }) => { hiddenByFilter?: boolean; hiddenByUser?: boolean } | undefined;
132
+ /**
133
+ * Formula text stored in a cell, or undefined for non-formula cells.
134
+ * SUBTOTAL / AGGREGATE use it to skip nested SUBTOTAL / AGGREGATE
135
+ * results, as Excel does.
136
+ */
137
+ onCellFormula?: (ref: {
138
+ sheet?: string;
139
+ row: number;
140
+ col: number;
141
+ }) => string | undefined;
121
142
  webServiceProvider?: (
122
143
  url: string,
123
144
  ) =>
@@ -208,7 +229,10 @@ declare module "@rowsncolumns/fast-formula-parser" {
208
229
  }
209
230
 
210
231
  export interface DepParserConfig
211
- extends Pick<FormulaParserConfig, "onVariable" | "onStructuredReference"> {}
232
+ extends Pick<
233
+ FormulaParserConfig,
234
+ "onVariable" | "onStructuredReference" | "onSheetRange"
235
+ > {}
212
236
  export class DepParser {
213
237
  constructor(config: DepParserConfig);
214
238
  parse: (text: string, position: CellCoords) => CellCoords[] | CellRange[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/fast-formula-parser",
3
- "version": "6.2.35",
3
+ "version": "6.2.36",
4
4
  "description": "fast excel formula parser",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -44,7 +44,7 @@
44
44
  "author": "Lester(Dishu) Lyu",
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
- "@rowsncolumns/utils": ">=9.2.39",
47
+ "@rowsncolumns/utils": ">=9.2.40",
48
48
  "bahttext": "^2.3.0",
49
49
  "bessel": "^1.0.2",
50
50
  "chevrotain": "^10.5.0",
@@ -57,7 +57,7 @@
57
57
  "@babel/preset-typescript": "^7.29.7",
58
58
  "@rollup/plugin-commonjs": "^28.0.3",
59
59
  "@rollup/plugin-node-resolve": "^16.0.1",
60
- "@rowsncolumns/common-types": ">=5.2.30",
60
+ "@rowsncolumns/common-types": ">=5.2.31",
61
61
  "rollup": "^4.41.1"
62
62
  }
63
63
  }