@univerjs/engine-formula 0.2.11 → 0.2.13

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 (94) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +2101 -501
  3. package/lib/types/basics/__tests__/math.spec.d.ts +16 -0
  4. package/lib/types/basics/math.d.ts +21 -0
  5. package/lib/types/controller/config.schema.d.ts +10 -0
  6. package/lib/types/controller/formula.controller.d.ts +3 -5
  7. package/lib/types/controller/set-dependency.controller.d.ts +1 -1
  8. package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +6 -6
  9. package/lib/types/engine/dependency/dependency-tree.d.ts +22 -2
  10. package/lib/types/engine/dependency/range-block-util.d.ts +15 -0
  11. package/lib/types/engine/reference-object/base-reference-object.d.ts +6 -6
  12. package/lib/types/engine/value-object/array-value-object.d.ts +1 -1
  13. package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -2
  14. package/lib/types/functions/__tests__/create-function-test-bed.d.ts +6 -6
  15. package/lib/types/functions/base-function.d.ts +1 -1
  16. package/lib/types/functions/information/isformula/__tests__/index.spec.d.ts +16 -0
  17. package/lib/types/functions/information/isformula/index.d.ts +9 -0
  18. package/lib/types/functions/information/n/__tests__/index.spec.d.ts +16 -0
  19. package/lib/types/functions/information/n/index.d.ts +7 -0
  20. package/lib/types/functions/information/na/__tests__/index.spec.d.ts +16 -0
  21. package/lib/types/functions/information/na/index.d.ts +7 -0
  22. package/lib/types/functions/logical/bycol/__test__/index.spec.d.ts +16 -0
  23. package/lib/types/functions/logical/bycol/index.d.ts +7 -0
  24. package/lib/types/functions/logical/byrow/__test__/index.spec.d.ts +16 -0
  25. package/lib/types/functions/logical/byrow/index.d.ts +7 -0
  26. package/lib/types/functions/logical/function-map.d.ts +1 -1
  27. package/lib/types/functions/logical/map/__test__/index.spec.d.ts +16 -0
  28. package/lib/types/functions/logical/map/index.d.ts +8 -0
  29. package/lib/types/functions/logical/reduce/__test__/index.spec.d.ts +16 -0
  30. package/lib/types/functions/logical/reduce/index.d.ts +8 -0
  31. package/lib/types/functions/logical/scan/__test__/index.spec.d.ts +16 -0
  32. package/lib/types/functions/logical/scan/index.d.ts +8 -0
  33. package/lib/types/functions/lookup/drop/__tests__/index.spec.d.ts +16 -0
  34. package/lib/types/functions/lookup/drop/index.d.ts +9 -0
  35. package/lib/types/functions/lookup/expand/__tests__/index.spec.d.ts +16 -0
  36. package/lib/types/functions/lookup/expand/index.d.ts +9 -0
  37. package/lib/types/functions/lookup/function-map.d.ts +1 -1
  38. package/lib/types/functions/lookup/take/__tests__/index.spec.d.ts +16 -0
  39. package/lib/types/functions/lookup/take/index.d.ts +9 -0
  40. package/lib/types/functions/lookup/tocol/__tests__/index.spec.d.ts +16 -0
  41. package/lib/types/functions/lookup/tocol/index.d.ts +10 -0
  42. package/lib/types/functions/lookup/torow/__tests__/index.spec.d.ts +16 -0
  43. package/lib/types/functions/lookup/torow/index.d.ts +10 -0
  44. package/lib/types/functions/lookup/wrapcols/__tests__/index.spec.d.ts +16 -0
  45. package/lib/types/functions/lookup/wrapcols/index.d.ts +8 -0
  46. package/lib/types/functions/lookup/wraprows/__tests__/index.spec.d.ts +16 -0
  47. package/lib/types/functions/lookup/wraprows/index.d.ts +8 -0
  48. package/lib/types/functions/math/combin/__tests__/index.spec.d.ts +16 -0
  49. package/lib/types/functions/math/combin/index.d.ts +7 -0
  50. package/lib/types/functions/math/combina/__tests__/index.spec.d.ts +16 -0
  51. package/lib/types/functions/math/combina/index.d.ts +7 -0
  52. package/lib/types/functions/math/fact/__tests__/index.spec.d.ts +16 -0
  53. package/lib/types/functions/math/fact/index.d.ts +8 -0
  54. package/lib/types/functions/math/factdouble/__tests__/index.spec.d.ts +16 -0
  55. package/lib/types/functions/math/factdouble/index.d.ts +8 -0
  56. package/lib/types/functions/math/gcd/__tests__/index.spec.d.ts +16 -0
  57. package/lib/types/functions/math/gcd/index.d.ts +8 -0
  58. package/lib/types/functions/math/int/__tests__/index.spec.d.ts +16 -0
  59. package/lib/types/functions/math/int/index.d.ts +8 -0
  60. package/lib/types/functions/math/lcm/__tests__/index.spec.d.ts +16 -0
  61. package/lib/types/functions/math/lcm/index.d.ts +8 -0
  62. package/lib/types/functions/math/mdeterm/__tests__/index.spec.d.ts +16 -0
  63. package/lib/types/functions/math/mdeterm/index.d.ts +7 -0
  64. package/lib/types/functions/math/minverse/__tests__/index.spec.d.ts +16 -0
  65. package/lib/types/functions/math/minverse/index.d.ts +7 -0
  66. package/lib/types/functions/math/mmult/__tests__/index.spec.d.ts +16 -0
  67. package/lib/types/functions/math/mmult/index.d.ts +9 -0
  68. package/lib/types/functions/math/mod/index.d.ts +1 -1
  69. package/lib/types/functions/math/multinomial/__tests__/index.spec.d.ts +16 -0
  70. package/lib/types/functions/math/multinomial/index.d.ts +8 -0
  71. package/lib/types/functions/math/munit/__tests__/index.spec.d.ts +16 -0
  72. package/lib/types/functions/math/munit/index.d.ts +8 -0
  73. package/lib/types/functions/math/quotient/__tests__/index.spec.d.ts +16 -0
  74. package/lib/types/functions/math/quotient/index.d.ts +7 -0
  75. package/lib/types/functions/math/sequence/__tests__/index.spec.d.ts +16 -0
  76. package/lib/types/functions/math/sequence/index.d.ts +8 -0
  77. package/lib/types/functions/math/seriessum/__tests__/index.spec.d.ts +16 -0
  78. package/lib/types/functions/math/seriessum/index.d.ts +8 -0
  79. package/lib/types/functions/math/sign/__tests__/index.spec.d.ts +16 -0
  80. package/lib/types/functions/math/sign/index.d.ts +8 -0
  81. package/lib/types/models/__tests__/create-command-test-bed.d.ts +6 -6
  82. package/lib/types/models/formula-data.model.d.ts +3 -2
  83. package/lib/types/plugin.d.ts +5 -10
  84. package/lib/types/services/active-dirty-manager.service.d.ts +1 -1
  85. package/lib/types/services/current-data.service.d.ts +1 -1
  86. package/lib/types/services/defined-names.service.d.ts +1 -1
  87. package/lib/types/services/dependency-manager.service.d.ts +5 -10
  88. package/lib/types/services/feature-calculation-manager.service.d.ts +1 -1
  89. package/lib/types/services/function.service.d.ts +1 -1
  90. package/lib/types/services/other-formula-manager.service.d.ts +1 -1
  91. package/lib/types/services/runtime.service.d.ts +1 -1
  92. package/lib/types/services/super-table.service.d.ts +1 -1
  93. package/lib/umd/index.js +2 -2
  94. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- import { Nullable, Disposable, ObjectMatrix } from '@univerjs/core';
