@univerjs-pro/engine-formula-rust 1.0.0-insiders.20260809-70eefdd → 1.0.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/index.cjs +297 -101
- package/lib/es/index.js +302 -101
- package/lib/types/index.d.ts +23 -4
- package/package.json +36 -47
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
|
-
import { FormulaDataModel, IAllRuntimeData, ICalculateFormulaService, IExecutionInProgressParams, IFeatureCalculationManagerService, IFeatureDirtyRangeType, IFormulaCurrentConfigService, IFormulaDatasetConfig, IFormulaDependencyGenerator, IFormulaDependencyTreeJson, IFormulaExecuteResultMap, IFormulaRuntimeService, IFormulaStringMap, IOtherFormulaManagerService, IRuntimeUnitDataType, ISetArrayFormulaDataMutationParams, ISetFormulaCalculationResultMutation, ISuperTableService, IUnitRowData, IUniverEngineFormulaConfig } from "@univerjs/engine-formula";
|
|
3
|
-
import { Dependency, Disposable, ICommandService, IConfigService, IUnitRange as IUnitRange$1, IWorkbookData, Injector, Nullable } from "@univerjs/core";
|
|
2
|
+
import { FormulaDataModel, IAllRuntimeData, ICalculateFormulaService, IDefinedNamesService, IExecutionInProgressParams, IFeatureCalculationManagerService, IFeatureDirtyRangeType, IFormulaCurrentConfigService, IFormulaDatasetConfig, IFormulaDependencyGenerator, IFormulaDependencyTreeJson, IFormulaExecuteResultMap, IFormulaRuntimeService, IFormulaStringMap, IOtherFormulaManagerService, IRuntimeUnitDataType, ISetArrayFormulaDataMutationParams, ISetFormulaCalculationResultMutation, ISuperTableService, IUnitRowData, IUniverEngineFormulaConfig } from "@univerjs/engine-formula";
|
|
3
|
+
import { BooleanNumber, Dependency, Disposable, FormulaType, ICellData, ICommandService, IConfigService, IUnitRange as IUnitRange$1, IWorkbookData, Injector, Nullable } from "@univerjs/core";
|
|
4
4
|
import { ExternalReferenceModel, IFormulaReferenceDataService, UniverProFormulaEnginePlugin } from "@univerjs-pro/engine-formula";
|
|
5
5
|
import { Subject } from "rxjs";
|
|
6
6
|
import { ISheetBlock, ISnapshot } from "@univerjs/protocol";
|
|
@@ -100,8 +100,10 @@ interface IFormulaExecutionInput {
|
|
|
100
100
|
unitData: Record<string, Record<string, ISheetData>>;
|
|
101
101
|
dirtyRanges: IUnitRange[];
|
|
102
102
|
definedNames: Record<string, IDefinedName>;
|
|
103
|
+
queryFormulas?: Record<string, Record<string, Record<number, Record<number, string[]>>>>;
|
|
103
104
|
}
|
|
104
105
|
interface ISheetData {
|
|
106
|
+
name?: string;
|
|
105
107
|
cellData: Record<number, Record<number, ICellValue>>;
|
|
106
108
|
rowCount: number;
|
|
107
109
|
columnCount: number;
|
|
@@ -111,11 +113,14 @@ interface ICellValue {
|
|
|
111
113
|
t?: number;
|
|
112
114
|
p?: unknown;
|
|
113
115
|
f?: string;
|
|
116
|
+
ft?: FormulaType;
|
|
117
|
+
fd?: BooleanNumber;
|
|
114
118
|
si?: string;
|
|
115
119
|
ref?: string;
|
|
116
120
|
dynamicArrayRef?: string;
|
|
117
121
|
xf?: string;
|
|
118
122
|
s?: unknown;
|
|
123
|
+
numberFormat?: string;
|
|
119
124
|
displayPrecision?: number;
|
|
120
125
|
}
|
|
121
126
|
interface IUnitRange {
|
|
@@ -130,11 +135,17 @@ interface IRange {
|
|
|
130
135
|
endColumn: number;
|
|
131
136
|
}
|
|
132
137
|
interface IDefinedName {
|
|
138
|
+
unitId?: string;
|
|
139
|
+
localSheetId?: string;
|
|
133
140
|
name: string;
|
|
134
141
|
formula?: string;
|
|
135
142
|
range?: IRange;
|
|
136
143
|
}
|
|
137
144
|
interface IFormulaExecutionOutput {
|
|
145
|
+
queryResults?: Record<string, Record<string, Record<number, Record<number, Array<{
|
|
146
|
+
formula: string;
|
|
147
|
+
value: unknown;
|
|
148
|
+
}>>>>>;
|
|
138
149
|
runtimeData: Record<string, Record<string, Record<number, Record<number, unknown>>>>;
|
|
139
150
|
arrayFormulaRange: Record<string, Record<string, Record<number, Record<number, IRange>>>>;
|
|
140
151
|
cycleDependencies: ICycleDependencyInfo[];
|
|
@@ -159,6 +170,7 @@ interface IRustEngineSnapshot {
|
|
|
159
170
|
interface IRustWorkbookSnapshot {
|
|
160
171
|
unitId: string;
|
|
161
172
|
name?: string;
|
|
173
|
+
dateSystem?: 'date1900' | 'date1904';
|
|
162
174
|
sheets: IRustSheetSnapshot[];
|
|
163
175
|
calculation?: IRustWorkbookCalculationSnapshot;
|
|
164
176
|
resources?: Record<string, IRustResourceSnapshot>;
|
|
@@ -513,6 +525,9 @@ interface IRustProjectionWorkbookInput {
|
|
|
513
525
|
snapshot: IWorkbookData;
|
|
514
526
|
unitId?: string;
|
|
515
527
|
definedNames?: Record<string, IRustDefinedNameSnapshot>;
|
|
528
|
+
styleResolver?: {
|
|
529
|
+
getStyleByCell(cell: ICellData): unknown;
|
|
530
|
+
};
|
|
516
531
|
}
|
|
517
532
|
interface IFormulaCalculationError {
|
|
518
533
|
code: string;
|
|
@@ -587,12 +602,14 @@ declare class RustEngineSyncController extends Disposable {
|
|
|
587
602
|
private _nativeReady;
|
|
588
603
|
private _snapshotLoaded;
|
|
589
604
|
private _projectionLoadPromise;
|
|
605
|
+
private _projectionDeltaBarrier;
|
|
590
606
|
private readonly _pendingMutations;
|
|
591
607
|
private readonly _projectionManagedTableUnits;
|
|
592
608
|
constructor(_commandService: ICommandService);
|
|
593
609
|
private _initialize;
|
|
594
610
|
loadProjection(workbooks: readonly IRustProjectionWorkbookInput[]): Promise<void>;
|
|
595
611
|
waitForProjectionLoad(): Promise<void>;
|
|
612
|
+
setProjectionDeltaBarrier(barrier: Promise<void>): void;
|
|
596
613
|
private _loadProjection;
|
|
597
614
|
applyProjectionMutation(mutation: IRustEngineMutation): void;
|
|
598
615
|
upsertProjectionWorkbook(workbook: IRustProjectionWorkbookInput): void;
|
|
@@ -818,6 +835,7 @@ declare class RustCalculateFormulaService extends Disposable implements IRustCal
|
|
|
818
835
|
private readonly _formulaReferenceDataService;
|
|
819
836
|
private readonly _excelExternalReferenceModel;
|
|
820
837
|
private readonly _superTableService;
|
|
838
|
+
private readonly _definedNamesService;
|
|
821
839
|
protected readonly _executionInProgressListener$: Subject<IExecutionInProgressParams>;
|
|
822
840
|
readonly executionInProgressListener$: import("rxjs").Observable<IExecutionInProgressParams>;
|
|
823
841
|
protected readonly _executionCompleteListener$: Subject<IAllRuntimeData>;
|
|
@@ -832,7 +850,7 @@ declare class RustCalculateFormulaService extends Disposable implements IRustCal
|
|
|
832
850
|
private _externalRequestGeneration;
|
|
833
851
|
private readonly _externalInflight;
|
|
834
852
|
private readonly _externalCompleted;
|
|
835
|
-
constructor(_configService: IConfigService, _currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _formulaDependencyGenerator: IFormulaDependencyGenerator, _featureCalculationManagerService: IFeatureCalculationManagerService, _otherFormulaManagerService: IOtherFormulaManagerService, _commandService: ICommandService, _rustEngineSyncController: RustEngineSyncController, _formulaDataModel: FormulaDataModel, _formulaReferenceDataService: IFormulaReferenceDataService, _excelExternalReferenceModel: ExternalReferenceModel, _superTableService: ISuperTableService);
|
|
853
|
+
constructor(_configService: IConfigService, _currentConfigService: IFormulaCurrentConfigService, _runtimeService: IFormulaRuntimeService, _formulaDependencyGenerator: IFormulaDependencyGenerator, _featureCalculationManagerService: IFeatureCalculationManagerService, _otherFormulaManagerService: IOtherFormulaManagerService, _commandService: ICommandService, _rustEngineSyncController: RustEngineSyncController, _formulaDataModel: FormulaDataModel, _formulaReferenceDataService: IFormulaReferenceDataService, _excelExternalReferenceModel: ExternalReferenceModel, _superTableService: ISuperTableService, _definedNamesService: IDefinedNamesService);
|
|
836
854
|
dispose(): void;
|
|
837
855
|
stopFormulaExecution(): void;
|
|
838
856
|
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
|
|
@@ -860,6 +878,7 @@ declare class RustCalculateFormulaService extends Disposable implements IRustCal
|
|
|
860
878
|
private _serializeCellData;
|
|
861
879
|
private _applyRustOutput;
|
|
862
880
|
private _applyRustDependencyOutput;
|
|
881
|
+
private _mergeRuntimeUnitData;
|
|
863
882
|
calculate(formulaString: string): Promise<{} | null>;
|
|
864
883
|
executeFormulas(formulas: IFormulaStringMap, rowData?: IUnitRowData): Promise<IFormulaExecuteResultMap>;
|
|
865
884
|
getAllDependencyJson(_rowData?: IUnitRowData): Promise<IFormulaDependencyTreeJson[]>;
|
|
@@ -886,7 +905,7 @@ declare class RustCalculateFormulaService extends Disposable implements IRustCal
|
|
|
886
905
|
dependents: IFormulaDependencyTreeJson[];
|
|
887
906
|
inRanges: IFormulaDependencyTreeJson[];
|
|
888
907
|
}>;
|
|
889
|
-
private
|
|
908
|
+
private _formulaStringMapToQueryData;
|
|
890
909
|
private _formulaExecutionOutputToResultMap;
|
|
891
910
|
private _getRustDependencyGraph;
|
|
892
911
|
private _getRustInspectGraph;
|
package/package.json
CHANGED
|
@@ -1,49 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"publishConfig": {
|
|
36
|
-
"main": "./lib/cjs/index.cjs",
|
|
37
|
-
"module": "./lib/es/index.js",
|
|
38
|
-
"types": "./lib/types/index.d.ts",
|
|
39
|
-
"exports": {
|
|
40
|
-
".": {
|
|
41
|
-
"types": "./lib/types/index.d.ts",
|
|
42
|
-
"import": "./lib/es/index.js",
|
|
43
|
-
"require": "./lib/cjs/index.cjs",
|
|
44
|
-
"default": "./lib/es/index.js"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"access": "public"
|
|
2
|
+
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@univerjs-pro/engine-formula": "1.0.0",
|
|
5
|
+
"@univerjs-pro/engine-formula-rust-binding": "1.0.0",
|
|
6
|
+
"@univerjs/core": "1.0.0",
|
|
7
|
+
"@univerjs/engine-formula": "1.0.0",
|
|
8
|
+
"@univerjs/protocol": "1.0.0"
|
|
9
|
+
},
|
|
10
|
+
"description": "Rust-backed formula engine plugin for Univer",
|
|
11
|
+
"files": [
|
|
12
|
+
"lib"
|
|
13
|
+
],
|
|
14
|
+
"name": "@univerjs-pro/engine-formula-rust",
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"rxjs": ">=7.0.0"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/dream-num/univer-rs"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"version": "1.0.0",
|
|
24
|
+
"main": "./lib/cjs/index.cjs",
|
|
25
|
+
"module": "./lib/es/index.js",
|
|
26
|
+
"types": "./lib/types/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./lib/types/index.d.ts",
|
|
30
|
+
"import": "./lib/es/index.js",
|
|
31
|
+
"require": "./lib/cjs/index.cjs",
|
|
32
|
+
"default": "./lib/es/index.js"
|
|
48
33
|
}
|
|
49
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
}
|
|
38
|
+
}
|