import type { Room } from "./room/base.js"; import type { State } from "./state/state.js"; export interface ICommand { execute(state: S, room: Room): Promise; undo(state: S, room: Room): Promise; } export declare abstract class Command implements ICommand { /** * @ignore */ protected _subCommands: Command[]; private readonly _name; get name(): string; /** * @param name provide only if you're using `new Command()` syntax. * If you're extending command, just leave it empty - * the name will be grabbed from class name. */ constructor(name?: string); execute(state: S, room: Room>): Promise; /** * Undoes every remembered extra sub command. * `Command` may gather new sub commands only while executing. * `Sequence` will only gather sub commands upon construction. */ undo(state: S, room: Room): Promise; /** * Execute a sub command. * Call ONLY during your commands `execute` method. * Will also remember it internally for undoing. */ protected subExecute(state: S, room: Room, command: Command): Promise; } export type Targets = T | T[] | (() => T | T[]); export declare class TargetsHolder { private readonly value; constructor(value: Targets); get(): T[]; } export type Target = T | (() => T); export declare class TargetHolder { private readonly value; constructor(value: Target); get(): T; }