import type { MudletMap } from '../mapIO'; import type { Command, NeighborEdit } from './types'; import type { SceneHandle } from './scene'; /** * Apply a command. When a `scene` is provided, mutations go through * `scene.reader` so the renderer stays in sync automatically. When it is * omitted (tests, etc.) we mutate the raw map directly — the caller is * responsible for triggering a rebuild. */ export declare function applyCommand(map: MudletMap, cmd: Command, scene?: SceneHandle | null): { structural: boolean; }; export declare function revertCommand(map: MudletMap, cmd: Command, scene?: SceneHandle | null): { structural: boolean; }; export declare function pushCommand(cmd: Command, scene?: SceneHandle | null): boolean; export declare function pushBatch(cmds: Command[], scene?: SceneHandle | null): boolean; export declare function undoOnce(scene?: SceneHandle | null): { changed: boolean; structural: boolean; }; export declare function redoOnce(scene?: SceneHandle | null): { changed: boolean; structural: boolean; }; /** Build setCustomLine commands that translate all waypoints of a room's custom lines by (dx, dy) in raw Mudlet space (y-up). */ export declare function buildCustomLineMoveCommands(map: MudletMap, roomId: number, dx: number, dy: number): Command[]; export declare function buildDeleteNeighborEdits(map: MudletMap, roomId: number): NeighborEdit[]; /** * Build commands that merge `selectedIds` into `keeperId` (which must be one of * them). Every exit — cardinal or special — that pointed at an absorbed room is * re-pointed to the keeper; outgoing exits the keeper lacks are copied onto it; * the absorbed rooms are then deleted. The keeper keeps its own position, name, * symbol, environment and other attributes. Returns an ordered command list * suitable for a single `batch` (fully undo-correct when reverted in reverse). * * Conflicts (keeper already has an exit in a direction a victim also uses) keep * the keeper's exit; the victim's competing exit is dropped. Stubs, doors, exit * weights and custom lines on absorbed rooms are not transferred. */ export declare function buildMergeRoomsCommands(map: MudletMap, keeperId: number, selectedIds: number[]): Command[]; /** O(n) version for batch deletion: one pass over all rooms, results for each deleted id. */ export declare function buildDeleteNeighborEditsForMany(map: MudletMap, ids: number[]): Map;