1
+ import { Disposable, ObjectMatrix, Nullable } from '@univerjs/core';
2
2
  import { FormulaDependencyTreeCache, FormulaDependencyTree } from '../engine/dependency/dependency-tree';
3
3
  export interface IOtherFormulaDependencyParam {
4
4
  [unitId: string]: Nullable<{
@@ -35,7 +35,7 @@ export interface IDependencyManagerService {
35
35
  addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
36
36
  removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
37
37
  hasFormulaDependency(unitId: string, sheetId: string, row: number, column: number): boolean;
38
- clearFormulaDependency(unitId: string, sheetId: string): void;
38
+ clearFormulaDependency(unitId: string, sheetId?: string): void;
39
39
  }
40
40
  /**
41
41
  * Passively marked as dirty, register the reference and execution actions of the feature plugin.
@@ -54,18 +54,13 @@ export declare class DependencyManagerService extends Disposable implements IDep
54
54
  */
55
55
  getAllTree(): FormulaDependencyTree[];
56
56
  buildDependencyTree(shouldBeBuildTrees: FormulaDependencyTree[] | FormulaDependencyTreeCache, dependencyTrees?: FormulaDependencyTree[]): FormulaDependencyTree[];
57
+ private _buildDependencyTreeWithCache;
57
58
  /**
58
59
  * Build the dependency relationship between the trees.
59
60
  * @param allTrees all FormulaDependencyTree
60
61
  * @param shouldBeBuildTrees FormulaDependencyTree[] | FormulaDependencyTreeCache
61
62
  */
62
63
  private _buildDependencyTree;
63
- /**
64
- * Build the reverse dependency relationship between the trees.
65
- * @param allTrees
66
- * @param dependencyTrees
67
- */
68
- private _buildReverseDependency;
69
64
  /**
70
65
  * Clear the dependency relationship of the tree.
71
66
  * establish the relationship between the parent and the child.
@@ -83,7 +78,7 @@ export declare class DependencyManagerService extends Disposable implements IDep
83
78
  hasFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): boolean;
84
79
  addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
85
80
  removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
86
- clearFormulaDependency(unitId: string, sheetId: string): void;
81
+ clearFormulaDependency(unitId: string, sheetId?: string): void;
87
82
  hasFormulaDependency(unitId: string, sheetId: string, row: number, column: number): boolean;
88
83
  }
89
- export declare const IDependencyManagerService: import('@univerjs/core').IdentifierDecorator<DependencyManagerService>;
84
+ export declare const IDependencyManagerService: import('@wendellhu/redi').IdentifierDecorator<DependencyManagerService>;
@@ -39,4 +39,4 @@ export declare class FeatureCalculationManagerService extends Disposable impleme
39
39
  register(unitId: string, subUnitId: string, featureId: string, referenceExecutor: IFeatureCalculationManagerParam): void;
40
40
  getReferenceExecutorMap(): Map<string, Map<string, Map<string, IFeatureCalculationManagerParam>>>;
41
41
  }
42
- export declare const IFeatureCalculationManagerService: import('@univerjs/core').IdentifierDecorator<FeatureCalculationManagerService>;
42
+ export declare const IFeatureCalculationManagerService: import('@wendellhu/redi').IdentifierDecorator<FeatureCalculationManagerService>;
@@ -26,7 +26,7 @@ export interface IFunctionService {
26
26
  hasDescription(functionToken: IFunctionNames): boolean;
27
27
  unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
28
28
  }
29
- export declare const IFunctionService: import('@univerjs/core').IdentifierDecorator<FunctionService>;
29
+ export declare const IFunctionService: import('@wendellhu/redi').IdentifierDecorator<FunctionService>;
30
30
  export declare class FunctionService extends Disposable implements IFunctionService {
31
31
  private _functionExecutors;
32
32
  private _functionDescriptions;
@@ -35,4 +35,4 @@ export declare class OtherFormulaManagerService extends Disposable implements IO
35
35
  batchRemove(formulaData: IDirtyUnitOtherFormulaMap): void;
36
36
  getOtherFormulaData(): IOtherFormulaData;
37
37
  }
38
- export declare const IOtherFormulaManagerService: import('@univerjs/core').IdentifierDecorator<OtherFormulaManagerService>;
38
+ export declare const IOtherFormulaManagerService: import('@wendellhu/redi').IdentifierDecorator<OtherFormulaManagerService>;
@@ -179,4 +179,4 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
179
179
  private _checkIfArrayFormulaExceeded;
180
180
  private _isInDirtyRange;
181
181
  }
182
- export declare const IFormulaRuntimeService: import('@univerjs/core').IdentifierDecorator<FormulaRuntimeService>;
182
+ export declare const IFormulaRuntimeService: import('@wendellhu/redi').IdentifierDecorator<FormulaRuntimeService>;
@@ -21,4 +21,4 @@ export declare class SuperTableService extends Disposable implements ISuperTable
21
21
  registerTable(unitId: string, tableName: string, reference: ISuperTable): void;
22
22
  registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void;
23
23
  }
24
- export declare const ISuperTableService: import('@univerjs/core').IdentifierDecorator<ISuperTableService>;
24
+ export declare const ISuperTableService: import('@wendellhu/redi').IdentifierDecorator<ISuperTableService>;