@univerjs/sheets 0.1.0-alpha.2 → 0.1.0-beta.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.
Files changed (61) hide show
  1. package/lib/cjs/index.js +1 -3
  2. package/lib/es/index.js +3403 -4183
  3. package/lib/types/basics/interfaces/mutation-interface.d.ts +29 -29
  4. package/lib/types/basics/interfaces/selection-config.d.ts +1 -1
  5. package/lib/types/commands/commands/add-worksheet-merge.command.d.ts +2 -2
  6. package/lib/types/commands/commands/clear-selection-format.command.d.ts +2 -2
  7. package/lib/types/commands/commands/copy-to-worksheet.command.d.ts +3 -3
  8. package/lib/types/commands/commands/copy-worksheet.command.d.ts +2 -2
  9. package/lib/types/commands/commands/delete-range-move-left.command.d.ts +1 -1
  10. package/lib/types/commands/commands/delete-range-move-up.command.d.ts +1 -1
  11. package/lib/types/commands/commands/insert-range-move-down.command.d.ts +1 -1
  12. package/lib/types/commands/commands/insert-range-move-right.command.d.ts +1 -1
  13. package/lib/types/commands/commands/insert-row-col.command.d.ts +7 -5
  14. package/lib/types/commands/commands/insert-sheet.command.d.ts +2 -2
  15. package/lib/types/commands/commands/remove-row-col.command.d.ts +1 -1
  16. package/lib/types/commands/commands/remove-sheet.command.d.ts +2 -2
  17. package/lib/types/commands/commands/set-col-visible.command.d.ts +2 -2
  18. package/lib/types/commands/commands/set-hide-gridlines.command.d.ts +2 -2
  19. package/lib/types/commands/commands/set-range-values.command.d.ts +5 -5
  20. package/lib/types/commands/commands/set-row-visible.command.d.ts +2 -2
  21. package/lib/types/commands/commands/set-style.command.d.ts +2 -2
  22. package/lib/types/commands/commands/set-worksheet-activate.command.d.ts +2 -2
  23. package/lib/types/commands/commands/set-worksheet-hide.command.d.ts +1 -1
  24. package/lib/types/commands/commands/set-worksheet-name.command.d.ts +2 -2
  25. package/lib/types/commands/commands/set-worksheet-order.command.d.ts +2 -2
  26. package/lib/types/commands/commands/set-worksheet-right-to-left.command.d.ts +2 -2
  27. package/lib/types/commands/commands/set-worksheet-row-height.command.d.ts +2 -1
  28. package/lib/types/commands/commands/utils/selection-utils.d.ts +42 -0
  29. package/lib/types/commands/mutations/delete-range.mutation.d.ts +1 -1
  30. package/lib/types/commands/mutations/insert-range.mutation.d.ts +2 -2
  31. package/lib/types/commands/mutations/move-range.mutation.d.ts +5 -5
  32. package/lib/types/commands/mutations/move-rows-cols.mutation.d.ts +4 -4
  33. package/lib/types/commands/mutations/numfmt-mutation.d.ts +5 -5
  34. package/lib/types/commands/mutations/set-col-visible.mutation.d.ts +8 -8
  35. package/lib/types/commands/mutations/set-frozen.mutation.d.ts +2 -2
  36. package/lib/types/commands/mutations/set-hide-gridlines.mutatiom.d.ts +2 -2
  37. package/lib/types/commands/mutations/set-range-values.mutation.d.ts +4 -4
  38. package/lib/types/commands/mutations/set-row-visible.mutation.d.ts +8 -8
  39. package/lib/types/commands/mutations/set-tab-color.mutation.d.ts +2 -2
  40. package/lib/types/commands/mutations/set-worksheet-col-width.mutation.d.ts +4 -5
  41. package/lib/types/commands/mutations/set-worksheet-config.mutation.d.ts +2 -2
  42. package/lib/types/commands/mutations/set-worksheet-hide.mutation.d.ts +2 -2
  43. package/lib/types/commands/mutations/set-worksheet-name.mutation.d.ts +2 -2
  44. package/lib/types/commands/mutations/set-worksheet-order.mutation.d.ts +2 -2
  45. package/lib/types/commands/mutations/set-worksheet-right-to-left.mutation.d.ts +2 -2
  46. package/lib/types/commands/mutations/set-worksheet-row-height.mutation.d.ts +9 -10
  47. package/lib/types/commands/operations/selection.operation.d.ts +2 -2
  48. package/lib/types/commands/operations/set-worksheet-active.operation.d.ts +2 -2
  49. package/lib/types/commands/utils/interface.d.ts +2 -2
  50. package/lib/types/index.d.ts +5 -5
  51. package/lib/types/locale/en-US.d.ts +5 -1
  52. package/lib/types/locale/zh-CN.d.ts +5 -1
  53. package/lib/types/services/numfmt/numfmt.service.d.ts +5 -5
  54. package/lib/types/services/numfmt/type.d.ts +7 -7
  55. package/lib/types/services/permission/permission-point.d.ts +3 -3
  56. package/lib/types/services/permission/sheet-permission.service.d.ts +3 -3
  57. package/lib/types/services/ref-range/ref-range.service.d.ts +3 -3
  58. package/lib/types/services/sheet-interceptor/utils/interceptor.d.ts +2 -2
  59. package/lib/umd/index.js +1 -3
  60. package/package.json +10 -12
  61. package/lib/types/commands/commands/utils/selection-util.d.ts +0 -66
