Skip to content

Commit fb04e2c

Browse files
author
Yan Heng
committed
feat: 新增modified-object-cmd
1 parent 0b5c7fd commit fb04e2c

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './add-object-cmd';
22
export * from './remove-object-cmd';
3+
export * from './modified-object-cmd';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { App } from '@pictode/core';
2+
3+
import { Cmd } from '../types';
4+
5+
import { BaseCmd } from './base';
6+
7+
export class ModifiedObjectCmd extends BaseCmd<Cmd.ModifiedObjectOptions> {
8+
constructor(app: App, options: Cmd.ModifiedObjectOptions) {
9+
super(app, options);
10+
}
11+
12+
public execute(): void {
13+
if (!this.app || !this.options?.newObject) {
14+
return;
15+
}
16+
}
17+
18+
public undo(): void {
19+
throw new Error('Method not implemented.');
20+
}
21+
}
22+
23+
export default ModifiedObjectCmd;

packages/plugin-history/src/commands/remove-object-cmd.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Cmd } from '../types';
44

55
import { BaseCmd } from './base';
66

7-
export class RemoveObjectCmd extends BaseCmd<Cmd.RemoveObjectCmd> {
8-
constructor(app: App, options: Cmd.RemoveObjectCmd) {
7+
export class RemoveObjectCmd extends BaseCmd<Cmd.RemoveObjectOptions> {
8+
constructor(app: App, options: Cmd.RemoveObjectOptions) {
99
super(app, options);
1010
}
1111

packages/plugin-history/src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ export namespace Cmd {
4242
object: BaseFabricObject;
4343
}
4444

45-
export interface RemoveObjectCmd {
45+
export interface RemoveObjectOptions {
4646
object: BaseFabricObject;
4747
}
48+
49+
export interface ModifiedObjectOptions {
50+
oldObject: BaseFabricObject;
51+
newObject: BaseFabricObject;
52+
}
4853
}
4954

5055
export interface Options {

0 commit comments

Comments
 (0)