Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

chore(facade): keep workbook.getSnapshot (#3162)

Gpound.liu7308d2d0ec7d
diff --git a/packages/facade/src/apis/sheets/f-workbook.ts b/packages/facade/src/apis/sheets/f-workbook.ts
index ca4c836f64..acf771afb4 100644
--- a/packages/facade/src/apis/sheets/f-workbook.ts
+++ b/packages/facade/src/apis/sheets/f-workbook.ts
@@ -17,6 +17,7 @@
import type { CommandListener, ICommandInfo, IDisposable, IRange, IWorkbookData, Nullable, ObjectMatrix, Workbook } from '@univerjs/core';
import {
ICommandService,
+ ILogService,
Inject,
Injector,
IPermissionService,
@@ -47,7 +48,8 @@ export class FWorkbook {
@Inject(SheetsSelectionsService) private readonly _selectionManagerService: SheetsSelectionsService,
@IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService,
@ICommandService private readonly _commandService: ICommandService,
- @IPermissionService private readonly _permissionService: IPermissionService
+ @IPermissionService private readonly _permissionService: IPermissionService,
+ @ILogService private readonly _logService: ILogService
) {
this.id = this._workbook.getUnitId();
@@ -69,6 +71,16 @@ export class FWorkbook {
return snapshot;
}
+ /**
+ * @deprecated use 'save' instead.
+ * @return {*} {IWorkbookData}
+ * @memberof FWorkbook
+ */
+ getSnapshot(): IWorkbookData {
+ this._logService.warn(`use 'save' instead of 'getSnapshot'`);
+ return this.save();
+ }
+
/**
* Get the active sheet of the workbook.
* @returns The active sheet of the workbook