Files
image-studio/commands/command.ts
2026-07-04 15:49:13 +02:00

18 lines
419 B
TypeScript

import type { AppState } from "@editor/state";
export type CommandContext = {
state: AppState;
};
export type CommandHistoryPolicy =
| { mode: "auto" }
| { mode: "ignore" }
| { mode: "deferred"; phase: "begin" | "update" | "commit" };
export type Command<TPayload = void> = {
id: string;
name: string;
history?: CommandHistoryPolicy;
execute(context: CommandContext, payload: TPayload): AppState;
};