import type { MapRenderer, Settings } from 'mudlet-map-renderer'; import type { HitItem, Selection, ToolId } from './types'; import type { SceneHandle } from './scene'; export interface ToolContext { renderer: MapRenderer; container: HTMLElement; settings: Settings; refresh: () => void; scene: SceneHandle; } export interface Tool { id: ToolId; cursor?: string; onPointerDown?(ev: PointerEvent, ctx: ToolContext): boolean; onPointerMove?(ev: PointerEvent, ctx: ToolContext): boolean | void; onPointerUp?(ev: PointerEvent, ctx: ToolContext): boolean | void; onContextMenu?(ev: MouseEvent, ctx: ToolContext): boolean | void; onCancel?(ctx: ToolContext): void; } type PickSpecialExitCb = (roomId: number) => void; export declare function registerSpecialExitPickCb(cb: PickSpecialExitCb | null): void; /** Generic room-pick callback for `pending.kind === 'pickRoom'`. Receives the * clicked room id; the registrant reads `pending.target` to know which slot * asked. Unlike the special-exit pick, this does NOT reset the selection. */ type PickRoomCb = (roomId: number) => void; export declare function registerRoomPickCb(cb: PickRoomCb | null): void; /** * Combo tool: click a room to select it, drag to move it, click empty to clear selection. * Drag vs click is detected naturally — a drag only "moves" when the snapped cursor cell * differs from the room's current cell, so micro-jitter on a click doesn't trigger a move. */ export declare const selectTool: Tool; /** * Connect is a drag interaction. Pointer-down on a room picks the source; if * the cursor is near one of the 8 handle positions (corners + midpoints) the * source direction is fixed explicitly. Otherwise the direction is inferred * from the target on drop. */ export declare const connectTool: Tool; export declare const unlinkTool: Tool; export declare const addRoomTool: Tool; export declare const deleteTool: Tool; export declare const panTool: Tool; export declare const customLineTool: Tool; /** * Revert any raw mutations made during the in-progress draw. Safe to call even * when no raw write happened yet (restores / removes based on previousSnapshot). */ export declare function restorePendingCustomLine(pending: import('./types').PendingCustomLine, scene: SceneHandle): void; export declare function finishCustomLine(pending: import('./types').PendingCustomLine, _ctx?: ToolContext): void; export declare const addLabelTool: Tool; export declare function getActiveSwatch(s: import('./store').EditorState): import('./types').Swatch | null; export declare const paintTool: Tool; export declare const TOOLS: Record; export declare function hitToSelection(hit: HitItem): Selection; export declare function hitStatusLabel(hit: HitItem): string; export {};