summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/commands/base-command.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-31 22:53:16 +0200
committerMaze Winther <mazewinther@gmail.com>2026-03-31 22:53:16 +0200
commitf8fb238b228881ef970739b7d884912058b41347 (patch)
treee784085f29377242c5d1441ec46b397ada5170ef /apps/web/src/lib/commands/base-command.ts
parent0f5dca4f12d926ec0015116e85ec1129a6891f40 (diff)
downloadopencut-f8fb238b228881ef970739b7d884912058b41347.tar.gz
feat: centralize selection management
Diffstat (limited to 'apps/web/src/lib/commands/base-command.ts')
-rw-r--r--apps/web/src/lib/commands/base-command.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/web/src/lib/commands/base-command.ts b/apps/web/src/lib/commands/base-command.ts
index 66062c52..a8ce1d34 100644
--- a/apps/web/src/lib/commands/base-command.ts
+++ b/apps/web/src/lib/commands/base-command.ts
@@ -1,11 +1,17 @@
+import type { ElementRef } from "@/lib/timeline/types";
+
+export interface CommandResult {
+ select?: ElementRef[];
+}
+
export abstract class Command {
- abstract execute(): void;
+ abstract execute(): CommandResult | undefined;
undo(): void {
throw new Error("Undo not implemented for this command");
}
- redo(): void {
- this.execute();
+ redo(): CommandResult | undefined {
+ return this.execute();
}
}