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.

feat: change command interfaces

Wenzhao Huf3548d6fbb2b
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index cb1c206f15..66bc1bc0b5 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -16,6 +16,7 @@ export {
type IMutation,
type IMutationInfo,
type IOperation,
+ type IOperationInfo,
sequenceExecute,
} from './services/command/command.service';
export { IConfigService } from './services/config/config.service';
diff --git a/packages/core/src/plugin/plugin.ts b/packages/core/src/plugin/plugin.ts
index fabbf0af68..c9d6af2cc6 100644
--- a/packages/core/src/plugin/plugin.ts
+++ b/packages/core/src/plugin/plugin.ts
@@ -14,7 +14,7 @@ export enum PluginType {
* Plug-in base class, all plug-ins must inherit from this base class. Provide basic methods.
*/
export abstract class Plugin {
- static type: PluginType;
+ static type: PluginType = PluginType.Univer;
protected abstract _injector: Injector;
diff --git a/packages/core/src/services/command/command.service.ts b/packages/core/src/services/command/command.service.ts
index 9d848242b3..b25e8107fa 100644
--- a/packages/core/src/services/command/command.service.ts
+++ b/packages/core/src/services/command/command.service.ts
@@ -86,6 +86,12 @@ export interface IMutationInfo<T extends object = object> {
params: T;
}
+export interface IOperationInfo<T extends object = object> {
+ id: string;
+ type?: CommandType.OPERATION;
+ params: T;
+}
+
export interface IExecutionOptions {
local?: boolean;
diff --git a/packages/ui-plugin-sheets/src/index.ts b/packages/ui-plugin-sheets/src/index.ts
index 8103fac111..4959c57c2e 100644
--- a/packages/ui-plugin-sheets/src/index.ts
+++ b/packages/ui-plugin-sheets/src/index.ts
@@ -1,6 +1,8 @@
export * from './basics';
export { getEditorObject } from './basics/editor/get-editor-object';
export { SetCellEditVisibleArrowOperation } from './commands/operations/cell-edit.operation';
+export { SetScrollOperation } from './commands/operations/scroll.operation';
+export { SetZoomRatioOperation } from './commands/operations/set-zoom-ratio.operation';
export { RangeSelector } from './components/range-selector/RangeSelector';
export { whenEditorInputFormulaActivated } from './controllers/shortcuts/utils';
export {