@univerjs/engine-formula 0.21.0 → 0.21.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.
package/lib/index.js CHANGED
@@ -1780,24 +1780,44 @@ let DefinedNamesService = class DefinedNamesService extends Disposable {
1780
1780
  registerDefinedNames(unitId, params) {
1781
1781
  this._definedNameMap[unitId] = params;
1782
1782
  this._updateCache(unitId);
1783
- this._update();
1783
+ this._update({
1784
+ type: "update",
1785
+ unitId,
1786
+ definedNames: Object.values(params)
1787
+ });
1784
1788
  }
1785
1789
  registerDefinedName(unitId, param) {
1786
1790
  if (this._definedNameMap[unitId] === void 0) this._definedNameMap[unitId] = {};
1787
1791
  this._definedNameMap[unitId][param.id] = param;
1788
1792
  this._updateCache(unitId);
1789
- this._update();
1793
+ this._update({
1794
+ type: "update",
1795
+ unitId,
1796
+ definedNames: [param]
1797
+ });
1790
1798
  }
1791
1799
  removeDefinedName(unitId, id) {
1792
1800
  var _this$_definedNameMap;
1793
- (_this$_definedNameMap = this._definedNameMap[unitId]) === null || _this$_definedNameMap === void 0 || delete _this$_definedNameMap[id];
1801
+ const definedName = (_this$_definedNameMap = this._definedNameMap[unitId]) === null || _this$_definedNameMap === void 0 ? void 0 : _this$_definedNameMap[id];
1802
+ if (!definedName) return;
1803
+ delete this._definedNameMap[unitId][id];
1794
1804
  this._updateCache(unitId);
1795
- this._update();
1805
+ this._update({
1806
+ type: "remove",
1807
+ unitId,
1808
+ definedNames: [definedName]
1809
+ });
1796
1810
  }
1797
1811
  removeUnitDefinedName(unitId) {
1812
+ const definedNames = this._definedNameMap[unitId];
1813
+ if (!definedNames) return;
1798
1814
  delete this._definedNameMap[unitId];
1799
1815
  this._updateCache(unitId);
1800
- this._update();
1816
+ this._update({
1817
+ type: "remove",
1818
+ unitId,
1819
+ definedNames: Object.values(definedNames)
1820
+ });
1801
1821
  }
1802
1822
  getDefinedNameMap(unitId) {
1803
1823
  return this._definedNameMap[unitId];
@@ -1833,8 +1853,8 @@ let DefinedNamesService = class DefinedNamesService extends Disposable {
1833
1853
  if (!this._definedNameMap[unitId]) return;
1834
1854
  for (const [_, item] of Object.entries(this._definedNameMap[unitId])) if (item.formulaOrRefString === formulaOrRefString) return item;
1835
1855
  }
1836
- _update() {
1837
- this._update$.next(null);
1856
+ _update(event) {
1857
+ this._update$.next(event);
1838
1858
  }
1839
1859
  _updateCache(unitId) {
1840
1860
  const nameMap = this._definedNameMap[unitId];
@@ -1853,14 +1873,13 @@ const IDefinedNamesService = createIdentifier("univer.formula.defined-names.serv
1853
1873
  //#region src/commands/mutations/set-defined-name.mutation.ts
1854
1874
  /**
1855
1875
  * Generate undo mutation of a `SetDefinedNameMutation`
1856
- * @param accessor
1857
- * @param params
1858
- * @returns
1859
1876
  */
1860
1877
  const SetDefinedNameMutationFactory = (accessor, params) => {
1861
1878
  const { unitId, id } = params;
1879
+ const definedName = accessor.get(IDefinedNamesService).getValueById(unitId, id);
1880
+ if (!definedName) return null;
1862
1881
  return {
1863
- ...accessor.get(IDefinedNamesService).getValueById(unitId, id),
1882
+ ...definedName,
1864
1883
  unitId
1865
1884
  };
1866
1885
  };
@@ -9708,6 +9727,9 @@ var FunctionService = class extends Disposable {
9708
9727
  this._functionDescriptions.delete(functionToken);
9709
9728
  }
9710
9729
  }
9730
+ clearDescriptions() {
9731
+ this._functionDescriptions.clear();
9732
+ }
9711
9733
  deleteFormulaAstCacheKey(...functionToken) {
9712
9734
  FORMULA_AST_CACHE.forEach((_, key) => {
9713
9735
  functionToken.forEach((token) => {
@@ -33736,152 +33758,6 @@ const functionMeta = [
33736
33758
  [Cube, FUNCTION_NAMES_META.CUBE]
33737
33759
  ];
33738
33760
 
33739
- //#endregion
33740
- //#region src/functions/new-excel-functions.ts
33741
- const NEW_EXCEL_FUNCTIONS = new Set([
33742
- FUNCTION_NAMES_MATH.ACOT,
33743
- FUNCTION_NAMES_MATH.ACOTH,
33744
- FUNCTION_NAMES_MATH.ARABIC,
33745
- FUNCTION_NAMES_MATH.BASE,
33746
- FUNCTION_NAMES_MATH.CEILING_MATH,
33747
- FUNCTION_NAMES_MATH.CEILING_PRECISE,
33748
- FUNCTION_NAMES_MATH.COMBINA,
33749
- FUNCTION_NAMES_MATH.COT,
33750
- FUNCTION_NAMES_MATH.COTH,
33751
- FUNCTION_NAMES_MATH.CSC,
33752
- FUNCTION_NAMES_MATH.CSCH,
33753
- FUNCTION_NAMES_MATH.DECIMAL,
33754
- FUNCTION_NAMES_MATH.FLOOR_MATH,
33755
- FUNCTION_NAMES_MATH.FLOOR_PRECISE,
33756
- FUNCTION_NAMES_MATH.MUNIT,
33757
- FUNCTION_NAMES_MATH.RANDARRAY,
33758
- FUNCTION_NAMES_MATH.SEC,
33759
- FUNCTION_NAMES_MATH.SECH,
33760
- FUNCTION_NAMES_MATH.SEQUENCE,
33761
- FUNCTION_NAMES_LOOKUP.CHOOSECOLS,
33762
- FUNCTION_NAMES_LOOKUP.CHOOSEROWS,
33763
- FUNCTION_NAMES_LOOKUP.DROP,
33764
- FUNCTION_NAMES_LOOKUP.EXPAND,
33765
- FUNCTION_NAMES_LOOKUP.FILTER,
33766
- FUNCTION_NAMES_LOOKUP.FORMULATEXT,
33767
- FUNCTION_NAMES_LOOKUP.HSTACK,
33768
- FUNCTION_NAMES_LOOKUP.SORT,
33769
- FUNCTION_NAMES_LOOKUP.SORTBY,
33770
- FUNCTION_NAMES_LOOKUP.TAKE,
33771
- FUNCTION_NAMES_LOOKUP.TOCOL,
33772
- FUNCTION_NAMES_LOOKUP.TOROW,
33773
- FUNCTION_NAMES_LOOKUP.UNIQUE,
33774
- FUNCTION_NAMES_LOOKUP.VSTACK,
33775
- FUNCTION_NAMES_LOOKUP.WRAPCOLS,
33776
- FUNCTION_NAMES_LOOKUP.WRAPROWS,
33777
- FUNCTION_NAMES_LOOKUP.XLOOKUP,
33778
- FUNCTION_NAMES_LOOKUP.XMATCH,
33779
- FUNCTION_NAMES_ENGINEERING.BITAND,
33780
- FUNCTION_NAMES_ENGINEERING.BITLSHIFT,
33781
- FUNCTION_NAMES_ENGINEERING.BITOR,
33782
- FUNCTION_NAMES_ENGINEERING.BITRSHIFT,
33783
- FUNCTION_NAMES_ENGINEERING.BITXOR,
33784
- FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,
33785
- FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,
33786
- FUNCTION_NAMES_ENGINEERING.IMCOSH,
33787
- FUNCTION_NAMES_ENGINEERING.IMCOT,
33788
- FUNCTION_NAMES_ENGINEERING.IMCSC,
33789
- FUNCTION_NAMES_ENGINEERING.IMCSCH,
33790
- FUNCTION_NAMES_ENGINEERING.IMSEC,
33791
- FUNCTION_NAMES_ENGINEERING.IMSECH,
33792
- FUNCTION_NAMES_ENGINEERING.IMSINH,
33793
- FUNCTION_NAMES_ENGINEERING.IMTAN,
33794
- FUNCTION_NAMES_INFORMATION.ISFORMULA,
33795
- FUNCTION_NAMES_INFORMATION.SHEET,
33796
- FUNCTION_NAMES_INFORMATION.SHEETS,
33797
- FUNCTION_NAMES_LOGICAL.IFNA,
33798
- FUNCTION_NAMES_LOGICAL.IFS,
33799
- FUNCTION_NAMES_LOGICAL.SWITCH,
33800
- FUNCTION_NAMES_LOGICAL.XOR,
33801
- FUNCTION_NAMES_STATISTICAL.BETA_DIST,
33802
- FUNCTION_NAMES_STATISTICAL.BETA_INV,
33803
- FUNCTION_NAMES_STATISTICAL.BINOM_DIST,
33804
- FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,
33805
- FUNCTION_NAMES_STATISTICAL.BINOM_INV,
33806
- FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,
33807
- FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,
33808
- FUNCTION_NAMES_STATISTICAL.CHISQ_INV,
33809
- FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,
33810
- FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,
33811
- FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,
33812
- FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,
33813
- FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,
33814
- FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,
33815
- FUNCTION_NAMES_STATISTICAL.EXPON_DIST,
33816
- FUNCTION_NAMES_STATISTICAL.F_DIST,
33817
- FUNCTION_NAMES_STATISTICAL.F_DIST_RT,
33818
- FUNCTION_NAMES_STATISTICAL.F_INV,
33819
- FUNCTION_NAMES_STATISTICAL.F_INV_RT,
33820
- FUNCTION_NAMES_STATISTICAL.F_TEST,
33821
- FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,
33822
- FUNCTION_NAMES_STATISTICAL.GAMMA,
33823
- FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,
33824
- FUNCTION_NAMES_STATISTICAL.GAMMA_INV,
33825
- FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,
33826
- FUNCTION_NAMES_STATISTICAL.GAUSS,
33827
- FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,
33828
- FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,
33829
- FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,
33830
- FUNCTION_NAMES_STATISTICAL.MAXIFS,
33831
- FUNCTION_NAMES_STATISTICAL.MINIFS,
33832
- FUNCTION_NAMES_STATISTICAL.MODE_MULT,
33833
- FUNCTION_NAMES_STATISTICAL.MODE_SNGL,
33834
- FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,
33835
- FUNCTION_NAMES_STATISTICAL.NORM_DIST,
33836
- FUNCTION_NAMES_STATISTICAL.NORM_INV,
33837
- FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,
33838
- FUNCTION_NAMES_STATISTICAL.NORM_S_INV,
33839
- FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,
33840
- FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,
33841
- FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,
33842
- FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,
33843
- FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,
33844
- FUNCTION_NAMES_STATISTICAL.PHI,
33845
- FUNCTION_NAMES_STATISTICAL.POISSON_DIST,
33846
- FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,
33847
- FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,
33848
- FUNCTION_NAMES_STATISTICAL.RANK_AVG,
33849
- FUNCTION_NAMES_STATISTICAL.RANK_EQ,
33850
- FUNCTION_NAMES_STATISTICAL.SKEW_P,
33851
- FUNCTION_NAMES_STATISTICAL.STDEV_P,
33852
- FUNCTION_NAMES_STATISTICAL.STDEV_S,
33853
- FUNCTION_NAMES_STATISTICAL.T_DIST,
33854
- FUNCTION_NAMES_STATISTICAL.T_DIST_2T,
33855
- FUNCTION_NAMES_STATISTICAL.T_DIST_RT,
33856
- FUNCTION_NAMES_STATISTICAL.T_INV,
33857
- FUNCTION_NAMES_STATISTICAL.T_INV_2T,
33858
- FUNCTION_NAMES_STATISTICAL.T_TEST,
33859
- FUNCTION_NAMES_STATISTICAL.VAR_P,
33860
- FUNCTION_NAMES_STATISTICAL.VAR_S,
33861
- FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,
33862
- FUNCTION_NAMES_STATISTICAL.Z_TEST,
33863
- FUNCTION_NAMES_TEXT.ARRAYTOTEXT,
33864
- FUNCTION_NAMES_WEB.ENCODEURL,
33865
- FUNCTION_NAMES_TEXT.NUMBERVALUE,
33866
- FUNCTION_NAMES_TEXT.TEXTAFTER,
33867
- FUNCTION_NAMES_TEXT.TEXTBEFORE,
33868
- FUNCTION_NAMES_TEXT.TEXTJOIN,
33869
- FUNCTION_NAMES_TEXT.TEXTSPLIT,
33870
- FUNCTION_NAMES_TEXT.UNICHAR,
33871
- FUNCTION_NAMES_TEXT.UNICODE,
33872
- FUNCTION_NAMES_TEXT.VALUETOTEXT,
33873
- FUNCTION_NAMES_DATE.DAYS,
33874
- FUNCTION_NAMES_DATE.ISOWEEKNUM,
33875
- FUNCTION_NAMES_FINANCIAL.PDURATION,
33876
- FUNCTION_NAMES_FINANCIAL.RRI,
33877
- FUNCTION_NAMES_LOGICAL.BYCOL,
33878
- FUNCTION_NAMES_LOGICAL.BYROW,
33879
- FUNCTION_NAMES_LOGICAL.MAKEARRAY,
33880
- FUNCTION_NAMES_LOGICAL.MAP,
33881
- FUNCTION_NAMES_LOGICAL.REDUCE,
33882
- FUNCTION_NAMES_LOGICAL.SCAN
33883
- ]);
33884
-
33885
33761
  //#endregion
33886
33762
  //#region src/functions/statistical/avedev/index.ts
33887
33763
  var Avedev = class extends BaseFunction {
@@ -40253,49 +40129,6 @@ const functionText = [
40253
40129
  */
40254
40130
  const functionUniver = [];
40255
40131
 
40256
- //#endregion
40257
- //#region src/functions/univer/function-names.ts
40258
- /**
40259
- * Copyright 2023-present DreamNum Co., Ltd.
40260
- *
40261
- * Licensed under the Apache License, Version 2.0 (the "License");
40262
- * you may not use this file except in compliance with the License.
40263
- * You may obtain a copy of the License at
40264
- *
40265
- * http://www.apache.org/licenses/LICENSE-2.0
40266
- *
40267
- * Unless required by applicable law or agreed to in writing, software
40268
- * distributed under the License is distributed on an "AS IS" BASIS,
40269
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40270
- * See the License for the specific language governing permissions and
40271
- * limitations under the License.
40272
- */
40273
- let FUNCTION_NAMES_UNIVER = /* @__PURE__ */ function(FUNCTION_NAMES_UNIVER) {
40274
- return FUNCTION_NAMES_UNIVER;
40275
- }({});
40276
-
40277
- //#endregion
40278
- //#region src/functions/util.ts
40279
- function stripArrayValue(array) {
40280
- return array.map((row) => row.map((cell) => {
40281
- if (typeof cell === "number") return stripErrorMargin(cell);
40282
- return cell;
40283
- }));
40284
- }
40285
- function getObjectValue(result, isUseStrip = false) {
40286
- if (result.isReferenceObject()) {
40287
- const arrayValue = result.toArrayValueObject().toValue();
40288
- return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40289
- } else if (result.isArray()) {
40290
- const arrayValue = result.toValue();
40291
- return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40292
- } else if (result.isNumber()) {
40293
- const value = result.getValue();
40294
- return isUseStrip ? stripErrorMargin(value) : value;
40295
- }
40296
- return result.getValue();
40297
- }
40298
-
40299
40132
  //#endregion
40300
40133
  //#region src/functions/web/encodeurl/index.ts
40301
40134
  var Encodeurl = class extends BaseFunction {
@@ -40339,10 +40172,221 @@ var Encodeurl = class extends BaseFunction {
40339
40172
  */
40340
40173
  const functionWeb = [[Encodeurl, FUNCTION_NAMES_WEB.ENCODEURL]];
40341
40174
 
40175
+ //#endregion
40176
+ //#region src/functions/index.ts
40177
+ const ALL_IMPLEMENTED_FUNCTIONS = [
40178
+ ...functionArray,
40179
+ ...functionCompatibility,
40180
+ ...functionCube,
40181
+ ...functionDatabase,
40182
+ ...functionDate,
40183
+ ...functionEngineering,
40184
+ ...functionFinancial,
40185
+ ...functionInformation,
40186
+ ...functionLogical,
40187
+ ...functionLookup,
40188
+ ...functionMath,
40189
+ ...functionMeta,
40190
+ ...functionStatistical,
40191
+ ...functionText,
40192
+ ...functionUniver,
40193
+ ...functionWeb
40194
+ ];
40195
+ const ALL_IMPLEMENTED_FUNCTIONS_SET = new Set(ALL_IMPLEMENTED_FUNCTIONS.map(([_, name]) => name));
40196
+
40197
+ //#endregion
40198
+ //#region src/functions/new-excel-functions.ts
40199
+ const NEW_EXCEL_FUNCTIONS = new Set([
40200
+ FUNCTION_NAMES_MATH.ACOT,
40201
+ FUNCTION_NAMES_MATH.ACOTH,
40202
+ FUNCTION_NAMES_MATH.ARABIC,
40203
+ FUNCTION_NAMES_MATH.BASE,
40204
+ FUNCTION_NAMES_MATH.CEILING_MATH,
40205
+ FUNCTION_NAMES_MATH.CEILING_PRECISE,
40206
+ FUNCTION_NAMES_MATH.COMBINA,
40207
+ FUNCTION_NAMES_MATH.COT,
40208
+ FUNCTION_NAMES_MATH.COTH,
40209
+ FUNCTION_NAMES_MATH.CSC,
40210
+ FUNCTION_NAMES_MATH.CSCH,
40211
+ FUNCTION_NAMES_MATH.DECIMAL,
40212
+ FUNCTION_NAMES_MATH.FLOOR_MATH,
40213
+ FUNCTION_NAMES_MATH.FLOOR_PRECISE,
40214
+ FUNCTION_NAMES_MATH.MUNIT,
40215
+ FUNCTION_NAMES_MATH.RANDARRAY,
40216
+ FUNCTION_NAMES_MATH.SEC,
40217
+ FUNCTION_NAMES_MATH.SECH,
40218
+ FUNCTION_NAMES_MATH.SEQUENCE,
40219
+ FUNCTION_NAMES_LOOKUP.CHOOSECOLS,
40220
+ FUNCTION_NAMES_LOOKUP.CHOOSEROWS,
40221
+ FUNCTION_NAMES_LOOKUP.DROP,
40222
+ FUNCTION_NAMES_LOOKUP.EXPAND,
40223
+ FUNCTION_NAMES_LOOKUP.FILTER,
40224
+ FUNCTION_NAMES_LOOKUP.FORMULATEXT,
40225
+ FUNCTION_NAMES_LOOKUP.HSTACK,
40226
+ FUNCTION_NAMES_LOOKUP.SORT,
40227
+ FUNCTION_NAMES_LOOKUP.SORTBY,
40228
+ FUNCTION_NAMES_LOOKUP.TAKE,
40229
+ FUNCTION_NAMES_LOOKUP.TOCOL,
40230
+ FUNCTION_NAMES_LOOKUP.TOROW,
40231
+ FUNCTION_NAMES_LOOKUP.UNIQUE,
40232
+ FUNCTION_NAMES_LOOKUP.VSTACK,
40233
+ FUNCTION_NAMES_LOOKUP.WRAPCOLS,
40234
+ FUNCTION_NAMES_LOOKUP.WRAPROWS,
40235
+ FUNCTION_NAMES_LOOKUP.XLOOKUP,
40236
+ FUNCTION_NAMES_LOOKUP.XMATCH,
40237
+ FUNCTION_NAMES_ENGINEERING.BITAND,
40238
+ FUNCTION_NAMES_ENGINEERING.BITLSHIFT,
40239
+ FUNCTION_NAMES_ENGINEERING.BITOR,
40240
+ FUNCTION_NAMES_ENGINEERING.BITRSHIFT,
40241
+ FUNCTION_NAMES_ENGINEERING.BITXOR,
40242
+ FUNCTION_NAMES_ENGINEERING.ERF_PRECISE,
40243
+ FUNCTION_NAMES_ENGINEERING.ERFC_PRECISE,
40244
+ FUNCTION_NAMES_ENGINEERING.IMCOSH,
40245
+ FUNCTION_NAMES_ENGINEERING.IMCOT,
40246
+ FUNCTION_NAMES_ENGINEERING.IMCSC,
40247
+ FUNCTION_NAMES_ENGINEERING.IMCSCH,
40248
+ FUNCTION_NAMES_ENGINEERING.IMSEC,
40249
+ FUNCTION_NAMES_ENGINEERING.IMSECH,
40250
+ FUNCTION_NAMES_ENGINEERING.IMSINH,
40251
+ FUNCTION_NAMES_ENGINEERING.IMTAN,
40252
+ FUNCTION_NAMES_INFORMATION.ISFORMULA,
40253
+ FUNCTION_NAMES_INFORMATION.SHEET,
40254
+ FUNCTION_NAMES_INFORMATION.SHEETS,
40255
+ FUNCTION_NAMES_LOGICAL.IFNA,
40256
+ FUNCTION_NAMES_LOGICAL.IFS,
40257
+ FUNCTION_NAMES_LOGICAL.SWITCH,
40258
+ FUNCTION_NAMES_LOGICAL.XOR,
40259
+ FUNCTION_NAMES_STATISTICAL.BETA_DIST,
40260
+ FUNCTION_NAMES_STATISTICAL.BETA_INV,
40261
+ FUNCTION_NAMES_STATISTICAL.BINOM_DIST,
40262
+ FUNCTION_NAMES_STATISTICAL.BINOM_DIST_RANGE,
40263
+ FUNCTION_NAMES_STATISTICAL.BINOM_INV,
40264
+ FUNCTION_NAMES_STATISTICAL.CHISQ_DIST,
40265
+ FUNCTION_NAMES_STATISTICAL.CHISQ_DIST_RT,
40266
+ FUNCTION_NAMES_STATISTICAL.CHISQ_INV,
40267
+ FUNCTION_NAMES_STATISTICAL.CHISQ_INV_RT,
40268
+ FUNCTION_NAMES_STATISTICAL.CHISQ_TEST,
40269
+ FUNCTION_NAMES_STATISTICAL.CONFIDENCE_NORM,
40270
+ FUNCTION_NAMES_STATISTICAL.CONFIDENCE_T,
40271
+ FUNCTION_NAMES_STATISTICAL.COVARIANCE_P,
40272
+ FUNCTION_NAMES_STATISTICAL.COVARIANCE_S,
40273
+ FUNCTION_NAMES_STATISTICAL.EXPON_DIST,
40274
+ FUNCTION_NAMES_STATISTICAL.F_DIST,
40275
+ FUNCTION_NAMES_STATISTICAL.F_DIST_RT,
40276
+ FUNCTION_NAMES_STATISTICAL.F_INV,
40277
+ FUNCTION_NAMES_STATISTICAL.F_INV_RT,
40278
+ FUNCTION_NAMES_STATISTICAL.F_TEST,
40279
+ FUNCTION_NAMES_STATISTICAL.FORECAST_LINEAR,
40280
+ FUNCTION_NAMES_STATISTICAL.GAMMA,
40281
+ FUNCTION_NAMES_STATISTICAL.GAMMA_DIST,
40282
+ FUNCTION_NAMES_STATISTICAL.GAMMA_INV,
40283
+ FUNCTION_NAMES_STATISTICAL.GAMMALN_PRECISE,
40284
+ FUNCTION_NAMES_STATISTICAL.GAUSS,
40285
+ FUNCTION_NAMES_STATISTICAL.HYPGEOM_DIST,
40286
+ FUNCTION_NAMES_STATISTICAL.LOGNORM_DIST,
40287
+ FUNCTION_NAMES_STATISTICAL.LOGNORM_INV,
40288
+ FUNCTION_NAMES_STATISTICAL.MAXIFS,
40289
+ FUNCTION_NAMES_STATISTICAL.MINIFS,
40290
+ FUNCTION_NAMES_STATISTICAL.MODE_MULT,
40291
+ FUNCTION_NAMES_STATISTICAL.MODE_SNGL,
40292
+ FUNCTION_NAMES_STATISTICAL.NEGBINOM_DIST,
40293
+ FUNCTION_NAMES_STATISTICAL.NORM_DIST,
40294
+ FUNCTION_NAMES_STATISTICAL.NORM_INV,
40295
+ FUNCTION_NAMES_STATISTICAL.NORM_S_DIST,
40296
+ FUNCTION_NAMES_STATISTICAL.NORM_S_INV,
40297
+ FUNCTION_NAMES_STATISTICAL.PERCENTILE_EXC,
40298
+ FUNCTION_NAMES_STATISTICAL.PERCENTILE_INC,
40299
+ FUNCTION_NAMES_STATISTICAL.PERCENTRANK_EXC,
40300
+ FUNCTION_NAMES_STATISTICAL.PERCENTRANK_INC,
40301
+ FUNCTION_NAMES_STATISTICAL.PERMUTATIONA,
40302
+ FUNCTION_NAMES_STATISTICAL.PHI,
40303
+ FUNCTION_NAMES_STATISTICAL.POISSON_DIST,
40304
+ FUNCTION_NAMES_STATISTICAL.QUARTILE_EXC,
40305
+ FUNCTION_NAMES_STATISTICAL.QUARTILE_INC,
40306
+ FUNCTION_NAMES_STATISTICAL.RANK_AVG,
40307
+ FUNCTION_NAMES_STATISTICAL.RANK_EQ,
40308
+ FUNCTION_NAMES_STATISTICAL.SKEW_P,
40309
+ FUNCTION_NAMES_STATISTICAL.STDEV_P,
40310
+ FUNCTION_NAMES_STATISTICAL.STDEV_S,
40311
+ FUNCTION_NAMES_STATISTICAL.T_DIST,
40312
+ FUNCTION_NAMES_STATISTICAL.T_DIST_2T,
40313
+ FUNCTION_NAMES_STATISTICAL.T_DIST_RT,
40314
+ FUNCTION_NAMES_STATISTICAL.T_INV,
40315
+ FUNCTION_NAMES_STATISTICAL.T_INV_2T,
40316
+ FUNCTION_NAMES_STATISTICAL.T_TEST,
40317
+ FUNCTION_NAMES_STATISTICAL.VAR_P,
40318
+ FUNCTION_NAMES_STATISTICAL.VAR_S,
40319
+ FUNCTION_NAMES_STATISTICAL.WEIBULL_DIST,
40320
+ FUNCTION_NAMES_STATISTICAL.Z_TEST,
40321
+ FUNCTION_NAMES_TEXT.ARRAYTOTEXT,
40322
+ FUNCTION_NAMES_WEB.ENCODEURL,
40323
+ FUNCTION_NAMES_TEXT.NUMBERVALUE,
40324
+ FUNCTION_NAMES_TEXT.TEXTAFTER,
40325
+ FUNCTION_NAMES_TEXT.TEXTBEFORE,
40326
+ FUNCTION_NAMES_TEXT.TEXTJOIN,
40327
+ FUNCTION_NAMES_TEXT.TEXTSPLIT,
40328
+ FUNCTION_NAMES_TEXT.UNICHAR,
40329
+ FUNCTION_NAMES_TEXT.UNICODE,
40330
+ FUNCTION_NAMES_TEXT.VALUETOTEXT,
40331
+ FUNCTION_NAMES_DATE.DAYS,
40332
+ FUNCTION_NAMES_DATE.ISOWEEKNUM,
40333
+ FUNCTION_NAMES_FINANCIAL.PDURATION,
40334
+ FUNCTION_NAMES_FINANCIAL.RRI,
40335
+ FUNCTION_NAMES_LOGICAL.BYCOL,
40336
+ FUNCTION_NAMES_LOGICAL.BYROW,
40337
+ FUNCTION_NAMES_LOGICAL.MAKEARRAY,
40338
+ FUNCTION_NAMES_LOGICAL.MAP,
40339
+ FUNCTION_NAMES_LOGICAL.REDUCE,
40340
+ FUNCTION_NAMES_LOGICAL.SCAN
40341
+ ]);
40342
+
40343
+ //#endregion
40344
+ //#region src/functions/univer/function-names.ts
40345
+ /**
40346
+ * Copyright 2023-present DreamNum Co., Ltd.
40347
+ *
40348
+ * Licensed under the Apache License, Version 2.0 (the "License");
40349
+ * you may not use this file except in compliance with the License.
40350
+ * You may obtain a copy of the License at
40351
+ *
40352
+ * http://www.apache.org/licenses/LICENSE-2.0
40353
+ *
40354
+ * Unless required by applicable law or agreed to in writing, software
40355
+ * distributed under the License is distributed on an "AS IS" BASIS,
40356
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40357
+ * See the License for the specific language governing permissions and
40358
+ * limitations under the License.
40359
+ */
40360
+ let FUNCTION_NAMES_UNIVER = /* @__PURE__ */ function(FUNCTION_NAMES_UNIVER) {
40361
+ return FUNCTION_NAMES_UNIVER;
40362
+ }({});
40363
+
40364
+ //#endregion
40365
+ //#region src/functions/util.ts
40366
+ function stripArrayValue(array) {
40367
+ return array.map((row) => row.map((cell) => {
40368
+ if (typeof cell === "number") return stripErrorMargin(cell);
40369
+ return cell;
40370
+ }));
40371
+ }
40372
+ function getObjectValue(result, isUseStrip = false) {
40373
+ if (result.isReferenceObject()) {
40374
+ const arrayValue = result.toArrayValueObject().toValue();
40375
+ return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40376
+ } else if (result.isArray()) {
40377
+ const arrayValue = result.toValue();
40378
+ return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
40379
+ } else if (result.isNumber()) {
40380
+ const value = result.getValue();
40381
+ return isUseStrip ? stripErrorMargin(value) : value;
40382
+ }
40383
+ return result.getValue();
40384
+ }
40385
+
40342
40386
  //#endregion
40343
40387
  //#region package.json
40344
40388
  var name = "@univerjs/engine-formula";
40345
- var version = "0.21.0";
40389
+ var version = "0.21.1";
40346
40390
 
40347
40391
  //#endregion
40348
40392
  //#region src/services/global-computing-status.service.ts
@@ -40465,24 +40509,7 @@ let FormulaController = class FormulaController extends Disposable {
40465
40509
  _registerFunctions() {
40466
40510
  var _config$function;
40467
40511
  const config = this._configService.getConfig(ENGINE_FORMULA_PLUGIN_CONFIG_KEY);
40468
- const functions = [
40469
- ...functionArray,
40470
- ...functionCompatibility,
40471
- ...functionCube,
40472
- ...functionDatabase,
40473
- ...functionDate,
40474
- ...functionEngineering,
40475
- ...functionFinancial,
40476
- ...functionInformation,
40477
- ...functionLogical,
40478
- ...functionLookup,
40479
- ...functionMath,
40480
- ...functionMeta,
40481
- ...functionStatistical,
40482
- ...functionText,
40483
- ...functionUniver,
40484
- ...functionWeb
40485
- ].concat((_config$function = config === null || config === void 0 ? void 0 : config.function) !== null && _config$function !== void 0 ? _config$function : []).map((registerObject) => {
40512
+ const functions = ALL_IMPLEMENTED_FUNCTIONS.concat((_config$function = config === null || config === void 0 ? void 0 : config.function) !== null && _config$function !== void 0 ? _config$function : []).map((registerObject) => {
40486
40513
  const Func = registerObject[0];
40487
40514
  const name = registerObject[1];
40488
40515
  return new Func(name);
@@ -40926,4 +40953,4 @@ _defineProperty(UniverFormulaEnginePlugin, "version", version);
40926
40953
  UniverFormulaEnginePlugin = __decorate([__decorateParam(1, Inject(Injector)), __decorateParam(2, IConfigService)], UniverFormulaEnginePlugin);
40927
40954
 
40928
40955
  //#endregion
40929
- export { ActiveDirtyManagerService, ArrayValueObject, AstRootNodeFactory, AstTreeBuilder, AsyncArrayObject, AsyncCustomFunction, AsyncObject, BaseFunction, BaseReferenceObject, BaseValueObject, BooleanValue, BooleanValueObject, CalculateController, CalculateFormulaService, CustomFunction, DEFAULT_INTERVAL_COUNT, DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME, DEFAULT_TOKEN_LET_FUNCTION_NAME, DEFAULT_TOKEN_TYPE_LAMBDA_PARAMETER, DEFAULT_TOKEN_TYPE_PARAMETER, DEFAULT_TOKEN_TYPE_ROOT, DefinedNamesService, DependencyManagerBaseService, DependencyManagerService, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT, ENGINE_FORMULA_PLUGIN_CONFIG_KEY, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE, ERROR_TYPE_SET, ErrorType, ErrorValueObject, FUNCTION_NAMES_ARRAY, FUNCTION_NAMES_COMPATIBILITY, FUNCTION_NAMES_CUBE, FUNCTION_NAMES_DATABASE, FUNCTION_NAMES_DATE, FUNCTION_NAMES_ENGINEERING, FUNCTION_NAMES_FINANCIAL, FUNCTION_NAMES_INFORMATION, FUNCTION_NAMES_LOGICAL, FUNCTION_NAMES_LOOKUP, FUNCTION_NAMES_MATH, FUNCTION_NAMES_STATISTICAL, FUNCTION_NAMES_TEXT, FUNCTION_NAMES_UNIVER, FUNCTION_NAMES_WEB, FeatureCalculationManagerService, FormulaCurrentConfigService, FormulaDataModel, FormulaDependencyGenerator, FormulaDependencyTree, FormulaDependencyTreeModel, FormulaDependencyTreeType, FormulaDependencyTreeVirtual, FormulaExecuteStageType, FormulaExecutedStateType, FormulaResultStatus, FormulaRuntimeService, FunctionNodeFactory, FunctionService, FunctionType, GlobalComputingStatusService, HyperlinkEngineFormulaService, IActiveDirtyManagerService, ICalculateFormulaService, IDefinedNamesService, IDependencyManagerService, IFeatureCalculationManagerService, IFormulaCurrentConfigService, IFormulaDependencyGenerator, IFormulaRuntimeService, IFunctionService, IHyperlinkEngineFormulaService, IOtherFormulaManagerService, ISheetRowFilteredService, ISuperTableService, Interpreter, LambdaNodeFactory, LambdaParameterNodeFactory, LambdaValueObjectObject, Lexer, LexerNode, LexerTreeBuilder, NEW_EXCEL_FUNCTIONS, NullValueObject, NumberValueObject, OPERATOR_TOKEN_SET, OperatorNodeFactory, OtherFormulaBizType, OtherFormulaManagerService, OtherFormulaMarkDirty, PrefixNodeFactory, RangeReferenceObject, ReferenceNodeFactory, RegisterFunctionMutation, RegisterOtherFormulaService, RemoveDefinedNameMutation, RemoveFeatureCalculationMutation, RemoveOtherFormulaMutation, RemoveSuperTableMutation, SUFFIX_TOKEN_SET, SetArrayFormulaDataMutation, SetCellFormulaDependencyCalculationMutation, SetCellFormulaDependencyCalculationResultMutation, SetDefinedNameMutation, SetDefinedNameMutationFactory, SetFeatureCalculationMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, SetFormulaDataMutation, SetFormulaDependencyCalculationMutation, SetFormulaDependencyCalculationResultMutation, SetFormulaStringBatchCalculationMutation, SetFormulaStringBatchCalculationResultMutation, SetImageFormulaDataMutation, SetOtherFormulaMutation, SetQueryFormulaDependencyAllMutation, SetQueryFormulaDependencyAllResultMutation, SetQueryFormulaDependencyMutation, SetQueryFormulaDependencyResultMutation, SetSuperTableMutation, SetSuperTableOptionMutation, SetTriggerFormulaCalculationStartMutation, SheetRowFilteredService, StringValueObject, SuffixNodeFactory, SuperTableService, UnionNodeFactory, UniverFormulaEnginePlugin, ValueNodeFactory, ValueObjectFactory, compareToken, convertUnitDataToRuntime, deserializeRangeForR1C1, deserializeRangeWithSheet, deserializeRangeWithSheetWithCache, excelDateSerial, extractFormulaError, functionArray, functionCompatibility, functionCube, functionDatabase, functionDate, functionEngineering, functionFinancial, functionInformation, functionLogical, functionLookup, functionMath, functionMeta, functionStatistical, functionText, functionUniver, functionWeb, generateAstNode, generateExecuteAstNodeData, generateRandomDependencyTreeId, generateStringWithSequence, getAbsoluteRefTypeWitString, getAbsoluteRefTypeWithSingleString, getObjectValue, getRangeWithRefsString, handleNumfmtInCell, handleRefStringInfo, includeFormulaLexerToken, initSheetFormulaData, isFormulaLexerToken, isInDirtyRange, isReferenceString, isReferenceStringWithEffectiveColumn, isReferenceStrings, matchRefDrawToken, matchToken, needsQuoting, normalizeSheetName, operatorToken, prefixToken, quoteSheetName, sequenceNodeType, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, singleReferenceToGrid, splitTableStructuredRef, strip, stripErrorMargin, unquoteSheetName };
40956
+ export { ALL_IMPLEMENTED_FUNCTIONS, ALL_IMPLEMENTED_FUNCTIONS_SET, ActiveDirtyManagerService, ArrayValueObject, AstRootNodeFactory, AstTreeBuilder, AsyncArrayObject, AsyncCustomFunction, AsyncObject, BaseFunction, BaseReferenceObject, BaseValueObject, BooleanValue, BooleanValueObject, CalculateController, CalculateFormulaService, CustomFunction, DEFAULT_INTERVAL_COUNT, DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME, DEFAULT_TOKEN_LET_FUNCTION_NAME, DEFAULT_TOKEN_TYPE_LAMBDA_PARAMETER, DEFAULT_TOKEN_TYPE_PARAMETER, DEFAULT_TOKEN_TYPE_ROOT, DefinedNamesService, DependencyManagerBaseService, DependencyManagerService, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT, ENGINE_FORMULA_PLUGIN_CONFIG_KEY, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE, ERROR_TYPE_SET, ErrorType, ErrorValueObject, FUNCTION_NAMES_ARRAY, FUNCTION_NAMES_COMPATIBILITY, FUNCTION_NAMES_CUBE, FUNCTION_NAMES_DATABASE, FUNCTION_NAMES_DATE, FUNCTION_NAMES_ENGINEERING, FUNCTION_NAMES_FINANCIAL, FUNCTION_NAMES_INFORMATION, FUNCTION_NAMES_LOGICAL, FUNCTION_NAMES_LOOKUP, FUNCTION_NAMES_MATH, FUNCTION_NAMES_STATISTICAL, FUNCTION_NAMES_TEXT, FUNCTION_NAMES_UNIVER, FUNCTION_NAMES_WEB, FeatureCalculationManagerService, FormulaCurrentConfigService, FormulaDataModel, FormulaDependencyGenerator, FormulaDependencyTree, FormulaDependencyTreeModel, FormulaDependencyTreeType, FormulaDependencyTreeVirtual, FormulaExecuteStageType, FormulaExecutedStateType, FormulaResultStatus, FormulaRuntimeService, FunctionNodeFactory, FunctionService, FunctionType, GlobalComputingStatusService, HyperlinkEngineFormulaService, IActiveDirtyManagerService, ICalculateFormulaService, IDefinedNamesService, IDependencyManagerService, IFeatureCalculationManagerService, IFormulaCurrentConfigService, IFormulaDependencyGenerator, IFormulaRuntimeService, IFunctionService, IHyperlinkEngineFormulaService, IOtherFormulaManagerService, ISheetRowFilteredService, ISuperTableService, Interpreter, LambdaNodeFactory, LambdaParameterNodeFactory, LambdaValueObjectObject, Lexer, LexerNode, LexerTreeBuilder, NEW_EXCEL_FUNCTIONS, NullValueObject, NumberValueObject, OPERATOR_TOKEN_SET, OperatorNodeFactory, OtherFormulaBizType, OtherFormulaManagerService, OtherFormulaMarkDirty, PrefixNodeFactory, RangeReferenceObject, ReferenceNodeFactory, RegisterFunctionMutation, RegisterOtherFormulaService, RemoveDefinedNameMutation, RemoveFeatureCalculationMutation, RemoveOtherFormulaMutation, RemoveSuperTableMutation, SUFFIX_TOKEN_SET, SetArrayFormulaDataMutation, SetCellFormulaDependencyCalculationMutation, SetCellFormulaDependencyCalculationResultMutation, SetDefinedNameMutation, SetDefinedNameMutationFactory, SetFeatureCalculationMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, SetFormulaDataMutation, SetFormulaDependencyCalculationMutation, SetFormulaDependencyCalculationResultMutation, SetFormulaStringBatchCalculationMutation, SetFormulaStringBatchCalculationResultMutation, SetImageFormulaDataMutation, SetOtherFormulaMutation, SetQueryFormulaDependencyAllMutation, SetQueryFormulaDependencyAllResultMutation, SetQueryFormulaDependencyMutation, SetQueryFormulaDependencyResultMutation, SetSuperTableMutation, SetSuperTableOptionMutation, SetTriggerFormulaCalculationStartMutation, SheetRowFilteredService, StringValueObject, SuffixNodeFactory, SuperTableService, UnionNodeFactory, UniverFormulaEnginePlugin, ValueNodeFactory, ValueObjectFactory, compareToken, convertUnitDataToRuntime, deserializeRangeForR1C1, deserializeRangeWithSheet, deserializeRangeWithSheetWithCache, excelDateSerial, extractFormulaError, functionArray, functionCompatibility, functionCube, functionDatabase, functionDate, functionEngineering, functionFinancial, functionInformation, functionLogical, functionLookup, functionMath, functionMeta, functionStatistical, functionText, functionUniver, functionWeb, generateAstNode, generateExecuteAstNodeData, generateRandomDependencyTreeId, generateStringWithSequence, getAbsoluteRefTypeWitString, getAbsoluteRefTypeWithSingleString, getObjectValue, getRangeWithRefsString, handleNumfmtInCell, handleRefStringInfo, includeFormulaLexerToken, initSheetFormulaData, isFormulaLexerToken, isInDirtyRange, isReferenceString, isReferenceStringWithEffectiveColumn, isReferenceStrings, matchRefDrawToken, matchToken, needsQuoting, normalizeSheetName, operatorToken, prefixToken, quoteSheetName, sequenceNodeType, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, singleReferenceToGrid, splitTableStructuredRef, strip, stripErrorMargin, unquoteSheetName };
@@ -28,11 +28,8 @@ export interface ISetDefinedNameMutationParam extends ISetDefinedNameMutationSea
28
28
  }
29
29
  /**
30
30
  * Generate undo mutation of a `SetDefinedNameMutation`
31
- * @param accessor
32
- * @param params
33
- * @returns
34
31
  */
35
- export declare const SetDefinedNameMutationFactory: (accessor: IAccessor, params: ISetDefinedNameMutationParam) => ISetDefinedNameMutationParam;
32
+ export declare const SetDefinedNameMutationFactory: (accessor: IAccessor, params: ISetDefinedNameMutationParam) => ISetDefinedNameMutationParam | null;
36
33
  /**
37
34
  * In the formula engine, the mutation is solely responsible for communication between the worker and the main thread.
38
35
  * It requires setting local to true during execution.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { Ctor } from '@univerjs/core';
17
+ import type { IFunctionNames } from '../basics/function';
18
+ import type { BaseFunction } from './base-function';
19
+ export declare const ALL_IMPLEMENTED_FUNCTIONS: Array<[Ctor<BaseFunction>, IFunctionNames]>;
20
+ export declare const ALL_IMPLEMENTED_FUNCTIONS_SET: Set<IFunctionNames>;
@@ -98,6 +98,7 @@ export { functionEngineering } from './functions/engineering/function-map';
98
98
  export { FUNCTION_NAMES_ENGINEERING } from './functions/engineering/function-names';
99
99
  export { functionFinancial } from './functions/financial/function-map';
100
100
  export { FUNCTION_NAMES_FINANCIAL } from './functions/financial/function-names';
101
+ export { ALL_IMPLEMENTED_FUNCTIONS, ALL_IMPLEMENTED_FUNCTIONS_SET } from './functions/index';
101
102
  export { functionInformation } from './functions/information/function-map';
102
103
  export { FUNCTION_NAMES_INFORMATION } from './functions/information/function-names';
103
104
  export { functionLogical } from './functions/logical/function-map';
@@ -125,7 +126,7 @@ export { ActiveDirtyManagerService, IActiveDirtyManagerService } from './service
125
126
  export { CalculateFormulaService, ICalculateFormulaService } from './services/calculate-formula.service';
126
127
  export { DEFAULT_INTERVAL_COUNT } from './services/calculate-formula.service';
127
128
  export { FormulaCurrentConfigService, IFormulaCurrentConfigService, type IFormulaDirtyData } from './services/current-data.service';
128
- export { DefinedNamesService, type IDefinedNameMapItem, IDefinedNamesService, type IDefinedNamesServiceParam } from './services/defined-names.service';
129
+ export { DefinedNamesService, type IDefinedNameMapItem, IDefinedNamesService, type IDefinedNamesServiceParam, type IDefinedNamesUpdateEvent } from './services/defined-names.service';
129
130
  export { IDependencyManagerService } from './services/dependency-manager.service';
130
131
  export { DependencyManagerService } from './services/dependency-manager.service';
131
132
  export { DependencyManagerBaseService } from './services/dependency-manager.service';
@@ -34,6 +34,11 @@ export interface IDefinedNameMap {
34
34
  export interface IDefinedNameMapItem {
35
35
  [id: string]: IDefinedNamesServiceParam;
36
36
  }
37
+ export interface IDefinedNamesUpdateEvent {
38
+ type: 'update' | 'remove';
39
+ unitId: string;
40
+ definedNames: IDefinedNamesServiceParam[];
41
+ }
37
42
  export interface IDefinedNamesService {
38
43
  registerDefinedName(unitId: string, param: IDefinedNamesServiceParam): void;
39
44
  registerDefinedNames(unitId: string, params: IDefinedNameMapItem): void;
@@ -47,7 +52,7 @@ export interface IDefinedNamesService {
47
52
  getCurrentRange(): IUnitRange;
48
53
  getCurrentRangeForString(): string;
49
54
  currentRange$: Observable<IUnitRange>;
50
- update$: Observable<unknown>;
55
+ update$: Observable<IDefinedNamesUpdateEvent>;
51
56
  focusRange$: Observable<IDefinedNamesServiceFocusParam>;
52
57
  focusRange(unitId: string, id: string): void;
53
58
  getWorksheetByRef(unitId: string, ref: string): Nullable<Worksheet>;
@@ -58,7 +63,7 @@ export declare class DefinedNamesService extends Disposable implements IDefinedN
58
63
  private _definedNameMap;
59
64
  private _nameCacheMap;
60
65
  private readonly _update$;
61
- readonly update$: Observable<unknown>;
66
+ readonly update$: Observable<IDefinedNamesUpdateEvent>;
62
67
  private _currentRange;
63
68
  private readonly _currentRange$;
64
69
  readonly currentRange$: Observable<IUnitRange>;
@@ -38,9 +38,10 @@ export interface IFunctionService {
38
38
  unregisterExecutors(...functionTokens: IFunctionNames[]): void;
39
39
  registerDescriptions(...functions: IFunctionInfo[]): IDisposable;
40
40
  getDescriptions(): Map<IFunctionNames, IFunctionInfo>;
41
- getDescription(functionToken: IFunctionNames): Nullable<IFunctionInfo>;
41
+ getDescription(functionToken: IFunctionNames): IFunctionInfo | undefined;
42
42
  hasDescription(functionToken: IFunctionNames): boolean;
43
43
  unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
44
+ clearDescriptions(): void;
44
45
  deleteFormulaAstCacheKey(...functionToken: IFunctionNames[]): void;
45
46
  }
46
47
  export declare const IFunctionService: import("@wendellhu/redi").IdentifierDecorator<FunctionService>;
@@ -58,5 +59,6 @@ export declare class FunctionService extends Disposable implements IFunctionServ
58
59
  getDescription(functionToken: IFunctionNames): IFunctionInfo | undefined;
59
60
  hasDescription(functionToken: IFunctionNames): boolean;
60
61
  unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
62
+ clearDescriptions(): void;
61
63
  deleteFormulaAstCacheKey(...functionToken: IFunctionNames[]): void;
62
64
  }