@univerjs/sheets 0.4.1 → 0.4.2-nightly.202410301606

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 (76) hide show
  1. package/lib/add-worksheet-merge.command-0cuLfO_2.mjs +5939 -0
  2. package/lib/es/facade.js +1818 -0
  3. package/lib/es/index.js +1800 -7245
  4. package/lib/locale/en-US.js +17 -0
  5. package/lib/locale/fa-IR.js +17 -0
  6. package/lib/locale/ru-RU.js +17 -0
  7. package/lib/locale/vi-VN.js +17 -0
  8. package/lib/locale/zh-CN.js +17 -0
  9. package/lib/locale/zh-TW.js +17 -0
  10. package/lib/types/basics/row-column-value.d.ts +14 -0
  11. package/lib/types/commands/commands/__tests__/set-col-data.command.spec.d.ts +16 -0
  12. package/lib/types/commands/commands/__tests__/set-row-data.command.spec.d.ts +16 -0
  13. package/lib/types/commands/commands/__tests__/set-worksheet-default-style.command.spec.d.ts +16 -0
  14. package/lib/types/commands/commands/set-col-data.command.d.ts +7 -0
  15. package/lib/types/commands/commands/set-frozen.command.d.ts +13 -0
  16. package/lib/types/commands/commands/set-row-data.command.d.ts +7 -0
  17. package/lib/types/commands/commands/set-style.command.d.ts +1 -1
  18. package/lib/types/commands/commands/set-worksheet-col-width.command.d.ts +6 -0
  19. package/lib/types/commands/commands/set-worksheet-default-style.command.d.ts +2 -0
  20. package/lib/types/commands/commands/toggle-gridlines.command.d.ts +7 -0
  21. package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +2 -2
  22. package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +3 -3
  23. package/lib/types/commands/mutations/set-col-data.mutation.d.ts +8 -0
  24. package/lib/types/commands/mutations/set-frozen.mutation.d.ts +8 -0
  25. package/lib/types/commands/mutations/set-row-data.mutation.d.ts +8 -0
  26. package/lib/types/commands/mutations/set-worksheet-col-width.mutation.d.ts +3 -0
  27. package/lib/types/commands/mutations/set-worksheet-default-style.mutation.d.ts +12 -0
  28. package/lib/types/commands/mutations/toggle-gridlines.mutation.d.ts +7 -0
  29. package/lib/types/controllers/config.schema.d.ts +4 -0
  30. package/lib/types/facade/__tests__/utils.spec.d.ts +16 -0
  31. package/lib/types/facade/f-permission.d.ts +106 -0
  32. package/lib/types/facade/f-range.d.ts +193 -0
  33. package/lib/types/facade/f-selection.d.ts +11 -0
  34. package/lib/types/facade/f-univer.d.ts +36 -0
  35. package/lib/types/facade/f-workbook.d.ts +105 -0
  36. package/lib/types/facade/f-worksheet.d.ts +408 -0
  37. package/lib/types/facade/index.d.ts +6 -0
  38. package/lib/types/facade/utils.d.ts +24 -0
  39. package/lib/types/index.d.ts +19 -7
  40. package/lib/types/model/range-protection.cache.d.ts +5 -2
  41. package/lib/types/services/border-style-manager.service.d.ts +2 -2
  42. package/lib/types/services/permission/permission-point/index.d.ts +2 -0
  43. package/lib/types/services/permission/permission-point/range/delete-protection.d.ts +13 -0
  44. package/lib/types/services/permission/permission-point/range/manage-collaborator.d.ts +13 -0
  45. package/lib/types/services/permission/permission-point/workbook/create-permission.d.ts +11 -0
  46. package/lib/types/services/permission/permission-point/worksheet/delete-protection.d.ts +12 -0
  47. package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
  48. package/lib/types/services/permission/range-permission/range-protection.service.d.ts +3 -2
  49. package/lib/types/services/permission/range-permission/util.d.ts +1 -0
  50. package/lib/types/services/permission/type.d.ts +1 -1
  51. package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +4 -1
  52. package/lib/types/services/permission/worksheet-permission/utils.d.ts +2 -2
  53. package/lib/types/services/selections/selection-manager.service.d.ts +2 -2
  54. package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +38 -7
  55. package/lib/umd/facade.js +3 -0
  56. package/lib/umd/index.js +3 -3
  57. package/lib/umd/locale/en-US.js +1 -0
  58. package/lib/umd/locale/fa-IR.js +1 -0
  59. package/lib/umd/locale/ru-RU.js +1 -0
  60. package/lib/umd/locale/vi-VN.js +1 -0
  61. package/lib/umd/locale/zh-CN.js +1 -0
  62. package/lib/umd/locale/zh-TW.js +1 -0
  63. package/package.json +21 -18
  64. package/LICENSE +0 -176
  65. package/lib/cjs/index.js +0 -3
  66. package/lib/locale/en-US.json +0 -14
  67. package/lib/locale/fa-IR.json +0 -14
  68. package/lib/locale/ru-RU.json +0 -14
  69. package/lib/locale/vi-VN.json +0 -14
  70. package/lib/locale/zh-CN.json +0 -14
  71. package/lib/locale/zh-TW.json +0 -14
  72. package/lib/types/basics/cell-custom.d.ts +0 -12
  73. package/lib/types/commands/commands/set-frozen-cancel.command.d.ts +0 -2
  74. package/lib/types/commands/commands/set-hide-gridlines.command.d.ts +0 -7
  75. package/lib/types/commands/mutations/set-hide-gridlines.mutatiom.d.ts +0 -8
  76. /package/lib/types/basics/__tests__/{cell-custom.spec.d.ts → row-column-value.spec.d.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(Copy{0})",
5
+ sheet: "Sheet"
6
+ },
7
+ info: {
8
+ overlappingSelections: "Cannot use that command on overlapping selections",
9
+ acrossMergedCell: "Across a merged cell",
10
+ partOfCell: "Only part of a merged cell is selected",
11
+ hideSheet: "No visible sheet after you hide this"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(کپی{0})",
5
+ sheet: "برگ"
6
+ },
7
+ info: {
8
+ overlappingSelections: "نمی‌توان از این دستور روی انتخاب‌های همپوشانی استفاده کرد",
9
+ acrossMergedCell: "در سراسر سلول ادغام شده",
10
+ partOfCell: "فقط بخشی از سلول ادغام شده انتخاب شده است",
11
+ hideSheet: "پس از پنهان کردن این برگ، هیچ برگی قابل مشاهده نخواهد بود"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(Копия{0})",
5
+ sheet: "Лист"
6
+ },
7
+ info: {
8
+ overlappingSelections: "Невозможно использовать эту команду на пересекающихся выделениях",
9
+ acrossMergedCell: "Через объединенную ячейку",
10
+ partOfCell: "Выделена только часть объединенной ячейки",
11
+ hideSheet: "После скрытия этого листа не будет видно ни одного листа"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(Bản sao {0})",
5
+ sheet: "Bảng tính"
6
+ },
7
+ info: {
8
+ overlappingSelections: "Không thể sử dụng lệnh này trên các vùng chọn chồng chéo nhau",
9
+ acrossMergedCell: "Không thể vượt qua các ô đã hợp nhất",
10
+ partOfCell: "Chỉ chọn một phần của ô đã hợp nhất",
11
+ hideSheet: "Không có bảng tính nào hiển thị sau khi ẩn"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(副本{0})",
5
+ sheet: "工作表"
6
+ },
7
+ info: {
8
+ overlappingSelections: "无法对重叠选区使用该命令",
9
+ acrossMergedCell: "无法跨越合并单元格",
10
+ partOfCell: "仅选择了合并单元格的一部分",
11
+ hideSheet: "隐藏后无可见工作表"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,17 @@
1
+ const locale = {
2
+ sheets: {
3
+ tabs: {
4
+ sheetCopy: "(副本{0})",
5
+ sheet: "工作表"
6
+ },
7
+ info: {
8
+ overlappingSelections: "無法對重疊選區使用該命令",
9
+ acrossMergedCell: "無法跨越合併儲存格",
10
+ partOfCell: "僅選擇了合併儲存格的一部份",
11
+ hideSheet: "隱藏後無可見工作表"
12
+ }
13
+ }
14
+ };
15
+ export {
16
+ locale as default
17
+ };
@@ -0,0 +1,14 @@
1
+ import { IColumnData, IRowData, Nullable } from '@univerjs/core';
2
+ /**
3
+ * Reset the row data to undefined when undoing the operation
4
+ * @param currentRow
5
+ * @returns
6
+ */
7
+ export declare function getOldRowData(currentRow: Nullable<Partial<IRowData>>, newRow: Nullable<Partial<IRowData>>): Nullable<Partial<IRowData>>;
8
+ /**
9
+ * Reset the column data to undefined when undoing the operation
10
+ * @param currenColumn
11
+ * @param newColumn
12
+ * @returns
13
+ */
14
+ export declare function getOldColumnData(currenColumn: Nullable<Partial<IColumnData>>, newColumn: Nullable<Partial<IColumnData>>): Nullable<Partial<IColumnData>>;
@@ -0,0 +1,16 @@
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
+ export {};
@@ -0,0 +1,16 @@
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
+ export {};
@@ -0,0 +1,16 @@
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
+ export {};
@@ -0,0 +1,7 @@
1
+ import { IColumnData, ICommand, IObjectArrayPrimitiveType, Nullable } from '@univerjs/core';
2
+ import { ISheetCommandSharedParams } from '../utils/interface';
3
+ export type IColumnProperties = Omit<IColumnData, 'w' | 'hd'>;
4
+ export interface ISetColDataCommandParams extends Partial<ISheetCommandSharedParams> {
5
+ columnData: IObjectArrayPrimitiveType<Nullable<IColumnProperties>>;
6
+ }
7
+ export declare const SetColDataCommand: ICommand;
@@ -1,2 +1,15 @@
1
1
  import { ICommand } from '@univerjs/core';
2
+ export interface ISetFrozenCommandParams {
3
+ startRow: number;
4
+ startColumn: number;
5
+ ySplit: number;
6
+ xSplit: number;
7
+ unitId?: string;
8
+ subUnitId?: string;
9
+ }
2
10
  export declare const SetFrozenCommand: ICommand;
11
+ export interface ICancelFrozenCommandParams {
12
+ unitId?: string;
13
+ subUnitId?: string;
14
+ }
15
+ export declare const CancelFrozenCommand: ICommand<ICancelFrozenCommandParams>;
@@ -0,0 +1,7 @@
1
+ import { ICommand, IObjectArrayPrimitiveType, IRowData, Nullable } from '@univerjs/core';
2
+ import { ISheetCommandSharedParams } from '../utils/interface';
3
+ export type IRowProperties = Omit<IRowData, 'h' | 'ia' | 'ah' | 'hd'>;
4
+ export interface ISetRowDataCommandParams extends Partial<ISheetCommandSharedParams> {
5
+ rowData: IObjectArrayPrimitiveType<Nullable<IRowProperties>>;
6
+ }
7
+ export declare const SetRowDataCommand: ICommand;
@@ -46,7 +46,7 @@ export interface ISetFontSizeCommandParams {
46
46
  }
47
47
  export declare const SetFontSizeCommand: ICommand<ISetFontSizeCommandParams>;
48
48
  export interface ISetColorCommandParams {
49
- value: string;
49
+ value: string | null;
50
50
  }
51
51
  export declare const SetTextColorCommand: ICommand<ISetColorCommandParams>;
52
52
  export declare const ResetTextColorCommand: ICommand;
@@ -11,3 +11,9 @@ export interface ISetColWidthCommandParams {
11
11
  value: number;
12
12
  }
13
13
  export declare const SetColWidthCommand: ICommand;
14
+ export interface ISetWorksheetColIsAutoWidthCommandParams {
15
+ unitId?: string;
16
+ subUnitId?: string;
17
+ ranges?: IRange[];
18
+ }
19
+ export declare const SetWorksheetColIsAutoWidthCommand: ICommand;
@@ -0,0 +1,2 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ export declare const SetWorksheetDefaultStyleCommand: ICommand;
@@ -0,0 +1,7 @@
1
+ import { ICommand, BooleanNumber } from '@univerjs/core';
2
+ export interface IToggleGridlinesCommandParams {
3
+ showGridlines?: BooleanNumber;
4
+ unitId?: string;
5
+ subUnitId?: string;
6
+ }
7
+ export declare const ToggleGridlinesCommand: ICommand;
@@ -1,6 +1,6 @@
1
1
  import { IMutation, IMutationInfo } from '@univerjs/core';
2
2
  import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
3
- import { IDeleteSelectionProtectionMutationParams } from './delete-range-protection.mutation';
3
+ import { IDeleteRangeProtectionMutationParams } from './delete-range-protection.mutation';
4
4
  export interface IAddRangeProtectionMutationParams {
5
5
  rules: IRangeProtectionRule[];
6
6
  unitId: string;
@@ -8,5 +8,5 @@ export interface IAddRangeProtectionMutationParams {
8
8
  name?: string;
9
9
  description?: string;
10
10
  }
11
- export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteSelectionProtectionMutationParams>;
11
+ export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteRangeProtectionMutationParams>;
12
12
  export declare const AddRangeProtectionMutation: IMutation<IAddRangeProtectionMutationParams>;
@@ -1,9 +1,9 @@
1
1
  import { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
2
2
  import { IAddRangeProtectionMutationParams } from './add-range-protection.mutation';
3
- export interface IDeleteSelectionProtectionMutationParams {
3
+ export interface IDeleteRangeProtectionMutationParams {
4
4
  ruleIds: string[];
5
5
  unitId: string;
6
6
  subUnitId: string;
7
7
  }
8
- export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param: IDeleteSelectionProtectionMutationParams) => IMutationInfo<Omit<IAddRangeProtectionMutationParams, "name">>;
9
- export declare const DeleteRangeProtectionMutation: IMutation<IDeleteSelectionProtectionMutationParams>;
8
+ export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param: IDeleteRangeProtectionMutationParams) => IMutationInfo<Omit<IAddRangeProtectionMutationParams, "name">>;
9
+ export declare const DeleteRangeProtectionMutation: IMutation<IDeleteRangeProtectionMutationParams>;
@@ -0,0 +1,8 @@
1
+ import { IColumnData, IMutation, IObjectArrayPrimitiveType, Nullable, Worksheet } from '@univerjs/core';
2
+ export interface ISetColDataMutationParams {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ columnData: IObjectArrayPrimitiveType<Nullable<IColumnData>>;
6
+ }
7
+ export declare const SetColDataMutationFactory: (params: ISetColDataMutationParams, worksheet: Worksheet) => ISetColDataMutationParams;
8
+ export declare const SetColDataMutation: IMutation<ISetColDataMutationParams>;
@@ -4,7 +4,15 @@ export interface ISetFrozenMutationParams {
4
4
  subUnitId: string;
5
5
  startRow: number;
6
6
  startColumn: number;
7
+ /**
8
+ * Number of frozen rows.
9
+ * if row freeze start at 7, end at 10, then ySplit is 3
10
+ */
7
11
  ySplit: number;
12
+ /**
13
+ * Number of frozen columns.
14
+ * if column freeze start at 7, end at 10, then xSplit is 3
15
+ */
8
16
  xSplit: number;
9
17
  resetScroll?: boolean;
10
18
  }
@@ -0,0 +1,8 @@
1
+ import { IMutation, IObjectArrayPrimitiveType, IRowData, Nullable, Worksheet } from '@univerjs/core';
2
+ export interface ISetRowDataMutationParams {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ rowData: IObjectArrayPrimitiveType<Nullable<IRowData>>;
6
+ }
7
+ export declare const SetRowDataMutationFactory: (params: ISetRowDataMutationParams, worksheet: Worksheet) => ISetRowDataMutationParams;
8
+ export declare const SetRowDataMutation: IMutation<ISetRowDataMutationParams>;
@@ -12,4 +12,7 @@ export interface ISetWorksheetColWidthMutationParams {
12
12
  * for each column in the range.
13
13
  */
14
14
  export declare const SetWorksheetColWidthMutationFactory: (params: ISetWorksheetColWidthMutationParams, worksheet: Worksheet) => ISetWorksheetColWidthMutationParams;
15
+ /**
16
+ * Set width of column manually
17
+ */
15
18
  export declare const SetWorksheetColWidthMutation: IMutation<ISetWorksheetColWidthMutationParams>;
@@ -0,0 +1,12 @@
1
+ import { IAccessor, IMutation, IStyleData, Nullable } from '@univerjs/core';
2
+ export interface ISetWorksheetDefaultStyleMutationParams {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ defaultStyle: string | Nullable<IStyleData>;
6
+ }
7
+ export declare const SetWorksheetDefaultStyleMutation: IMutation<ISetWorksheetDefaultStyleMutationParams>;
8
+ export declare const SetWorksheetDefaultStyleMutationFactory: (accessor: IAccessor, params: ISetWorksheetDefaultStyleMutationParams) => {
9
+ unitId: string;
10
+ subUnitId: string;
11
+ defaultStyle: string | Nullable<IStyleData>;
12
+ };
@@ -0,0 +1,7 @@
1
+ import { BooleanNumber, IMutation } from '@univerjs/core';
2
+ export interface IToggleGridlinesMutationParams {
3
+ showGridlines: BooleanNumber;
4
+ unitId: string;
5
+ subUnitId: string;
6
+ }
7
+ export declare const ToggleGridlinesMutation: IMutation<IToggleGridlinesMutationParams>;
@@ -9,5 +9,9 @@ export interface IUniverSheetsConfig {
9
9
  * web worker environment or server-side-calculation.
10
10
  */
11
11
  onlyRegisterFormulaRelatedMutations?: true;
12
+ /**
13
+ * If the row style and column style be set both, and the row style should precede the column style or not.
14
+ */
15
+ isRowStylePrecedeColumnStyle?: boolean;
12
16
  }
13
17
  export declare const defaultPluginConfig: IUniverSheetsConfig;
@@ -0,0 +1,16 @@
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
+ export {};
@@ -0,0 +1,106 @@
1
+ import { IRange, RangePermissionPointConstructor, WorkbookPermissionPointConstructor, WorkSheetPermissionPointConstructor, FBase, IAuthzIoService, ICommandService, Injector, IPermissionService } from '@univerjs/core';
2
+ import { RangeProtectionRuleModel, WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
3
+ export declare class FPermission extends FBase {
4
+ protected readonly _injector: Injector;
5
+ protected readonly _commandService: ICommandService;
6
+ protected readonly _permissionService: IPermissionService;
7
+ protected readonly _worksheetProtectionRuleModel: WorksheetProtectionRuleModel;
8
+ protected readonly _rangeProtectionRuleModel: RangeProtectionRuleModel;
9
+ protected readonly _worksheetProtectionPointRuleModel: WorksheetProtectionPointModel;
10
+ protected readonly _authzIoService: IAuthzIoService;
11
+ constructor(_injector: Injector, _commandService: ICommandService, _permissionService: IPermissionService, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionPointRuleModel: WorksheetProtectionPointModel, _authzIoService: IAuthzIoService);
12
+ /**
13
+ * Configures a specific permission point for a workbook.
14
+ *
15
+ * This function sets or updates a permission point for a workbook identified by `unitId`.
16
+ * It creates a new permission point if it does not already exist, and updates the point with the provided value.
17
+ *
18
+ * @param {string} unitId - The unique identifier of the workbook for which the permission is being set.
19
+ * @param {WorkbookPermissionPointConstructor} FPointClass - The constructor function for creating a permission point instance. Other point constructors can See the [permission-point documentation](https://github.com/dream-num/univer/tree/dev/packages/sheets/src/services/permission/permission-point) for more details.
20
+ * @param {boolean} value - The boolean value to determine whether the permission point is enabled or disabled.
21
+ *
22
+ */
23
+ setWorkbookPermissionPoint(unitId: string, FPointClass: WorkbookPermissionPointConstructor, value: boolean): void;
24
+ /**
25
+ * This function is used to set whether the workbook can be edited
26
+ *
27
+ * @param {string} unitId - The unique identifier of the workbook for which the permission is being set.
28
+ * @param {boolean} value - A value that controls whether the workbook can be edited
29
+ *
30
+ */
31
+ setWorkbookEditPermission(unitId: string, value: boolean): void;
32
+ /**
33
+ * This function is used to add a base permission for a worksheet.
34
+ *
35
+ * @param {string} unitId - The unique identifier of the workbook for which the permission is being set.
36
+ * @param {string} subUnitId - The unique identifier of the worksheet for which the permission is being set.
37
+ *
38
+ * @returns {Promise<string | undefined>} - Returns the `permissionId` if the permission is successfully added. If the operation fails or no result is returned, it resolves to `undefined`.
39
+ */
40
+ addWorksheetBasePermission(unitId: string, subUnitId: string): Promise<string | undefined>;
41
+ /**
42
+ * Delete the entire table protection set for the worksheet and reset the point permissions of the worksheet to true
43
+ *
44
+ * @param {string} unitId - The unique identifier of the workbook for which the permission is being set.
45
+ * @param {string} subUnitId - The unique identifier of the worksheet for which the permission is being set.
46
+ */
47
+ removeWorksheetPermission(unitId: string, subUnitId: string): void;
48
+ /**
49
+ * Sets the worksheet permission point by updating or adding the permission point for the worksheet.
50
+ * If the worksheet doesn't have a base permission, it creates one to used render
51
+ *
52
+ * @param {string} unitId - The unique identifier of the workbook.
53
+ * @param {string} subUnitId - The unique identifier of the worksheet.
54
+ * @param {WorkSheetPermissionPointConstructor} FPointClass - The constructor for the permission point class.
55
+ * See the [permission-point documentation](https://github.com/dream-num/univer/tree/dev/packages/sheets/src/services/permission/permission-point) for more details.
56
+ * @param {boolean} value - The new permission value to be set for the worksheet.
57
+ *
58
+ * @returns {Promise<string | undefined>} - Returns the `permissionId` if the permission point is successfully set or created. If no permission is set, it resolves to `undefined`.
59
+ */
60
+ setWorksheetPermissionPoint(unitId: string, subUnitId: string, FPointClass: WorkSheetPermissionPointConstructor, value: boolean): Promise<string | undefined>;
61
+ /**
62
+ * Adds a range protection to the worksheet.
63
+ *
64
+ * @param {string} unitId - The unique identifier of the workbook.
65
+ * @param {string} subUnitId - The unique identifier of the worksheet.
66
+ * @param {IRange[]} ranges - The ranges to be protected.
67
+ *
68
+ * @returns {Promise<{ permissionId: string, ruleId: string } | undefined>} - Returns an object containing the `permissionId` and `ruleId` if the range protection is successfully added. If the operation fails or no result is returned, it resolves to `undefined`. permissionId is used to stitch permission point ID,ruleId is used to store permission rules
69
+ */
70
+ addRangeBaseProtection(unitId: string, subUnitId: string, ranges: IRange[]): Promise<{
71
+ permissionId: string;
72
+ ruleId: string;
73
+ } | undefined>;
74
+ /**
75
+ * Removes the range protection from the worksheet.
76
+ *
77
+ * @param {string} unitId - The unique identifier of the workbook.
78
+ * @param {string} subUnitId - The unique identifier of the worksheet.
79
+ * @param {string[]} ruleIds - The rule IDs of the range protection to be removed.
80
+ */
81
+ removeRangeProtection(unitId: string, subUnitId: string, ruleIds: string[]): void;
82
+ /**
83
+ * Modify the permission points of a custom area
84
+ *
85
+ * @param {string} unitId - The unique identifier of the workbook.
86
+ * @param {string} subUnitId - The unique identifier of the worksheet within the workbook.
87
+ * @param {string} permissionId - The unique identifier of the permission that controls access to the range.
88
+ * @param {RangePermissionPointConstructor} FPointClass - The constructor for the range permission point class.
89
+ * See the [permission-point documentation](https://github.com/dream-num/univer/tree/dev/packages/sheets/src/services/permission/permission-point) for more details.
90
+ * @param {boolean} value - The new permission value to be set for the range (e.g., true for allowing access, false for restricting access).
91
+ */
92
+ setRangeProtectionPermissionPoint(unitId: string, subUnitId: string, permissionId: string, FPointClass: RangePermissionPointConstructor, value: boolean): void;
93
+ /**
94
+ * Sets the ranges for range protection in a worksheet.
95
+ *
96
+ * This method finds the rule by unitId, subUnitId, and ruleId, and updates the rule with the provided ranges.
97
+ * It checks for overlaps with existing ranges in the same subunit and shows an error message if any overlap is detected.
98
+ * If no overlap is found, it executes the command to update the range protection with the new ranges.
99
+ *
100
+ * @param {string} unitId - The unique identifier of the workbook.
101
+ * @param {string} subUnitId - The unique identifier of the worksheet within the workbook.
102
+ * @param {string} ruleId - The ruleId of the range protection rule that is being updated.
103
+ * @param {IRange[]} ranges - The array of new ranges to be set for the range protection rule.
104
+ */
105
+ setRangeProtectionRanges(unitId: string, subUnitId: string, ruleId: string, ranges: IRange[]): void;
106
+ }