@@ -13,68 +13,68 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { Dimension, ICellData, IColumnData, IRange, IRowData, IWorksheetData, ObjectArray, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { Dimension, ICellData, IColumnData, IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType, IRange, IRowData, IWorksheetData } from '@univerjs/core';
17
17
  /** Params of `RemoveSheetMutation` */
18
18
  export interface IRemoveSheetMutationParams {
19
- worksheetId: string;
20
- workbookId: string;
19
+ subUnitId: string;
20
+ unitId: string;
21
21
  }
22
22
  /** Params of `InsertSheetMutation` */
23
23
  export interface IInsertSheetMutationParams {
24
24
  index: number;
25
25
  sheet: IWorksheetData;
26
- workbookId: string;
26
+ unitId: string;
27
27
  }
28
28
  /** Params of InsertRowMutation */
29
29
  export interface IInsertRowMutationParams {
30
- workbookId: string;
31
- worksheetId: string;
32
- ranges: IRange[];
33
- rowInfo?: ObjectArray<IRowData>;
30
+ unitId: string;
31
+ subUnitId: string;
32
+ range: IRange;
33
+ rowInfo?: IObjectArrayPrimitiveType<IRowData>;
34
34
  }
35
35
  /** Params of InsertColMutation */
36
36
  export interface IInsertColMutationParams {
37
- workbookId: string;
38
- worksheetId: string;
39
- ranges: IRange[];
40
- colInfo?: ObjectArray<IColumnData>;
37
+ unitId: string;
38
+ subUnitId: string;
39
+ range: IRange;
40
+ colInfo?: IObjectArrayPrimitiveType<IColumnData>;
41
41
  }
42
42
  /** Params of InsertRowMutation */
43
43
  export interface IRemoveRowsMutationParams {
44
- workbookId: string;
45
- worksheetId: string;
46
- ranges: IRange[];
44
+ unitId: string;
45
+ subUnitId: string;
46
+ range: IRange;
47
47
  }
48
48
  /** Params of InsertColMutation */
49
49
  export interface IRemoveColMutationParams {
50
- workbookId: string;
51
- worksheetId: string;
52
- ranges: IRange[];
50
+ unitId: string;
51
+ subUnitId: string;
52
+ range: IRange;
53
53
  }
54
54
  /** Params of DeleteRange */
55
55
  export interface IDeleteRangeMutationParams {
56
- workbookId: string;
57
- worksheetId: string;
58
- ranges: IRange[];
56
+ unitId: string;
57
+ subUnitId: string;
58
+ range: IRange;
59
59
  shiftDimension: Dimension;
60
60
  }
61
61
  /** Params of InsertRange */
62
62
  export interface IInsertRangeMutationParams {
63
- workbookId: string;
64
- worksheetId: string;
65
- ranges: IRange[];
63
+ unitId: string;
64
+ subUnitId: string;
65
+ range: IRange;
66
66
  shiftDimension: Dimension;
67
- cellValue: ObjectMatrixPrimitiveType<ICellData>;
67
+ cellValue?: IObjectMatrixPrimitiveType<ICellData>;
68
68
  }
69
69
  /** Params of RemoveWorksheetMergeMutation */
70
70
  export interface IRemoveWorksheetMergeMutationParams {
71
- workbookId: string;
72
- worksheetId: string;
71
+ unitId: string;
72
+ subUnitId: string;
73
73
  ranges: IRange[];
74
74
  }
75
75
  /** Params of AddWorksheetMergeMutation */
76
76
  export interface IAddWorksheetMergeMutationParams {
77
- workbookId: string;
78
- worksheetId: string;
77
+ unitId: string;
78
+ subUnitId: string;
79
79
  ranges: IRange[];
80
80
  }
@@ -19,5 +19,5 @@ export interface ISelectionConfig {
19
19
  cell?: IRangeCellData;
20
20
  }
21
21
  export interface ISelectionsConfig {
22
- [worksheetId: string]: ISelectionConfig[];
22
+ [subUnitId: string]: ISelectionConfig[];
23
23
  }
@@ -18,8 +18,8 @@ import { Dimension } from '@univerjs/core';
18
18
  export interface IAddMergeCommandParams {
19
19
  value?: Dimension.ROWS | Dimension.COLUMNS;
20
20
  selections: IRange[];
21
- workbookId: string;
22
- worksheetId: string;
21
+ unitId: string;
22
+ subUnitId: string;
23
23
  }
24
24
  export declare const AddWorksheetMergeCommand: ICommand;
25
25
  export declare const AddWorksheetMergeAllCommand: ICommand;
@@ -13,9 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICellData, ICommand, IRange, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { ICellData, ICommand, IObjectMatrixPrimitiveType, IRange } from '@univerjs/core';
17
17
  /**
18
18
  * The command to clear content in current selected ranges.
19
19
  */
20
20
  export declare const ClearSelectionFormatCommand: ICommand;
21
- export declare function generateNullCellValue(ranges: IRange[]): ObjectMatrixPrimitiveType<ICellData>;
21
+ export declare function generateNullCellValue(ranges: IRange[]): IObjectMatrixPrimitiveType<ICellData>;
@@ -15,9 +15,9 @@
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ICopySheetToCommandParams {
18
- workbookId?: string;
19
- worksheetId?: string;
20
- copyToWorkbookId?: string;
18
+ unitId?: string;
19
+ subUnitId?: string;
20
+ copyTounitId?: string;
21
21
  copyToSheetId?: string;
22
22
  }
23
23
  export declare const CopySheetToCommand: ICommand;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ICopySheetCommandParams {
18
- workbookId?: string;
19
- worksheetId?: string;
18
+ unitId?: string;
19
+ subUnitId?: string;
20
20
  }
21
21
  export declare const CopySheetCommand: ICommand;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface IDeleteRangeMoveLeftCommandParams {
18
- ranges: IRange[];
18
+ range: IRange;
19
19
  }
20
20
  export declare const DeleteRangeMoveLeftCommandId = "sheet.command.delete-range-move-left";
21
21
  /**
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface IDeleteRangeMoveUpCommandParams {
18
- ranges: IRange[];
18
+ range: IRange;
19
19
  }
20
20
  export declare const DeleteRangeMoveUpCommandId = "sheet.command.delete-range-move-up";
21
21
  /**
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface InsertRangeMoveDownCommandParams {
18
- ranges: IRange[];
18
+ range: IRange;
19
19
  }
20
20
  export declare const InsertRangeMoveDownCommandId = "sheet.command.insert-range-move-down";
21
21
  /**
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface InsertRangeMoveRightCommandParams {
18
- ranges: IRange[];
18
+ range: IRange;
19
19
  }
20
20
  export declare const InsertRangeMoveRightCommandId = "sheet.command.insert-range-move-right";
21
21
  /**
@@ -13,11 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IRange } from '@univerjs/core';
16
+ import type { ICellData, ICommand, IObjectMatrixPrimitiveType, IRange } from '@univerjs/core';
17
17
  import { Direction } from '@univerjs/core';
18
18
  export interface IInsertRowCommandParams {
19
- workbookId: string;
20
- worksheetId: string;
19
+ unitId: string;
20
+ subUnitId: string;
21
21
  /**
22
22
  * whether it is inserting row after (DOWN) or inserting before (UP)
23
23
  *
@@ -28,6 +28,7 @@ export interface IInsertRowCommandParams {
28
28
  * The range will the row be inserted.
29
29
  */
30
30
  range: IRange;
31
+ cellValue?: IObjectMatrixPrimitiveType<ICellData>;
31
32
  }
