@univerjs/sheets-formula 0.1.6 → 0.1.8

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 (33) hide show
  1. package/README.md +25 -18
  2. package/lib/cjs/index.js +8 -8
  3. package/lib/es/index.js +2867 -2890
  4. package/lib/types/commands/mutations/formula.mutation.d.ts +10 -0
  5. package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +1 -1
  6. package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +1 -1
  7. package/lib/types/controllers/active-dirty.controller.d.ts +6 -2
  8. package/lib/types/controllers/formula-clipboard.controller.d.ts +5 -4
  9. package/lib/types/controllers/prompt.controller.d.ts +7 -2
  10. package/lib/types/controllers/trigger-calculation.controller.d.ts +9 -1
  11. package/lib/types/controllers/update-formula.controller.d.ts +3 -5
  12. package/lib/types/controllers/utils/offset-formula-data.d.ts +8 -31
  13. package/lib/types/controllers/utils/ref-range-formula.d.ts +33 -5
  14. package/lib/types/formula-ui-plugin.d.ts +5 -5
  15. package/lib/types/index.d.ts +2 -0
  16. package/lib/types/locale/en-US.d.ts +17 -17
  17. package/lib/types/locale/function-list/information/en-US.d.ts +2 -10
  18. package/lib/types/locale/function-list/information/ja-JP.d.ts +2 -10
  19. package/lib/types/locale/function-list/information/zh-CN.d.ts +2 -10
  20. package/lib/types/locale/function-list/statistical/en-US.d.ts +14 -2
  21. package/lib/types/locale/function-list/statistical/ja-JP.d.ts +14 -2
  22. package/lib/types/locale/function-list/statistical/zh-CN.d.ts +14 -2
  23. package/lib/types/locale/function-list/text/en-US.d.ts +1 -5
  24. package/lib/types/locale/function-list/text/ja-JP.d.ts +1 -5
  25. package/lib/types/locale/function-list/text/zh-CN.d.ts +1 -5
  26. package/lib/types/locale/zh-CN.d.ts +17 -17
  27. package/lib/types/services/formula-common.d.ts +19 -0
  28. package/lib/types/services/register-other-formula.service.d.ts +27 -0
  29. package/lib/umd/index.js +8 -8
  30. package/package.json +27 -28
  31. package/lib/types/controllers/numfmt-formula-display.controller.d.ts +0 -14
  32. package/lib/types/controllers/utils/redo-undo-formula-data.d.ts +0 -5
  33. /package/lib/types/controllers/utils/__tests__/{redo-undo-formula-data.spec.d.ts → ref-range-formula.spec.d.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ import { ICellData, Nullable } from '@univerjs/core';
2
+
3
+ export declare enum FormulaResultStatus {
4
+ NOT_REGISTER = 1,
5
+ SUCCESS = 2,
6
+ WAIT = 3,
7
+ ERROR = 4
8
+ }
9
+ export interface IOtherFormulaResult {
10
+ result?: Nullable<ICellData>[][];
11
+ status: FormulaResultStatus;
12
+ formulaId: string;
13
+ callbacks: Set<(value: Nullable<ICellData>[][]) => void>;
14
+ extra?: Record<string, any>;
15
+ }
16
+ export interface IFormulaInfo {
17
+ id: string;
18
+ text: string;
19
+ }
@@ -0,0 +1,27 @@
1
+ import { IOtherFormulaResult } from './formula-common';
2
+ import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
+ import { Nullable, Disposable, ICommandService } from '@univerjs/core';
4
+
5
+ export declare class RegisterOtherFormulaService extends Disposable {
6
+ private readonly _commandService;
7
+ private _activeDirtyManagerService;
8
+ private _formulaCacheMap;
9
+ private _formulaChange$;
10
+ formulaChange$: import('rxjs').Observable<{
11
+ unitId: string;
12
+ subUnitId: string;
13
+ formulaText: string;
14
+ formulaId: string;
15
+ }>;
16
+ private _formulaResult$;
17
+ formulaResult$: import('rxjs').Observable<Record<string, Record<string, IOtherFormulaResult[]>>>;
18
+ constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
19
+ private _ensureCacheMap;
20
+ private _createFormulaId;
21
+ private _initFormulaRegister;
22
+ private _initFormulaCalculationResultChange;
23
+ registerFormula(unitId: string, subUnitId: string, formulaText: string, extra?: Record<string, any>): string;
24
+ deleteFormula(unitId: string, subUnitId: string, formulaIdList: string[]): void;
25
+ getFormulaValue(unitId: string, subUnitId: string, formulaId: string): Promise<Nullable<IOtherFormulaResult>>;
26
+ getFormulaValueSync(unitId: string, subUnitId: string, formulaId: string): Nullable<IOtherFormulaResult>;
27
+ }