@univerjs/engine-formula 0.4.2 → 0.5.0-alpha.0
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/cjs/facade.js +1 -0
- package/lib/cjs/index.js +2 -2
- package/lib/es/facade.js +79 -0
- package/lib/es/index.js +23862 -21567
- package/lib/types/basics/common.d.ts +6 -2
- package/lib/types/basics/format.d.ts +2 -15
- package/lib/types/basics/math.d.ts +3 -0
- package/lib/types/basics/statistical.d.ts +19 -3
- package/lib/types/commands/mutations/set-other-formula.mutation.d.ts +2 -2
- package/lib/types/controller/calculate.controller.d.ts +2 -2
- package/lib/types/engine/analysis/parser.d.ts +0 -2
- package/lib/types/engine/ast-node/base-ast-node.d.ts +1 -0
- package/lib/types/engine/ast-node/function-node.d.ts +5 -2
- package/lib/types/engine/ast-node/operator-node.d.ts +1 -2
- package/lib/types/engine/ast-node/prefix-node.d.ts +6 -5
- package/lib/types/engine/ast-node/reference-node.d.ts +8 -10
- package/lib/types/engine/ast-node/suffix-node.d.ts +8 -5
- package/lib/types/engine/ast-node/union-node.d.ts +1 -2
- package/lib/types/engine/ast-node/value-node.d.ts +1 -2
- package/lib/types/engine/dependency/dependency-tree.d.ts +85 -38
- package/lib/types/engine/dependency/formula-dependency.d.ts +45 -36
- package/lib/types/engine/interpreter/interpreter.d.ts +3 -3
- package/lib/types/engine/utils/array-object.d.ts +1 -1
- package/lib/types/engine/utils/ast-node-tool.d.ts +1 -1
- package/lib/types/engine/utils/generate-ast-node.d.ts +8 -0
- package/lib/types/engine/utils/prefixHandler.d.ts +3 -2
- package/lib/types/engine/utils/value-object.d.ts +9 -1
- package/lib/types/engine/value-object/__tests__/array-inverted-index-cache.spec.d.ts +16 -0
- package/lib/types/engine/value-object/__tests__/array-inverted-index-cache2.spec.d.ts +16 -0
- package/lib/types/engine/value-object/cube-value-object.d.ts +1 -0
- package/lib/types/engine/value-object/lambda-value-object.d.ts +3 -1
- package/lib/types/engine/value-object/primitive-object.d.ts +0 -1
- package/lib/types/facade/f-formula.d.ts +31 -0
- package/lib/types/facade/f-univer.d.ts +9 -0
- package/lib/types/facade/index.d.ts +17 -0
- package/lib/types/functions/base-function.d.ts +7 -0
- package/lib/types/functions/compatibility/hypgeomdist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/compatibility/hypgeomdist/index.d.ts +8 -0
- package/lib/types/functions/compatibility/lognormdist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/compatibility/lognormdist/index.d.ts +8 -0
- package/lib/types/functions/compatibility/negbinomdist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/compatibility/negbinomdist/index.d.ts +8 -0
- package/lib/types/functions/compatibility/tdist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/compatibility/tdist/index.d.ts +8 -0
- package/lib/types/functions/financial/fv/index.d.ts +1 -1
- package/lib/types/functions/financial/ipmt/index.d.ts +1 -1
- package/lib/types/functions/financial/pmt/index.d.ts +1 -1
- package/lib/types/functions/financial/ppmt/index.d.ts +1 -1
- package/lib/types/functions/financial/pv/index.d.ts +1 -1
- package/lib/types/functions/lookup/formulatext/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/formulatext/index.d.ts +10 -0
- package/lib/types/functions/lookup/lookup/index.d.ts +1 -1
- package/lib/types/functions/math/mmult/index.d.ts +0 -1
- package/lib/types/functions/statistical/frequency/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/frequency/index.d.ts +9 -0
- package/lib/types/functions/statistical/gamma/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/gamma/index.d.ts +8 -0
- package/lib/types/functions/statistical/gamma-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/gamma-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/gamma-inv/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/gamma-inv/index.d.ts +8 -0
- package/lib/types/functions/statistical/gammaln/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/gammaln/index.d.ts +8 -0
- package/lib/types/functions/statistical/gauss/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/gauss/index.d.ts +8 -0
- package/lib/types/functions/statistical/geomean/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/geomean/index.d.ts +7 -0
- package/lib/types/functions/statistical/growth/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/growth/index.d.ts +16 -0
- package/lib/types/functions/statistical/harmean/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/harmean/index.d.ts +7 -0
- package/lib/types/functions/statistical/hypgeom-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/hypgeom-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/kurt/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/kurt/index.d.ts +8 -0
- package/lib/types/functions/statistical/large/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/large/index.d.ts +9 -0
- package/lib/types/functions/statistical/lognorm-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/lognorm-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/lognorm-inv/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/lognorm-inv/index.d.ts +8 -0
- package/lib/types/functions/statistical/median/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/median/index.d.ts +8 -0
- package/lib/types/functions/statistical/mode-mult/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/mode-mult/index.d.ts +8 -0
- package/lib/types/functions/statistical/mode-sngl/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/mode-sngl/index.d.ts +8 -0
- package/lib/types/functions/statistical/negbinom-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/negbinom-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/pearson/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/pearson/index.d.ts +8 -0
- package/lib/types/functions/statistical/percentile-exc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/percentile-exc/index.d.ts +9 -0
- package/lib/types/functions/statistical/percentile-inc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/percentile-inc/index.d.ts +9 -0
- package/lib/types/functions/statistical/percentrank-exc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/percentrank-exc/index.d.ts +9 -0
- package/lib/types/functions/statistical/percentrank-inc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/percentrank-inc/index.d.ts +9 -0
- package/lib/types/functions/statistical/permut/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/permut/index.d.ts +7 -0
- package/lib/types/functions/statistical/permutationa/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/permutationa/index.d.ts +7 -0
- package/lib/types/functions/statistical/phi/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/phi/index.d.ts +8 -0
- package/lib/types/functions/statistical/poisson-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/poisson-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/prob/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/prob/index.d.ts +9 -0
- package/lib/types/functions/statistical/quartile-exc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/quartile-exc/index.d.ts +9 -0
- package/lib/types/functions/statistical/quartile-inc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/quartile-inc/index.d.ts +9 -0
- package/lib/types/functions/statistical/rsq/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/rsq/index.d.ts +8 -0
- package/lib/types/functions/statistical/skew/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/skew/index.d.ts +8 -0
- package/lib/types/functions/statistical/skew-p/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/skew-p/index.d.ts +8 -0
- package/lib/types/functions/statistical/slope/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/slope/index.d.ts +8 -0
- package/lib/types/functions/statistical/small/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/small/index.d.ts +9 -0
- package/lib/types/functions/statistical/standardize/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/standardize/index.d.ts +8 -0
- package/lib/types/functions/statistical/steyx/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/steyx/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-dist-2t/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-dist-2t/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-dist-rt/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-dist-rt/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-inv/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-inv/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-inv-2t/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-inv-2t/index.d.ts +8 -0
- package/lib/types/functions/statistical/t-test/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/t-test/index.d.ts +14 -0
- package/lib/types/functions/statistical/trimmean/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/trimmean/index.d.ts +9 -0
- package/lib/types/functions/statistical/weibull-dist/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/weibull-dist/index.d.ts +8 -0
- package/lib/types/functions/statistical/z-test/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/z-test/index.d.ts +9 -0
- package/lib/types/functions/text/exact/index.d.ts +1 -1
- package/lib/types/functions/text/find/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/find/index.d.ts +8 -0
- package/lib/types/functions/text/findb/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/findb/index.d.ts +8 -0
- package/lib/types/functions/text/function-map.d.ts +1 -2
- package/lib/types/functions/text/left/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/left/index.d.ts +8 -0
- package/lib/types/functions/text/lower/index.d.ts +2 -3
- package/lib/types/functions/text/mid/index.d.ts +2 -2
- package/lib/types/functions/text/midb/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/midb/index.d.ts +8 -0
- package/lib/types/functions/text/proper/index.d.ts +1 -1
- package/lib/types/functions/text/replace/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/replace/index.d.ts +8 -0
- package/lib/types/functions/text/replaceb/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/replaceb/index.d.ts +8 -0
- package/lib/types/functions/text/search/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/search/index.d.ts +8 -0
- package/lib/types/functions/text/searchb/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/searchb/index.d.ts +8 -0
- package/lib/types/functions/text/t/index.d.ts +1 -1
- package/lib/types/functions/text/textjoin/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/textjoin/index.d.ts +10 -0
- package/lib/types/functions/text/trim/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/trim/index.d.ts +8 -0
- package/lib/types/functions/text/upper/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/upper/index.d.ts +8 -0
- package/lib/types/index.d.ts +13 -2
- package/lib/types/models/formula-data.model.d.ts +6 -1
- package/lib/types/plugin.d.ts +3 -2
- package/lib/types/services/calculate-formula.service.d.ts +25 -14
- package/lib/types/services/dependency-manager.service.d.ts +70 -69
- package/lib/types/services/other-formula-manager.service.d.ts +4 -4
- package/lib/types/services/runtime.service.d.ts +2 -2
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +2 -2
- package/package.json +21 -11
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Search extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(findText: BaseValueObject, withinText: BaseValueObject, startNum?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Searchb extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(findText: BaseValueObject, withinText: BaseValueObject, startNum?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseFunction } from '../../base-function';
|
|
2
1
|
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
3
|
export declare class T extends BaseFunction {
|
|
4
4
|
minParams: number;
|
|
5
5
|
maxParams: number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Textjoin extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(delimiter: BaseValueObject, ignoreEmpty: BaseValueObject, ...variants: BaseValueObject[]): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
private _getDelimiterValues;
|
|
9
|
+
private _getTextValues;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Trim extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(text: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class Upper extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(text: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export { ReferenceNodeFactory } from './engine/ast-node/reference-node';
|
|
|
49
49
|
export { SuffixNodeFactory } from './engine/ast-node/suffix-node';
|
|
50
50
|
export { UnionNodeFactory } from './engine/ast-node/union-node';
|
|
51
51
|
export { ValueNodeFactory } from './engine/ast-node/value-node';
|
|
52
|
-
export { FormulaDependencyGenerator } from './engine/dependency/formula-dependency';
|
|
52
|
+
export { FormulaDependencyGenerator, IFormulaDependencyGenerator } from './engine/dependency/formula-dependency';
|
|
53
53
|
export { Interpreter } from './engine/interpreter/interpreter';
|
|
54
54
|
export { BaseReferenceObject, type FunctionVariantType } from './engine/reference-object/base-reference-object';
|
|
55
55
|
export { AsyncArrayObject, AsyncObject } from './engine/reference-object/base-reference-object';
|
|
@@ -103,7 +103,7 @@ export type { IRangeChange } from './models/formula-data.model';
|
|
|
103
103
|
export { UniverFormulaEnginePlugin } from './plugin';
|
|
104
104
|
export { IActiveDirtyManagerService } from './services/active-dirty-manager.service';
|
|
105
105
|
export { ActiveDirtyManagerService } from './services/active-dirty-manager.service';
|
|
106
|
-
export { CalculateFormulaService } from './services/calculate-formula.service';
|
|
106
|
+
export { CalculateFormulaService, ICalculateFormulaService } from './services/calculate-formula.service';
|
|
107
107
|
export { FormulaCurrentConfigService, IFormulaCurrentConfigService, type IFormulaDirtyData } from './services/current-data.service';
|
|
108
108
|
export { DefinedNamesService, type IDefinedNameMapItem, IDefinedNamesService, type IDefinedNamesServiceParam } from './services/defined-names.service';
|
|
109
109
|
export { IDependencyManagerService } from './services/dependency-manager.service';
|
|
@@ -116,3 +116,14 @@ export { FormulaExecutedStateType, FormulaExecuteStageType, FormulaRuntimeServic
|
|
|
116
116
|
export { ISuperTableService } from './services/super-table.service';
|
|
117
117
|
export { SuperTableService } from './services/super-table.service';
|
|
118
118
|
export { deserializeRangeWithSheetWithCache } from './engine/utils/reference-cache';
|
|
119
|
+
export { FFormula } from './facade/f-formula';
|
|
120
|
+
export { FormulaDependencyTree, type IFormulaDependencyTree } from './engine/dependency/dependency-tree';
|
|
121
|
+
export { type IOtherFormulaData } from './basics/common';
|
|
122
|
+
export { FormulaDependencyTreeType } from './engine/dependency/dependency-tree';
|
|
123
|
+
export { FormulaDependencyTreeVirtual } from './engine/dependency/dependency-tree';
|
|
124
|
+
export { generateAstNode } from './engine/utils/generate-ast-node';
|
|
125
|
+
export { type IFeatureCalculationManagerParam } from './services/feature-calculation-manager.service';
|
|
126
|
+
export { DEFAULT_INTERVAL_COUNT } from './services/calculate-formula.service';
|
|
127
|
+
export { type IUniverEngineFormulaConfig, PLUGIN_CONFIG_KEY } from './controller/config.schema';
|
|
128
|
+
export { generateRandomDependencyTreeId } from './engine/dependency/formula-dependency';
|
|
129
|
+
export { DependencyManagerBaseService } from './services/dependency-manager.service';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { ICellData, IObjectMatrixPrimitiveType, IRange, IUnitRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
|
|
3
3
|
import { IFormulaIdMap } from './utils/formula-data-util';
|
|
4
4
|
import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
|
|
@@ -41,5 +41,10 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
41
41
|
getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
|
|
42
42
|
getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
|
|
43
43
|
getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Function to get all formula ranges
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
getFormulaDirtyRanges(): IUnitRange[];
|
|
44
49
|
}
|
|
45
50
|
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): IFormulaData;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IUniverEngineFormulaConfig } from './controller/config.schema';
|
|
2
2
|
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
3
3
|
export declare class UniverFormulaEnginePlugin extends Plugin {
|
|
4
|
-
|
|
4
|
+
protected readonly _config: Partial<IUniverEngineFormulaConfig>;
|
|
5
5
|
protected _injector: Injector;
|
|
6
|
-
|
|
6
|
+
protected readonly _configService: IConfigService;
|
|
7
7
|
static pluginName: string;
|
|
8
8
|
constructor(_config: Partial<IUniverEngineFormulaConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
9
9
|
onStarting(): void;
|
|
10
10
|
onReady(): void;
|
|
11
11
|
onRendered(): void;
|
|
12
12
|
private _initialize;
|
|
13
|
+
protected _initializeWithOverride(): void;
|
|
13
14
|
}
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
+
import { Observable, Subject } from 'rxjs';
|
|
1
2
|
import { IFeatureDirtyRangeType, IFormulaDatasetConfig, IRuntimeUnitDataType } from '../basics/common';
|
|
2
3
|
import { IAllRuntimeData, IExecutionInProgressParams, IFormulaRuntimeService } from './runtime.service';
|
|
3
4
|
import { Disposable, IConfigService } from '@univerjs/core';
|
|
4
5
|
import { Lexer } from '../engine/analysis/lexer';
|
|
5
6
|
import { AstTreeBuilder } from '../engine/analysis/parser';
|
|
6
7
|
import { ErrorNode } from '../engine/ast-node/base-ast-node';
|
|
7
|
-
import {
|
|
8
|
+
import { IFormulaDependencyGenerator } from '../engine/dependency/formula-dependency';
|
|
8
9
|
import { Interpreter } from '../engine/interpreter/interpreter';
|
|
9
10
|
import { IFormulaCurrentConfigService } from './current-data.service';
|
|
10
11
|
export declare const DEFAULT_CYCLE_REFERENCE_COUNT = 1;
|
|
11
12
|
export declare const DEFAULT_INTERVAL_COUNT = 500;
|
|
12
13
|
export declare const CYCLE_REFERENCE_COUNT = "cycleReferenceCount";
|
|
13
14
|
export declare const EVERY_N_FUNCTION_EXECUTION_PAUSE = 100;
|
|
15
|
+
export interface ICalculateFormulaService {
|
|
16
|
+
executionInProgressListener$: Observable<IExecutionInProgressParams>;
|
|
17
|
+
executionCompleteListener$: Observable<IAllRuntimeData>;
|
|
18
|
+
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
|
|
19
|
+
setRuntimeFeatureRange(featureId: string, featureRange: IFeatureDirtyRangeType): void;
|
|
20
|
+
execute(formulaDatasetConfig: IFormulaDatasetConfig): Promise<void>;
|
|
21
|
+
stopFormulaExecution(): void;
|
|
22
|
+
calculate(formulaString: string, transformSuffix?: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const ICalculateFormulaService: import('@wendellhu/redi').IdentifierDecorator<ICalculateFormulaService>;
|
|
14
25
|
export declare class CalculateFormulaService extends Disposable {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly executionInProgressListener$:
|
|
24
|
-
|
|
25
|
-
readonly executionCompleteListener$:
|
|
26
|
-
constructor(_configService: IConfigService, _lexer: Lexer, _currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _formulaDependencyGenerator:
|
|
26
|
+
protected readonly _configService: IConfigService;
|
|
27
|
+
protected readonly _lexer: Lexer;
|
|
28
|
+
protected readonly _currentConfigService: IFormulaCurrentConfigService;
|
|
29
|
+
protected readonly _runtimeService: IFormulaRuntimeService;
|
|
30
|
+
protected readonly _formulaDependencyGenerator: IFormulaDependencyGenerator;
|
|
31
|
+
protected readonly _interpreter: Interpreter;
|
|
32
|
+
protected readonly _astTreeBuilder: AstTreeBuilder;
|
|
33
|
+
protected readonly _executionInProgressListener$: Subject<IExecutionInProgressParams>;
|
|
34
|
+
readonly executionInProgressListener$: Observable<IExecutionInProgressParams>;
|
|
35
|
+
protected readonly _executionCompleteListener$: Subject<IAllRuntimeData>;
|
|
36
|
+
readonly executionCompleteListener$: Observable<IAllRuntimeData>;
|
|
37
|
+
constructor(_configService: IConfigService, _lexer: Lexer, _currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _formulaDependencyGenerator: IFormulaDependencyGenerator, _interpreter: Interpreter, _astTreeBuilder: AstTreeBuilder);
|
|
27
38
|
/**
|
|
28
39
|
* Stop the execution of the formula.
|
|
29
40
|
*/
|
|
@@ -40,6 +51,6 @@ export declare class CalculateFormulaService extends Disposable {
|
|
|
40
51
|
execute(formulaDatasetConfig: IFormulaDatasetConfig): Promise<void>;
|
|
41
52
|
private _execute;
|
|
42
53
|
private _getArrayFormulaDirtyRangeAndExcludedRange;
|
|
43
|
-
|
|
54
|
+
protected _apply(isArrayFormulaState?: boolean): Promise<IAllRuntimeData | undefined>;
|
|
44
55
|
calculate(formulaString: string, transformSuffix?: boolean): ErrorNode | undefined;
|
|
45
56
|
}
|
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
import { IUnitRange, Nullable, Disposable, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
[unitId: string]: Nullable<{
|
|
5
|
-
[sheetId: string]: {
|
|
6
|
-
[formulaId: string]: Nullable<number>;
|
|
7
|
-
};
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
|
-
export interface IFeatureFormulaDependencyParam {
|
|
11
|
-
[unitId: string]: Nullable<{
|
|
12
|
-
[sheetId: string]: {
|
|
13
|
-
[featureId: string]: Nullable<number>;
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export interface IFormulaDependencyParam {
|
|
18
|
-
[unitId: string]: Nullable<{
|
|
19
|
-
[sheetId: string]: ObjectMatrix<number>;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
1
|
+
import { IUnitRange, Nullable, Disposable, ObjectMatrix, RTree } from '@univerjs/core';
|
|
2
|
+
import { AstRootNode } from '../engine/ast-node';
|
|
3
|
+
import { FormulaDependencyTree, IFormulaDependencyTree } from '../engine/dependency/dependency-tree';
|
|
22
4
|
export interface IDependencyManagerService {
|
|
23
5
|
dispose(): void;
|
|
24
|
-
getAllTree(): FormulaDependencyTree[];
|
|
25
|
-
buildDependencyTree(shouldBeBuildTrees: FormulaDependencyTree[], dependencyTrees?: FormulaDependencyTree[]): FormulaDependencyTree[];
|
|
26
|
-
clearDependencyForTree(shouldBeClearTree: Nullable<FormulaDependencyTree>): void;
|
|
27
6
|
reset(): void;
|
|
28
|
-
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree:
|
|
7
|
+
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: IFormulaDependencyTree): void;
|
|
8
|
+
addOtherFormulaDependencyMainData(formulaId: string): void;
|
|
29
9
|
removeOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string[]): void;
|
|
30
|
-
|
|
10
|
+
hasOtherFormulaDataMainData(formulaId: string): boolean;
|
|
11
|
+
clearOtherFormulaDependency(unitId: string, sheetId?: string): void;
|
|
12
|
+
getOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): Nullable<ObjectMatrix<number>>;
|
|
31
13
|
addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
32
14
|
removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
|
|
33
|
-
getFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): Nullable<
|
|
34
|
-
|
|
15
|
+
getFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): Nullable<number>;
|
|
16
|
+
clearFeatureFormulaDependency(unitId: string, sheetId?: string): void;
|
|
17
|
+
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree): void;
|
|
35
18
|
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
36
|
-
getFormulaDependency(unitId: string, sheetId: string, row: number, column: number): Nullable<
|
|
37
|
-
removeFormulaDependencyByDefinedName(unitId: string, definedName: string): void;
|
|
19
|
+
getFormulaDependency(unitId: string, sheetId: string, row: number, column: number): Nullable<number>;
|
|
38
20
|
clearFormulaDependency(unitId: string, sheetId?: string): void;
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
removeFormulaDependencyByDefinedName(unitId: string, definedName: string): void;
|
|
22
|
+
addFormulaDependencyByDefinedName(tree: IFormulaDependencyTree, node: Nullable<AstRootNode>): void;
|
|
23
|
+
addDependencyRTreeCache(tree: IFormulaDependencyTree): void;
|
|
24
|
+
searchDependency(search: IUnitRange[], exceptTreeIds?: Set<number>): Set<number>;
|
|
41
25
|
getLastTreeId(): number;
|
|
42
|
-
|
|
26
|
+
getTreeById(treeId: number): Nullable<IFormulaDependencyTree>;
|
|
27
|
+
getAllTree(): IFormulaDependencyTree[];
|
|
28
|
+
buildDependencyTree(shouldBeBuildTrees: IFormulaDependencyTree[], dependencyTrees?: IFormulaDependencyTree[]): IFormulaDependencyTree[];
|
|
29
|
+
}
|
|
30
|
+
export declare class DependencyManagerBaseService extends Disposable implements IDependencyManagerService {
|
|
31
|
+
buildDependencyTree(shouldBeBuildTrees: IFormulaDependencyTree[], dependencyTrees?: IFormulaDependencyTree[]): IFormulaDependencyTree[];
|
|
32
|
+
getTreeById(treeId: number): Nullable<IFormulaDependencyTree>;
|
|
33
|
+
getAllTree(): IFormulaDependencyTree[];
|
|
34
|
+
protected _otherFormulaData: Map<string, Map<string, Map<string, ObjectMatrix<number>>>>;
|
|
35
|
+
protected _featureFormulaData: Map<string, Map<string, Map<string, Nullable<number>>>>;
|
|
36
|
+
protected _formulaData: Map<string, Map<string, ObjectMatrix<number>>>;
|
|
37
|
+
protected _definedNameMap: Map<string, Map<string, Set<number>>>;
|
|
38
|
+
protected _otherFormulaDataMainData: Set<string>;
|
|
39
|
+
protected _dependencyRTreeCache: RTree;
|
|
40
|
+
private _dependencyTreeIdLast;
|
|
41
|
+
reset(): void;
|
|
42
|
+
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: IFormulaDependencyTree): void;
|
|
43
|
+
removeOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string[]): void;
|
|
43
44
|
clearOtherFormulaDependency(unitId: string, sheetId?: string): void;
|
|
45
|
+
addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
46
|
+
removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
|
|
44
47
|
clearFeatureFormulaDependency(unitId: string, sheetId?: string): void;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree): void;
|
|
49
|
+
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
50
|
+
clearFormulaDependency(unitId: string, sheetId?: string): void;
|
|
51
|
+
removeFormulaDependencyByDefinedName(unitId: string, definedName: string): void;
|
|
52
|
+
searchDependency(search: IUnitRange[], exceptTreeIds?: Set<number>): Set<number>;
|
|
53
|
+
protected _restDependencyTreeId(): void;
|
|
54
|
+
getOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): ObjectMatrix<number> | undefined;
|
|
55
|
+
addOtherFormulaDependencyMainData(formulaId: string): void;
|
|
56
|
+
hasOtherFormulaDataMainData(formulaId: string): boolean;
|
|
57
|
+
protected _removeDependencyRTreeCacheById(unitId: string, sheetId: string): void;
|
|
58
|
+
getFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): Nullable<number>;
|
|
59
|
+
getFormulaDependency(unitId: string, sheetId: string, row: number, column: number): Nullable<number>;
|
|
60
|
+
addDependencyRTreeCache(tree: IFormulaDependencyTree): void;
|
|
61
|
+
getLastTreeId(): number;
|
|
62
|
+
protected _addAllTreeMap(tree: IFormulaDependencyTree): void;
|
|
63
|
+
protected _addDefinedName(unitId: string, definedName: string, treeId: number): void;
|
|
64
|
+
addFormulaDependencyByDefinedName(tree: IFormulaDependencyTree, node: Nullable<AstRootNode>): void;
|
|
48
65
|
}
|
|
49
66
|
/**
|
|
50
67
|
* Passively marked as dirty, register the reference and execution actions of the feature plugin.
|
|
@@ -52,22 +69,10 @@ export interface IDependencyManagerService {
|
|
|
52
69
|
* causing the formula to be marked dirty again,
|
|
53
70
|
* thereby completing the calculation of the entire dependency tree.
|
|
54
71
|
*/
|
|
55
|
-
export declare class DependencyManagerService extends
|
|
56
|
-
|
|
57
|
-
private _featureFormulaData;
|
|
58
|
-
private _formulaData;
|
|
59
|
-
private _allTreeMap;
|
|
60
|
-
private _dependencyRTreeCache;
|
|
61
|
-
private _dependencyTreeIdLast;
|
|
72
|
+
export declare class DependencyManagerService extends DependencyManagerBaseService implements IDependencyManagerService {
|
|
73
|
+
protected _allTreeMap: Map<number, IFormulaDependencyTree>;
|
|
62
74
|
dispose(): void;
|
|
63
|
-
|
|
64
|
-
* Get all FormulaDependencyTree from _otherFormulaData, _featureFormulaData, _formulaData
|
|
65
|
-
* return FormulaDependencyTree[]
|
|
66
|
-
*/
|
|
67
|
-
getAllTree(): FormulaDependencyTree[];
|
|
68
|
-
getTreeById(treeId: number): FormulaDependencyTree | undefined;
|
|
69
|
-
buildDependencyTree(shouldBeBuildTrees: FormulaDependencyTree[], dependencyTrees?: FormulaDependencyTree[]): FormulaDependencyTree[];
|
|
70
|
-
searchDependency(search: IUnitRange[]): Set<number>;
|
|
75
|
+
buildDependencyTree(shouldBeBuildTrees: IFormulaDependencyTree[], dependencyTrees?: IFormulaDependencyTree[]): IFormulaDependencyTree[];
|
|
71
76
|
/**
|
|
72
77
|
* Build the dependency relationship between the trees.
|
|
73
78
|
* @param allTrees all FormulaDependencyTree
|
|
@@ -81,34 +86,30 @@ export declare class DependencyManagerService extends Disposable implements IDep
|
|
|
81
86
|
*/
|
|
82
87
|
private _buildReverseDependency;
|
|
83
88
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* @param shouldBeClearTree
|
|
89
|
+
* Get all FormulaDependencyTree from _otherFormulaData, _featureFormulaData, _formulaData
|
|
90
|
+
* return FormulaDependencyTree[]
|
|
87
91
|
*/
|
|
88
|
-
|
|
92
|
+
getAllTree(): IFormulaDependencyTree[];
|
|
93
|
+
getTreeById(treeId: number): IFormulaDependencyTree | undefined;
|
|
89
94
|
reset(): void;
|
|
90
|
-
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree:
|
|
95
|
+
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: IFormulaDependencyTree): void;
|
|
91
96
|
removeOtherFormulaDependency(unitId: string, sheetId: string, formulaIds: string[]): void;
|
|
92
|
-
getOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): FormulaDependencyTree | undefined;
|
|
93
|
-
hasOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): boolean;
|
|
94
97
|
clearOtherFormulaDependency(unitId: string, sheetId?: string): void;
|
|
95
98
|
addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
96
99
|
removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
|
|
97
100
|
clearFeatureFormulaDependency(unitId: string, sheetId?: string): void;
|
|
98
|
-
|
|
99
|
-
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
|
|
101
|
+
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree): void;
|
|
100
102
|
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
101
103
|
clearFormulaDependency(unitId: string, sheetId?: string): void;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Clear the dependency relationship of the tree.
|
|
106
|
+
* establish the relationship between the parent and the child.
|
|
107
|
+
* @param shouldBeClearTree
|
|
108
|
+
*/
|
|
109
|
+
clearDependencyForTree(shouldBeClearTree: Nullable<IFormulaDependencyTree>): void;
|
|
108
110
|
private _removeDependencyRTreeCache;
|
|
109
111
|
removeFormulaDependencyByDefinedName(unitId: string, definedName: string): void;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
private _removeAllTreeMap;
|
|
112
|
+
protected _removeAllTreeMap(treeId: Nullable<number>): void;
|
|
113
|
+
protected _addAllTreeMap(tree: IFormulaDependencyTree): void;
|
|
113
114
|
}
|
|
114
115
|
export declare const IDependencyManagerService: import('@wendellhu/redi').IdentifierDecorator<DependencyManagerService>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Nullable, Disposable } from '@univerjs/core';
|
|
2
|
-
import { IDirtyUnitOtherFormulaMap,
|
|
2
|
+
import { IDirtyUnitOtherFormulaMap, IOtherFormulaData, IOtherFormulaDataItem } from '../basics/common';
|
|
3
3
|
export interface IOtherFormulaManagerSearchParam {
|
|
4
4
|
unitId: string;
|
|
5
5
|
subUnitId: string;
|
|
6
6
|
formulaId: string;
|
|
7
7
|
}
|
|
8
8
|
export interface IOtherFormulaManagerInsertParam extends IOtherFormulaManagerSearchParam {
|
|
9
|
-
item:
|
|
9
|
+
item: IOtherFormulaDataItem;
|
|
10
10
|
}
|
|
11
11
|
export interface IOtherFormulaManagerService {
|
|
12
12
|
dispose(): void;
|
|
13
13
|
remove(searchParam: IOtherFormulaManagerSearchParam): void;
|
|
14
|
-
get(searchParam: IOtherFormulaManagerSearchParam): Nullable<
|
|
14
|
+
get(searchParam: IOtherFormulaManagerSearchParam): Nullable<IOtherFormulaDataItem>;
|
|
15
15
|
has(searchParam: IOtherFormulaManagerSearchParam): boolean;
|
|
16
16
|
register(insertParam: IOtherFormulaManagerInsertParam): void;
|
|
17
17
|
getOtherFormulaData(): IOtherFormulaData;
|
|
@@ -28,7 +28,7 @@ export declare class OtherFormulaManagerService extends Disposable implements IO
|
|
|
28
28
|
private _otherFormulaData;
|
|
29
29
|
dispose(): void;
|
|
30
30
|
remove(searchParam: IOtherFormulaManagerSearchParam): void;
|
|
31
|
-
get(searchParam: IOtherFormulaManagerSearchParam):
|
|
31
|
+
get(searchParam: IOtherFormulaManagerSearchParam): IOtherFormulaDataItem | undefined;
|
|
32
32
|
has(searchParam: IOtherFormulaManagerSearchParam): boolean;
|
|
33
33
|
register(insertParam: IOtherFormulaManagerInsertParam): void;
|
|
34
34
|
batchRegister(formulaData: IOtherFormulaData): void;
|
|
@@ -69,7 +69,7 @@ export interface IFormulaRuntimeService {
|
|
|
69
69
|
setFormulaCycleIndex(index: number): void;
|
|
70
70
|
isStopExecution(): boolean;
|
|
71
71
|
getFormulaExecuteStage(): FormulaExecuteStageType;
|
|
72
|
-
setRuntimeOtherData(formulaId: string, functionVariant: FunctionVariantType): void;
|
|
72
|
+
setRuntimeOtherData(formulaId: string, x: number, y: number, functionVariant: FunctionVariantType): void;
|
|
73
73
|
getRuntimeOtherData(): IRuntimeOtherUnitDataType;
|
|
74
74
|
getAllRuntimeData(): IAllRuntimeData;
|
|
75
75
|
markedAsSuccessfullyExecuted(): void;
|
|
@@ -159,7 +159,7 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
159
159
|
clearFunctionDefinitionPrivacyVar(): void;
|
|
160
160
|
registerFunctionDefinitionPrivacyVar(lambdaId: string, lambdaVar: Map<string, Nullable<BaseAstNode>>): void;
|
|
161
161
|
getFunctionDefinitionPrivacyVar(lambdaId: string): Nullable<Map<string, Nullable<BaseAstNode>>>;
|
|
162
|
-
setRuntimeOtherData(formulaId: string, functionVariant: FunctionVariantType): void;
|
|
162
|
+
setRuntimeOtherData(formulaId: string, x: number, y: number, functionVariant: FunctionVariantType): void;
|
|
163
163
|
setRuntimeData(functionVariant: FunctionVariantType): void;
|
|
164
164
|
getUnitData(): IRuntimeUnitDataType;
|
|
165
165
|
getUnitArrayFormula(): IArrayFormulaRangeType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(i,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.UniverEngineFormulaFacade={},i.UniverCore,i.UniverEngineFormula))})(this,function(i,a,u){"use strict";var m=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(r,t,e,n)=>{for(var o=n>1?void 0:n?d(t,e):t,c=r.length-1,s;c>=0;c--)(s=r[c])&&(o=(n?s(t,e,o):s(o))||o);return n&&o&&m(t,e,o),o},l=(r,t)=>(e,n)=>t(e,n,r);i.FFormula=class extends a.FBase{constructor(t,e){super(),this._commandService=t,this._injector=e}executeCalculation(){this._commandService.executeCommand(u.SetFormulaCalculationStartMutation.id,{commands:[],forceCalculation:!0},{onlyLocal:!0})}stopCalculation(){this._commandService.executeCommand(u.SetFormulaCalculationStopMutation.id,{})}calculationStart(t){return this._commandService.onCommandExecuted(e=>{if(e.id===u.SetFormulaCalculationStartMutation.id){const n=e.params;t(n.forceCalculation)}})}calculationEnd(t){return this._commandService.onCommandExecuted(e=>{if(e.id!==u.SetFormulaCalculationNotificationMutation.id)return;const n=e.params;n.functionsExecutedState!==void 0&&t(n.functionsExecutedState)})}onCalculationEnd(){return new Promise((t,e)=>{const n=setTimeout(()=>{e(new Error("Calculation end timeout"))},3e4),o=this.calculationEnd(()=>{clearTimeout(n),o.dispose(),t()})})}calculationProcessing(t){return this._commandService.onCommandExecuted(e=>{if(e.id!==u.SetFormulaCalculationNotificationMutation.id)return;const n=e.params;n.stageInfo!==void 0&&t(n.stageInfo)})}},i.FFormula=f([l(0,a.Inject(a.ICommandService)),l(1,a.Inject(a.Injector))],i.FFormula);class v extends a.FUniver{getFormula(){return this._injector.createInstance(i.FFormula)}}a.FUniver.extend(v),Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|