32
33
  export declare const InsertRowCommandId = "sheet.command.insert-row";
33
34
  /**
@@ -39,10 +40,11 @@ export declare const InsertRowCommand: ICommand;
39
40
  export declare const InsertRowBeforeCommand: ICommand;
40
41
  export declare const InsertRowAfterCommand: ICommand;
41
42
  export interface IInsertColCommandParams {
42
- workbookId: string;
43
- worksheetId: string;
43
+ unitId: string;
44
+ subUnitId: string;
44
45
  range: IRange;
45
46
  direction: Direction.LEFT | Direction.RIGHT;
47
+ cellValue?: IObjectMatrixPrimitiveType<ICellData>;
46
48
  }
47
49
  export declare const InsertColCommandId = "sheet.command.insert-col";
48
50
  export declare const InsertColCommand: ICommand<IInsertColCommandParams>;
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { ICommand, IWorksheetData } from '@univerjs/core';
17
- export interface InsertSheetCommandParams {
18
- workbookId?: string;
17
+ export interface IInsertSheetCommandParams {
18
+ unitId?: string;
19
19
  index?: number;
20
20
  sheet?: IWorksheetData;
21
21
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface IRemoveRowColCommandParams {
18
- ranges: IRange[];
18
+ range: IRange;
19
19
  }
20
20
  export declare const RemoveRowCommandId = "sheet.command.remove-row";
21
21
  /**
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface IRemoveSheetCommandParams {
18
- workbookId?: string;
19
- worksheetId?: string;
18
+ unitId?: string;
19
+ subUnitId?: string;
20
20
  }
21
21
  /**
22
22
  * The command to insert new worksheet
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface ISetSpecificColsVisibleCommandParams {
18
- workbookId: string;
19
- worksheetId: string;
18
+ unitId: string;
19
+ subUnitId: string;
20
20
  ranges: IRange[];
21
21
  }
22
22
  export declare const SetSpecificColsVisibleCommand: ICommand<ISetSpecificColsVisibleCommandParams>;
@@ -17,7 +17,7 @@ import type { ICommand } from '@univerjs/core';
17
17
  import { BooleanNumber } from '@univerjs/core';
18
18
  export interface ISetHideGridlinesCommandParams {
19
19
  hideGridlines?: BooleanNumber;
20
- workbookId?: string;
21
- worksheetId?: string;
20
+ unitId?: string;
21
+ subUnitId?: string;
22
22
  }
23
23
  export declare const SetHideGridlinesCommand: ICommand;
@@ -13,17 +13,17 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICellData, ICommand, IRange, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { ICellData, ICommand, IObjectMatrixPrimitiveType, IRange } from '@univerjs/core';
17
17
  export interface ISetRangeValuesCommandParams {
18
- worksheetId?: string;
19
- workbookId?: string;
18
+ subUnitId?: string;
19
+ unitId?: string;
20
20
  range?: IRange;
21
21
  /**
22
22
  * 1. ICellData: Normal cell data
23
23
  * 2. ICellData[][]: The two-dimensional array indicates the data of multiple cells
24
- * 3. ObjectMatrixPrimitiveType<ICellData>: Bring the row/column information MATRIX, indicating the data of multiple cells
24
+ * 3. IObjectMatrixPrimitiveType<ICellData>: Bring the row/column information MATRIX, indicating the data of multiple cells
25
25
  */
