@univerjs/engine-formula 0.12.0 → 0.12.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.
Files changed (27) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +9346 -9058
  3. package/lib/index.js +9346 -9058
  4. package/lib/types/basics/common.d.ts +12 -0
  5. package/lib/types/basics/statistical.d.ts +53 -0
  6. package/lib/types/commands/mutations/set-image-formula-data.mutation.d.ts +9 -0
  7. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +6 -0
  8. package/lib/types/engine/value-object/array-value-object.d.ts +5 -0
  9. package/lib/types/engine/value-object/base-value-object.d.ts +1 -0
  10. package/lib/types/engine/value-object/primitive-object.d.ts +23 -2
  11. package/lib/types/functions/lookup/image/index.d.ts +8 -0
  12. package/lib/types/functions/math/aggregate/index.d.ts +14 -0
  13. package/lib/types/functions/math/subtotal/index.d.ts +4 -16
  14. package/lib/types/functions/statistical/large/index.d.ts +0 -1
  15. package/lib/types/functions/statistical/median/index.d.ts +0 -1
  16. package/lib/types/functions/statistical/mode-sngl/index.d.ts +0 -1
  17. package/lib/types/functions/statistical/percentile-exc/index.d.ts +0 -1
  18. package/lib/types/functions/statistical/percentile-inc/index.d.ts +0 -1
  19. package/lib/types/functions/statistical/quartile-exc/index.d.ts +0 -1
  20. package/lib/types/functions/statistical/quartile-inc/index.d.ts +0 -1
  21. package/lib/types/functions/statistical/small/index.d.ts +0 -1
  22. package/lib/types/index.d.ts +3 -2
  23. package/lib/types/models/formula-data.model.d.ts +6 -1
  24. package/lib/types/services/current-data.service.d.ts +3 -1
  25. package/lib/types/services/runtime.service.d.ts +5 -1
  26. package/lib/umd/index.js +1 -1
  27. package/package.json +4 -4
@@ -1,4 +1,5 @@
1
1
  import { ICellData, IColumnData, IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, IRange, IRowData, IUnitRange, Nullable, ObjectMatrix, Styles } from '@univerjs/core';
2
+ import { IImageFormulaInfo } from '../engine/value-object/primitive-object';
2
3
  export declare const ERROR_VALUE_OBJECT_CLASS_TYPE = "errorValueObject";
3
4
  export declare const ASYNC_OBJECT_CLASS_TYPE = "asyncObject";
4
5
  export declare const REFERENCE_OBJECT_CLASS_TYPE = "referenceObject";
@@ -102,6 +103,17 @@ export interface IFeatureDirtyRangeType {
102
103
  [sheetId: string]: IRange[];
103
104
  }>;
104
105
  }
106
+ export interface IRuntimeImageFormulaDataType extends IImageFormulaInfo {
107
+ unitId: string;
108
+ sheetId: string;
109
+ row: number;
110
+ column: number;
111
+ }
112
+ export interface IUnitImageFormulaDataType {
113
+ [unitId: string]: Nullable<{
114
+ [sheetId: string]: ObjectMatrix<Nullable<IImageFormulaInfo>>;
115
+ }>;
116
+ }
105
117
  export interface IArrayFormulaUnitCellType extends IRuntimeUnitDataPrimitiveType {
106
118
  }
