import type { Project } from '../model/Project'; /** * An undoable edit of the project. Commands mutate the project in place and remember * whatever they need to revert. They validate first: `execute` throws a `CommandError` on * an invalid operation (e.g. placing a scene into a scene) before it changes anything. */ export interface Command { readonly label: string; execute(project: Project): void; undo(project: Project): void; } /** A rejected edit with a message fit for the user; the editor shows it as a notice. */ export class CommandError extends Error { constructor(message: string) { super(message); this.name = 'CommandError'; } }