26
- value: ICellData | ICellData[][] | ObjectMatrixPrimitiveType<ICellData>;
26
+ value: ICellData | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>;
27
27
  }
28
28
  /**
29
29
  * The command to set values for ranges.
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import type { ICommand, IRange } from '@univerjs/core';
17
17
  export interface ISetSpecificRowsVisibleCommandParams {
18
- workbookId: string;
19
- worksheetId: string;
18
+ unitId: string;
19
+ subUnitId: string;
20
20
  ranges: IRange[];
21
21
  }
22
22
  export declare const SetSpecificRowsVisibleCommand: ICommand<ISetSpecificRowsVisibleCommandParams>;
@@ -19,8 +19,8 @@ export interface IStyleTypeValue<T> {
19
19
  value: T | T[][];
20
20
  }
21
21
  export interface ISetStyleCommandParams<T> {
22
- worksheetId?: string;
23
- workbookId?: string;
22
+ subUnitId?: string;
23
+ unitId?: string;
24
24
  range?: IRange;
25
25
  style: IStyleTypeValue<T>;
26
26
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ISetWorksheetActivateCommandParams {
18
- workbookId?: string;
19
- worksheetId?: string;
18
+ unitId?: string;
19
+ subUnitId?: string;
20
20
  }
21
21
  export declare const SetWorksheetActivateCommand: ICommand;
@@ -15,6 +15,6 @@
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ISetWorksheetHiddenCommandParams {
18
- worksheetId?: string;
18
+ subUnitId?: string;
19
19
  }
20
20
  export declare const SetWorksheetHideCommand: ICommand;
@@ -16,8 +16,8 @@
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ISetWorksheetNameCommandParams {
18
18
  name: string;
19
- worksheetId?: string;
20
- workbookId?: string;
19
+ subUnitId?: string;
20
+ unitId?: string;
21
21
  }
22
22
  /**
23
23
  * The command to set the sheet name.
@@ -16,7 +16,7 @@
16
16
  import type { ICommand } from '@univerjs/core';
17
17
  export interface ISetWorksheetOrderCommandParams {
18
18
  order: number;
19
- workbookId?: string;
20
- worksheetId?: string;
19
+ unitId?: string;
20
+ subUnitId?: string;
21
21
  }
22
22
  export declare const SetWorksheetOrderCommand: ICommand;
@@ -17,7 +17,7 @@ import type { ICommand } from '@univerjs/core';
17
17
  import { BooleanNumber } from '@univerjs/core';
18
18
  export interface ISetWorksheetRightToLeftCommandParams {
19
19
  rightToLeft?: BooleanNumber;
20
- workbookId?: string;
21
- worksheetId?: string;
20
+ unitId?: string;
21
+ subUnitId?: string;
22
22
  }
23
23
  export declare const SetWorksheetRightToLeftCommand: ICommand;
@@ -23,6 +23,7 @@ export interface ISetRowHeightCommandParams {
23
23
  value: number;
24
24
  }
25
25
  export declare const SetRowHeightCommand: ICommand;
26
- export interface ISetRowAutoHeightCommandParams {
26
+ export interface ISetWorksheetRowIsAutoHeightCommandParams {
27
+ anchorRow?: number;
27
28
  }
28
29
  export declare const SetWorksheetRowIsAutoHeightCommand: ICommand;
@@ -0,0 +1,42 @@
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
+ import type { IRange, ISelectionCell, Worksheet } from '@univerjs/core';
17
+ export interface IExpandParams {
18
+ left?: boolean;
19
+ right?: boolean;
20
+ up?: boolean;
21
+ down?: boolean;
22
+ }
23
+ /**
24
+ * Adjust the range to align merged cell's borders.
25
+ */
26
+ export declare function alignToMergedCellsBorders(startRange: IRange, worksheet: Worksheet, shouldRecursive?: boolean): IRange;
27
+ export declare function getCellAtRowCol(row: number, col: number, worksheet: Worksheet): ISelectionCell;
28
+ /**
29
+ * Get the default primary cell (the most top-left cell) of a range.
30
+ * @param range
31
+ * @param worksheet
32
+ */
33
+ export declare function getPrimaryForRange(range: IRange, worksheet: Worksheet): ISelectionCell;
34
+ export interface IInterval {
35
+ [index: string]: [start: number, end: number];
36
+ }
37
+ /**
38
+ * Calculate the real length of the intervals
39
+ * @param intervalsObject
40
+ * @returns
41
+ */
42
+ export declare function calculateTotalLength(intervalsObject: IInterval): number;
@@ -26,4 +26,4 @@ import type { IDeleteRangeMutationParams, IInsertRangeMutationParams } from '../
26
26
  */