107
119
  export interface IFormulaData {
@@ -1,4 +1,7 @@
1
+ import { BaseReferenceObject, FunctionVariantType } from '../engine/reference-object/base-reference-object';
2
+ import { MultiAreaReferenceObject } from '../engine/reference-object/multi-area-reference-object';
1
3
  import { BaseValueObject, ErrorValueObject } from '../engine/value-object/base-value-object';
4
+ import { FormulaDataModel } from '../models/formula-data.model';
2
5
  export declare function betaCDF(x: number, alpha: number, beta: number): number;
3
6
  export declare function betaPDF(x: number, alpha: number, beta: number): number;
4
7
  export declare function betaINV(probability: number, alpha: number, beta: number): number;
@@ -67,3 +70,53 @@ export declare function getKnownsArrayCoefficients(knownYsValues: number[][], kn
67
70
  newX: number[][];
68
71
  XTXInverse: number[][];
69
72
  };
73
+ /**
74
+ * Parse aggregate data references into multi-area refs and normal refs, currently only used in functions like SUBTOTAL and AGGREGATE.
75
+ * If there is any invalid reference, return isError as true.
76
+ */
77
+ export declare function parseAggregateDataRefs(refs: FunctionVariantType[]): {
78
+ isError: boolean;
79
+ multiAreaRefs: MultiAreaReferenceObject[];
80
+ normalRefs: BaseReferenceObject[];
81
+ };
82
+ export declare enum AggregateFunctionType {
83
+ AVERAGE = "AVERAGE",
84
+ COUNT = "COUNT",
85
+ COUNTA = "COUNTA",
86
+ MAX = "MAX",
87
+ MIN = "MIN",
88
+ PRODUCT = "PRODUCT",
89
+ STDEV = "STDEV",
90
+ STDEV_S = "STDEV.S",
91
+ STDEVP = "STDEVP",
92
+ STDEV_P = "STDEV.P",
93
+ SUM = "SUM",
94
+ VAR = "VAR",
95
+ VAR_S = "VAR.S",
96
+ VARP = "VARP",
97
+ VAR_P = "VAR.P",
98
+ MEDIAN = "MEDIAN",
99
+ MODE_SNGL = "MODE.SNGL"
100
+ }
101
+ export type modeSnglValueCountMapType = Record<number, {
102
+ count: number;
103
+ order: number;
104
+ }>;
105
+ export declare function getModeSnglResult(valueCountMap: modeSnglValueCountMapType, valueMaxCount: number): BaseValueObject;
106
+ export interface IAggregateIgnoreOptions {
107
+ ignoreRowHidden: boolean;
108
+ ignoreErrorValues: boolean;
109
+ ignoreNested: boolean;
110
+ }
111
+ export declare function getAggregateResult(options: {
112
+ type: AggregateFunctionType;
113
+ formulaDataModel: FormulaDataModel;
114
+ } & IAggregateIgnoreOptions, refs: BaseReferenceObject[]): BaseValueObject;
115
+ export declare function getArrayValuesByAggregateIgnoreOptions(array: FunctionVariantType, options?: IAggregateIgnoreOptions, formulaDataModel?: FormulaDataModel): number[] | ErrorValueObject;
116
+ export declare function getMedianResult(array: number[]): BaseValueObject;
117
+ export declare function getLargeResult(array: number[], k: number): BaseValueObject;
118
+ export declare function getSmallResult(array: number[], k: number): BaseValueObject;
119
+ export declare function getPercentileIncResult(array: number[], k: number): BaseValueObject;
120
+ export declare function getPercentileExcResult(array: number[], k: number): BaseValueObject;
121
+ export declare function getQuartileIncResult(array: number[], quart: number): BaseValueObject;
122
+ export declare function getQuartileExcResult(array: number[], quart: number): BaseValueObject;
@@ -0,0 +1,9 @@
1
+ import { IMutation } from '@univerjs/core';
2
+ import { IRuntimeImageFormulaDataType } from '../../basics/common';
3
+ export interface ISetImageFormulaDataMutationParams {
4
+ imageFormulaData: IRuntimeImageFormulaDataType[];
5
+ }
6
+ /**
7
+ * There is no need to process data here, it is used as the main thread to send data to the worker. The main thread has already updated the data in advance, and there is no need to update it again here.
8
+ */
9
+ export declare const SetImageFormulaDataMutation: IMutation<ISetImageFormulaDataMutationParams>;
@@ -12,6 +12,7 @@ interface IInjectDefinedNameParam {
12
12
  unitId: Nullable<string>;
13
13
  getValueByName(unitId: string, name: string): Nullable<IDefinedNamesServiceParam>;
14
14
  getDirtyDefinedNameMap(): IDirtyUnitSheetDefinedNameMap;
15
+ getSheetName: (unitId: string, sheetId: string) => string;
15
16
  }
16
17
  export declare class LexerTreeBuilder extends Disposable {
17
18
  private _currentLexerNode;
@@ -55,6 +56,10 @@ export declare class LexerTreeBuilder extends Disposable {
55
56
  * =sum({}{})
56
57
  */
57
58
  private _formulaSpellCheck;
59
+ /**
60
+ * ={0,1,2,3,4,5,6} + {0;1;2;3;4;5;6}*7
61
+ */
62
+ private _passArrayOperator;
58
63
  getSequenceNode(sequenceArray: ISequenceArray[]): (string | ISequenceNode)[];
59
64
  private _processPushSequenceNode;
60
65
  private _getCurrentParamIndex;
@@ -72,6 +77,7 @@ export declare class LexerTreeBuilder extends Disposable {
72
77
  nodeMakerTest(formulaString: string): ErrorType.VALUE | (string | LexerNode)[] | undefined;
73
78
  treeBuilder(formulaString: string, transformSuffix?: boolean, injectDefinedNameParam?: IInjectDefinedNameParam): ErrorType.VALUE | LexerNode | (string | LexerNode)[] | undefined;
74
79
  private _handleDefinedName;
80
+ private _getHasSheetNameDefinedName;
75
81
  private _handleNestedDefinedName;
76
82
  private _simpleCheckDefinedName;
77
83
  private _checkDefinedNameDirty;
@@ -172,6 +172,11 @@ export declare class ArrayValueObject extends BaseValueObject {
172
172
  atan2(valueObject: BaseValueObject): BaseValueObject;
173
173
  atan2Inverse(valueObject: BaseValueObject): BaseValueObject;
174
174
  mean(ddof?: number): BaseValueObject;
175
+ /**
176
+ * TODO: @DR-Univer
177
+ * This calculation method contains an error, please note.
178
+ * Please refer `getMedianResult` function in /engine-formula/src/basics/statistical.ts
179
+ */
175
180
  median(): BaseValueObject;
176
181
  /**
177
182
  * ┌──────────────┬────────────────────────────────┬───────────────────┐
@@ -44,6 +44,7 @@ export declare class BaseValueObject extends ObjectClassType {
44
44
  isError(): boolean;
45
45
  isNull(): boolean;
46
46
  isHyperlink(): boolean;
47
+ isImage(): boolean;
47
48
  sum(): BaseValueObject;
48
49
  max(): BaseValueObject;
49
50
  min(): BaseValueObject;
@@ -149,15 +149,35 @@ export declare class NumberValueObject extends BaseValueObject {
149
149
  convertToBooleanObjectValue(): BooleanValueObject;
150
150
  private _compareInfinity;
151
151
  }
152
- interface IStringValueObjectOptions {
152
+ export interface IImageFormulaInfo {
153
+ source: string;
154
+ altText: string;
155
+ sizing: number;
156
+ height: number;
157
+ width: number;
158
+ isErrorImage?: boolean;
159
+ imageNaturalHeight?: number;
160
+ imageNaturalWidth?: number;
161
+ }
162
+ export interface IStringValueObjectOptions {
163
+ /**
164
+ * Whether it is a hyperlink value from HYPERLINK function
165
+ */
153
166
  isHyperlink?: boolean;
154
167
  hyperlinkUrl?: string;
168
+ /**
169
+ * Whether it is an image value from IMAGE function
170
+ */
171
+ isImage?: boolean;
172
+ imageInfo?: IImageFormulaInfo;
155
173
  }
156
174
  export declare const StringValueObjectCache: FormulaAstLRU<StringValueObject>;
157
175
  export declare class StringValueObject extends BaseValueObject {
158
176
  private _value;
159
177
  private _isHyperlink;
160
178
  private _hyperlinkUrl;
179
+ private _isImage;
180
+ private _imageInfo;
161
181
  static create(value: string, options?: IStringValueObjectOptions): StringValueObject;
162
182
  static checkCacheByOptions(cached: StringValueObject, options: IStringValueObjectOptions): boolean;
163
183
  constructor(rawValue: string);
@@ -165,6 +185,8 @@ export declare class StringValueObject extends BaseValueObject {
165
185
  isString(): boolean;
166
186
  isHyperlink(): boolean;
167
187
  getHyperlinkUrl(): string;
188
+ isImage(): boolean;
189
+ getImageInfo(): IStringValueObjectOptions['imageInfo'];
168
190
  concatenateFront(valueObject: BaseValueObject): BaseValueObject;
169
191
  concatenateBack(valueObject: BaseValueObject): BaseValueObject;
170
192
  plus(valueObject: BaseValueObject): BaseValueObject;
@@ -183,4 +205,3 @@ export declare class StringValueObject extends BaseValueObject {
183
205
  export declare function createBooleanValueObjectByRawValue(rawValue: string | number | boolean): BooleanValueObject;
184
206
  export declare function createStringValueObjectByRawValue(rawValue: string | number | boolean): StringValueObject;
185
207
  export declare function createNumberValueObjectByRawValue(rawValue: string | number | boolean, pattern?: string): ErrorValueObject | NumberValueObject;
186
- 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 ImageFunction extends BaseFunction {
4
+ minParams: number;
5
+ maxParams: number;
6
+ calculate(source: BaseValueObject, altText?: BaseValueObject, sizing?: BaseValueObject, height?: BaseValueObject, width?: BaseValueObject): BaseValueObject;
7
+ private _handleSingleObject;
8
+ }
@@ -0,0 +1,14 @@
1
+ import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
2
+ import { BaseValueObject } from '../../../engine/value-object/base-value-object';
3
+ import { BaseFunction } from '../../base-function';
4
+ export declare class Aggregate extends BaseFunction {
5
+ minParams: number;
6
+ maxParams: number;
7
+ needsReferenceObject: boolean;
8
+ needsFilteredOutRows: boolean;
9
+ needsFormulaDataModel: boolean;
10
+ calculate(functionNum: FunctionVariantType, options: FunctionVariantType, ...refs: FunctionVariantType[]): BaseValueObject;
11
+ private _handleSingleObject;
12
+ private _getAggregateOptions;
13
+ private _handleLargeSmallPercentileQuartile;
14
+ }
@@ -1,5 +1,6 @@
1
1
  import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
2
2
  import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
3
+ import { BaseValueObject } from '../../../engine/value-object/base-value-object';
3
4
  import { BaseFunction } from '../../base-function';
4
5
  export declare class Subtotal extends BaseFunction {
5
6
  minParams: number;
@@ -7,21 +8,8 @@ export declare class Subtotal extends BaseFunction {
7
8
  needsReferenceObject: boolean;
8
9
  needsFilteredOutRows: boolean;
9
10
  needsFormulaDataModel: boolean;
10
- calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]): ArrayValueObject | FunctionVariantType;
11
+ calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]): BaseValueObject | ArrayValueObject;
11
12
  private _handleSingleObject;
12
- private _getIndexNumValue;
13
- private _average;
14
- private _count;
15
- private _counta;
16
- private _max;
17
- private _min;
18
- private _product;
19
- private _stdev;
20
- private _stdevp;
21
- private _sum;
22
- private _var;
23
- private _varp;
24
- private _flattenRefArray;
25
- private _isRowHidden;
26
- private _isBlankArrayObject;
13
+ private _handleMultiAreaRefs;
14
+ private _getMultiAreaInfo;
27
15
  }
@@ -5,5 +5,4 @@ export declare class Large extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, k: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -4,5 +4,4 @@ export declare class Median extends BaseFunction {
4
4
  minParams: number;
5
5
  maxParams: number;
6
6
  calculate(...variants: BaseValueObject[]): BaseValueObject;
7
- private _getResult;
8
7
  }
@@ -4,5 +4,4 @@ export declare class ModeSngl extends BaseFunction {
4
4
  minParams: number;
5
5
  maxParams: number;
6
6
  calculate(...variants: BaseValueObject[]): BaseValueObject;
7
- private _getResult;
8
7
  }
@@ -5,5 +5,4 @@ export declare class PercentileExc extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, k: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -5,5 +5,4 @@ export declare class PercentileInc extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, k: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -5,5 +5,4 @@ export declare class QuartileExc extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, quart: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -5,5 +5,4 @@ export declare class QuartileInc extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, quart: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -5,5 +5,4 @@ export declare class Small extends BaseFunction {
5
5
  maxParams: number;
6
6
  calculate(array: BaseValueObject, k: BaseValueObject): BaseValueObject;
7
7
  private _handleSingleObject;
8
- private _getValues;
9
8
  }
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export type { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, } from './basics/common';
16
+ export type { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeImageFormulaDataType, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitImageFormulaDataType, IUnitSheetNameMap, } from './basics/common';
17
17
  export { BooleanValue } from './basics/common';
18
18
  export { type IOtherFormulaData } from './basics/common';
19
19
  export { type IUnitRowData } from './basics/common';
@@ -35,6 +35,7 @@ export { SetDefinedNameMutationFactory } from './commands/mutations/set-defined-
35
35
  export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation } from './commands/mutations/set-feature-calculation.mutation';
36
36
  export { type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, } from './commands/mutations/set-formula-calculation.mutation';
37
37
  export { type ISetFormulaDataMutationParams, SetFormulaDataMutation } from './commands/mutations/set-formula-data.mutation';
38
+ export { type ISetImageFormulaDataMutationParams, SetImageFormulaDataMutation } from './commands/mutations/set-image-formula-data.mutation';
38
39
  export { type IRemoveOtherFormulaMutationParams, type ISetOtherFormulaMutationParams, RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/mutations/set-other-formula.mutation';
39
40
  export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation } from './commands/mutations/set-super-table.mutation';
40
41
  export type { ISetSuperTableMutationParam, ISetSuperTableMutationSearchParam } from './commands/mutations/set-super-table.mutation';
@@ -77,7 +78,7 @@ export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from
77
78
  export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
78
79
  export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
79
80
  export { LambdaValueObjectObject } from './engine/value-object/lambda-value-object';
80
- export type { FormulaFunctionResultValueType, FormulaFunctionValueType, PrimitiveValueType } from './engine/value-object/primitive-object';
81
+ export type { FormulaFunctionResultValueType, FormulaFunctionValueType, IImageFormulaInfo, PrimitiveValueType } from './engine/value-object/primitive-object';
81
82
  export { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './engine/value-object/primitive-object';
82
83
  export { functionArray } from './functions/array/function-map';
83
84
  export { FUNCTION_NAMES_ARRAY } from './functions/array/function-names';
@@ -1,5 +1,5 @@
1
1
  import { ICellData, IObjectMatrixPrimitiveType, IRange, IUnitRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
2
- import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
2
+ import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitImageFormulaDataType, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
3
3
  import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
4
4
  export interface IRangeChange {
5
5
  oldCell: IRange;
@@ -10,6 +10,7 @@ export declare class FormulaDataModel extends Disposable {
10
10
  private readonly _lexerTreeBuilder;
11
11
  private _arrayFormulaRange;
12
12
  private _arrayFormulaCellData;
13
+ private _unitImageFormulaData;
13
14
  constructor(_univerInstanceService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder);
14
15
  dispose(): void;
15
16
  clearPreviousArrayFormulaCellData(clearArrayFormulaCellData: IRuntimeUnitDataType): void;
@@ -20,7 +21,10 @@ export declare class FormulaDataModel extends Disposable {
20
21
  setArrayFormulaRange(value: IArrayFormulaRangeType): void;
21
22
  getArrayFormulaCellData(): IArrayFormulaUnitCellType;
22
23
  setArrayFormulaCellData(value: IArrayFormulaUnitCellType): void;
24
+ getUnitImageFormulaData(): IUnitImageFormulaDataType;
25
+ setUnitImageFormulaData(value: IUnitImageFormulaDataType): void;
23
26
  mergeArrayFormulaRange(formulaData: IArrayFormulaRangeType): void;
27
+ mergeUnitImageFormulaData(formulaData: IUnitImageFormulaDataType): void;
24
28
  deleteArrayFormulaRange(unitId: string, sheetId: string, row: number, column: number): void;
25
29
  getCalculateData(): {
26
30
  allUnitData: IUnitData;
@@ -36,6 +40,7 @@ export declare class FormulaDataModel extends Disposable {
36
40
  updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): IObjectMatrixPrimitiveType<IFormulaDataItem | null>;
37
41
  updateArrayFormulaRange(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
38
42
  updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
43
+ updateImageFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
39
44
  getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): Nullable<string>;
40
45
  /**
41
46
  * Function to get all formula ranges
@@ -1,5 +1,5 @@
1
1
  import { IUnitRange, LocaleType, Nullable, Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
2
- import { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
2
+ import { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetIdToNameMap, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
3
3
  import { FormulaDataModel } from '../models/formula-data.model';
4
4
  import { ISheetRowFilteredService } from './sheet-row-filtered.service';
5
5
  export interface IFormulaDirtyData {
@@ -54,6 +54,7 @@ export interface IFormulaCurrentConfigService {
54
54
  columnCount: number;
55
55
  };
56
56
  getFilteredOutRows(unitId: string, sheetId: string, startRow: number, endRow: number): number[];
57
+ setSheetNameMap(sheetIdToNameMap: IUnitSheetIdToNameMap): void;
57
58
  }
58
59
  export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
59
60
  private readonly _univerInstanceService;
@@ -97,6 +98,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
97
98
  getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap;
98
99
  getDirtyUnitOtherFormulaMap(): IDirtyUnitOtherFormulaMap;
99
100
  getSheetName(unitId: string, sheetId: string): string;
101
+ setSheetNameMap(sheetIdToNameMap: IUnitSheetIdToNameMap): void;
100
102
  getClearDependencyTreeCache(): IDirtyUnitSheetNameMap;
101
103
  getLocale(): LocaleType;
102
104
  getSheetsInfo(): {
@@ -1,5 +1,5 @@
1
1
  import { Nullable, Disposable } from '@univerjs/core';
2
- import { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
2
+ import { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeImageFormulaDataType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
3
3
  import { BaseAstNode } from '../engine/ast-node/base-ast-node';
4
4
  import { FunctionVariantType } from '../engine/reference-object/base-reference-object';
5
5
  import { IFormulaCurrentConfigService } from './current-data.service';
@@ -33,6 +33,7 @@ export interface IAllRuntimeData {
33
33
  functionsExecutedState: FormulaExecutedStateType;
34
34
  arrayFormulaCellData: IRuntimeUnitDataType;
35
35
  clearArrayFormulaCellData: IRuntimeUnitDataType;
36
+ imageFormulaData: IRuntimeImageFormulaDataType[];
36
37
  runtimeFeatureRange: {
37
38
  [featureId: string]: IFeatureDirtyRangeType;
38
39
  };
@@ -98,6 +99,7 @@ export interface IFormulaRuntimeService {
98
99
  getUnitArrayFormulaEmbeddedMap(): IArrayFormulaEmbeddedMap;
99
100
  setUnitArrayFormulaEmbeddedMap(): void;
100
101
  clearArrayObjectCache(): void;
102
+ getRuntimeImageFormulaData(): IRuntimeImageFormulaDataType[];
101
103
  }
102
104
  export declare class FormulaRuntimeService extends Disposable implements IFormulaRuntimeService {
103
105
  private readonly _currentConfigService;
@@ -118,6 +120,7 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
118
120
  private _runtimeClearArrayFormulaCellData;
119
121
  private _runtimeFeatureRange;
120
122
  private _runtimeFeatureCellData;
123
+ private _runtimeImageFormulaData;
121
124
  private _functionsExecutedState;
122
125
  private _functionDefinitionPrivacyVar;
123
126
  private _totalFormulasToCalculate;
@@ -179,6 +182,7 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
179
182
  [featureId: string]: IRuntimeUnitDataType;
180
183
  };
181
184
  setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
185
+ getRuntimeImageFormulaData(): IRuntimeImageFormulaDataType[];
182
186
  getAllRuntimeData(): IAllRuntimeData;
183
187
  getRuntimeState(): IExecutionInProgressParams;
184
188
  clearArrayObjectCache(): void;