@univerjs-pro/engine-formula-rust 1.0.0-insiders.20260725-1b9c8d8

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 (39) hide show
  1. package/README.md +56 -0
  2. package/lib/index.js +2114 -0
  3. package/lib/types/adapters/rust-projection-remote-instance.service.d.ts +28 -0
  4. package/lib/types/binding.d.ts +105 -0
  5. package/lib/types/controllers/rust-engine-sync.controller.d.ts +40 -0
  6. package/lib/types/controllers/rust-same-runtime-projection.controller.d.ts +27 -0
  7. package/lib/types/index.d.ts +10 -0
  8. package/lib/types/numfmt.d.ts +145 -0
  9. package/lib/types/plugin.d.ts +35 -0
  10. package/lib/types/regression/formula-array-followers.d.ts +14 -0
  11. package/lib/types/regression/formula-value-normalization.d.ts +2 -0
  12. package/lib/types/regression/formula-volatile-dependencies.d.ts +7 -0
  13. package/lib/types/regression/real-univer-stage-timeouts.d.ts +7 -0
  14. package/lib/types/regression/rust-only-artifact-cache.d.ts +41 -0
  15. package/lib/types/regression/rust-only-discovery.d.ts +17 -0
  16. package/lib/types/regression/rust-only-excel-com-oracle.d.ts +57 -0
  17. package/lib/types/regression/rust-only-excel-process-cleanup.d.ts +3 -0
  18. package/lib/types/regression/rust-only-exchange-binary.d.ts +15 -0
  19. package/lib/types/regression/rust-only-failure-report.d.ts +13 -0
  20. package/lib/types/regression/rust-only-feature-extraction.d.ts +19 -0
  21. package/lib/types/regression/rust-only-formula-comparison.d.ts +43 -0
  22. package/lib/types/regression/rust-only-ooxml-diff.d.ts +23 -0
  23. package/lib/types/regression/rust-only-ooxml-feature-extraction.d.ts +7 -0
  24. package/lib/types/regression/rust-only-partial-artifacts.d.ts +7 -0
  25. package/lib/types/regression/rust-only-pipeline.d.ts +55 -0
  26. package/lib/types/regression/rust-only-process.d.ts +9 -0
  27. package/lib/types/regression/rust-only-real-runner.d.ts +103 -0
  28. package/lib/types/regression/rust-only-report.d.ts +131 -0
  29. package/lib/types/regression/rust-only-sequential-runner.d.ts +24 -0
  30. package/lib/types/regression/rust-only-timeout.d.ts +63 -0
  31. package/lib/types/regression/rust-only-view-host.d.ts +171 -0
  32. package/lib/types/regression/rust-only-workbook-json-formula-values.d.ts +2 -0
  33. package/lib/types/regression/rust-only-xlsx-formula-values.d.ts +8 -0
  34. package/lib/types/regression/xlsx-sample-compatibility.d.ts +56 -0
  35. package/lib/types/services/calculate-formula.service.d.ts +106 -0
  36. package/lib/types/services/rust-formula-projection.service.d.ts +70 -0
  37. package/lib/types/services/workbook-snapshot-materializer.d.ts +20 -0
  38. package/lib/types/types.d.ts +398 -0
  39. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @univerjs-pro/engine-formula-rust
2
+
3
+ TypeScript plugin wrapper for the Rust-backed Univer formula engine.
4
+
5
+ ## Overview
6
+
7
+ This package replaces the calculation layer (`ICalculateFormulaService`) of `@univerjs/engine-formula`
8
+ with a Rust implementation via NAPI-RS on Node.js. All other services
9
+ (FormulaDataModel, IFunctionService, controllers, etc.) remain in TypeScript.
10
+
11
+ ## Usage
12
+
13
+ In a Node.js Worker process (e.g. `apps/univer-collaboration-server/src/contrib/apply/worker.ts`):
14
+
15
+ ```typescript
16
+ import { UniverRustFormulaEnginePlugin } from '@univerjs-pro/engine-formula-rust';
17
+
18
+ // Replace the default engine formula plugin
19
+ univer.registerPlugin(UniverRustFormulaEnginePlugin);
20
+ ```
21
+
22
+ ## Architecture
23
+
24
+ ```
25
+ TS side (Worker thread)
26
+ ├─ UniverRustFormulaEnginePlugin
27
+ ├─ RustCalculateFormulaService
28
+ │ ├─ collects data from IFormulaCurrentConfigService
29
+ │ ├─ JSON serialize → Rust NAPI
30
+ │ └─ deserialize result → IFormulaRuntimeService
31
+ └─ All other services remain untouched
32
+
33
+ Rust side (NAPI / WASM)
34
+ ├─ FormulaEngine::execute(input)
35
+ ├─ Lexer → Parser → AST
36
+ ├─ Dependency Graph → Topological Sort
37
+ └─ Interpreter → ValueObjects
38
+ ```
39
+
40
+ ## Build
41
+
42
+ ```bash
43
+ # Build the Rust native addon
44
+ pnpm run build:native
45
+
46
+ # Build the TypeScript package
47
+ pnpm run build
48
+ ```
49
+
50
+ ## Fallback
51
+
52
+ Set `useRustEngine: false` in the plugin config to fall back to the pure TypeScript engine:
53
+
54
+ ```typescript
55
+ univer.registerPlugin(UniverRustFormulaEnginePlugin, { useRustEngine: false });
56
+ ```