27
27
  export declare const DeleteRangeUndoMutationFactory: (accessor: IAccessor, params: IDeleteRangeMutationParams) => Nullable<IInsertRangeMutationParams>;
28
28
  export declare const DeleteRangeMutation: IMutation<IDeleteRangeMutationParams, boolean>;
29
- export declare function handleDeleteRangeMutation<T>(cellMatrix: ObjectMatrix<T>, ranges: IRange[], lastEndRow: number, lastEndColumn: number, shiftDimension: Dimension): void;
29
+ export declare function handleDeleteRangeMutation<T>(cellMatrix: ObjectMatrix<T>, range: IRange, lastEndRow: number, lastEndColumn: number, shiftDimension: Dimension): void;
@@ -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
- import type { IMutation, IRange, ObjectMatrix, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { IMutation, IObjectMatrixPrimitiveType, IRange, ObjectMatrix } from '@univerjs/core';
17
17
  import { Dimension } from '@univerjs/core';
18
18
  import type { IAccessor } from '@wendellhu/redi';
19
19
  import type { IDeleteRangeMutationParams, IInsertRangeMutationParams } from '../../basics/interfaces/mutation-interface';
@@ -26,4 +26,4 @@ import type { IDeleteRangeMutationParams, IInsertRangeMutationParams } from '../
26
26
  */
27
27
  export declare const InsertRangeUndoMutationFactory: (accessor: IAccessor, params: IInsertRangeMutationParams) => IDeleteRangeMutationParams;
28
28
  export declare const InsertRangeMutation: IMutation<IInsertRangeMutationParams, boolean>;
29
- export declare function handleInsertRangeMutation<T>(cellMatrix: ObjectMatrix<T>, ranges: IRange[], lastEndRow: number, lastEndColumn: number, shiftDimension: Dimension, cellValue?: ObjectMatrixPrimitiveType<T>): void;
29
+ export declare function handleInsertRangeMutation<T>(cellMatrix: ObjectMatrix<T>, range: IRange, lastEndRow: number, lastEndColumn: number, shiftDimension: Dimension, cellValue?: IObjectMatrixPrimitiveType<T>): void;
@@ -13,11 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICellData, IMutation, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { ICellData, IMutation, IObjectMatrixPrimitiveType, Nullable } from '@univerjs/core';
17
17
  export interface IMoveRangeMutationParams {
18
- workbookId: string;
19
- worksheetId: string;
20
- from: ObjectMatrixPrimitiveType<ICellData | null>;
21
- to: ObjectMatrixPrimitiveType<ICellData | null>;
18
+ unitId: string;
19
+ subUnitId: string;
20
+ from: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
21
+ to: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
22
22
  }
23
23
  export declare const MoveRangeMutation: IMutation<IMoveRangeMutationParams, boolean>;
@@ -16,8 +16,8 @@
16
16
  import type { IMutation, IRange } from '@univerjs/core';
17
17
  import type { IAccessor } from '@wendellhu/redi';
18
18
  export interface IMoveRowsMutationParams {
19
- workbookId: string;
20
- worksheetId: string;
19
+ unitId: string;
20
+ subUnitId: string;
21
21
  /**
22
22
  * The rows to be moved.
23
23
  */
@@ -35,8 +35,8 @@ export interface IMoveRowsMutationParams {
35
35
  export declare function MoveRowsMutationUndoFactory(_accessor: IAccessor, params: IMoveRowsMutationParams): IMoveRowsMutationParams;
36
36
  export declare const MoveRowsMutation: IMutation<IMoveRowsMutationParams>;
37
37
  export interface IMoveColumnsMutationParams {
38
- workbookId: string;
39
- worksheetId: string;
38
+ unitId: string;
39
+ subUnitId: string;
40
40
  /**
41
41
  * The cols to be moved.
42
42
  */
@@ -29,14 +29,14 @@ export interface ISetNumfmtMutationParams {
29
29
  type: FormatType;
30
30
  };
31
31
  };
32
- workbookId: string;
33
- worksheetId: string;
32
+ unitId: string;
33
+ subUnitId: string;
34
34
  }
35
35
  export declare const SetNumfmtMutation: ICommand<ISetNumfmtMutationParams>;
36
36
  export interface IRemoveNumfmtMutationParams {
37
37
  ranges: IRange[];
38
- workbookId: string;
39
- worksheetId: string;
38
+ unitId: string;
39
+ subUnitId: string;
40
40
  }
41
41
  export declare const RemoveNumfmtMutation: ICommand<IRemoveNumfmtMutationParams>;
42
42
  export declare const factoryRemoveNumfmtUndoMutation: (accessor: IAccessor, option: IRemoveNumfmtMutationParams) => {
@@ -49,4 +49,4 @@ export type ISetCellsNumfmt = Array<{
49
49
  row: number;
50
50
  col: number;
51
51
  }>;
52
- export declare const transformCellsToRange: (workbookId: string, worksheetId: string, cells: ISetCellsNumfmt) => ISetNumfmtMutationParams;
52
+ export declare const transformCellsToRange: (unitId: string, subUnitId: string, cells: ISetCellsNumfmt) => ISetNumfmtMutationParams;
@@ -16,24 +16,24 @@
16
16
  import type { IMutation, IRange } from '@univerjs/core';
17
17
  import type { IAccessor } from '@wendellhu/redi';
18
18
  export interface ISetColHiddenMutationParams {
19
- workbookId: string;
20
- worksheetId: string;
19
+ unitId: string;
20
+ subUnitId: string;
21
21
  ranges: IRange[];
22
22
  }
23
23
  export declare const SetColHiddenUndoMutationFactory: (accessor: IAccessor, params: ISetColHiddenMutationParams) => {
24
- workbookId: string;
25
- worksheetId: string;
24
+ unitId: string;
25
+ subUnitId: string;
26
26
  ranges: IRange[];
27
27
  };
28
28
  export declare const SetColHiddenMutation: IMutation<ISetColHiddenMutationParams>;
29
29
  export interface ISetColVisibleMutationParams {
30
- workbookId: string;
31
- worksheetId: string;
30
+ unitId: string;
31
+ subUnitId: string;
32
32
  ranges: IRange[];
33
33
  }
34
34
  export declare const SetColVisibleUndoMutationFactory: (accessor: IAccessor, params: ISetColVisibleMutationParams) => {
35
- workbookId: string;
36
- worksheetId: string;
35
+ unitId: string;
36
+ subUnitId: string;
37
37
  ranges: IRange[];
38
38
  };
39
39
  export declare const SetColVisibleMutation: IMutation<ISetColVisibleMutationParams>;
@@ -16,8 +16,8 @@
16
16
  import type { IMutation } from '@univerjs/core';
17
17
  import type { IAccessor } from '@wendellhu/redi';
18
18
  export interface ISetFrozenMutationParams {
19
- workbookId: string;
20
- worksheetId: string;
19
+ unitId: string;
20
+ subUnitId: string;
21
21
  startRow: number;
22
22
  startColumn: number;
23
23
  ySplit: number;
@@ -17,8 +17,8 @@ import type { BooleanNumber, IMutation } from '@univerjs/core';
17
17
  import type { IAccessor } from '@wendellhu/redi';
18
18
  export interface ISetHideGridlinesMutationParams {
19
19
  hideGridlines: BooleanNumber;
20
- workbookId: string;
21
- worksheetId: string;
20
+ unitId: string;
21
+ subUnitId: string;
22
22
  }
23
23
  export declare const SetHideGridlinesUndoMutationFactory: (accessor: IAccessor, params: ISetHideGridlinesMutationParams) => ISetHideGridlinesMutationParams;
24
24
  export declare const SetHideGridlinesMutation: IMutation<ISetHideGridlinesMutationParams>;
@@ -13,16 +13,16 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IBorderData, ICellData, ICopyToOptionsData, IDocumentData, IMutation, IMutationCommonParams, IRange, IStyleData, Nullable, ObjectMatrixPrimitiveType } from '@univerjs/core';
16
+ import type { IBorderData, ICellData, ICopyToOptionsData, IDocumentData, IMutation, IMutationCommonParams, IObjectMatrixPrimitiveType, IRange, IStyleData, Nullable } from '@univerjs/core';
17
17
  import type { IAccessor } from '@wendellhu/redi';
18
18
  /** Params of `SetRangeValuesMutation` */
19
19
  export interface ISetRangeValuesMutationParams extends IMutationCommonParams {
20
- worksheetId: string;
21
- workbookId: string;
20
+ subUnitId: string;
21
+ unitId: string;
22
22
  /**
23
23
  * null for clear all
24
24
  */
25
- cellValue?: ObjectMatrixPrimitiveType<ICellData | null>;
25
+ cellValue?: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
26
26
  /**
27
27
  * @deprecated not a good design
28
28
  */