import type { MapEvent, EventCommand, EventPage, CreateMapParams, CreateMapV3Params, RpgMakerMap } from '../types/rpgmaker.js'; declare function loadTilesetFlags(projectPath: string, tilesetId: number): Promise; /** * Get map info for all maps in the project. * Reads MapInfos.json which contains the map tree structure * with names, order, and parent IDs. */ declare function getMapInfos(projectPath: string): Promise; /** * Get a single map by ID. * Reads the Map{NNN}.json file for the given map ID. * @param {string} projectPath - The project root path * @param {number} mapId - The map ID (e.g. 1 for Map001.json) */ declare function getMap(projectPath: string, mapId: number): Promise; /** * Get all events from a specific map. * Returns the events array from the map data (includes null at index 0). * @param {string} projectPath - The project root path * @param {number} mapId - The map ID */ declare function getMapEvents(projectPath: string, mapId: number): Promise<(MapEvent | null)[]>; declare function getMapEvent(projectPath: string, mapId: number, eventId: number): Promise; declare function getNextMapId(projectPath: string): Promise; /** * Create a new map with the specified dimensions and properties. * Also registers the map in MapInfos.json and generates a tile layout * if a theme is provided. * @param {string} projectPath - The project root path * @param {object} params - Map creation parameters */ declare function createMap(projectPath: string, params: CreateMapParams | CreateMapV3Params): Promise<{ mapId: number; map: RpgMakerMap; }>; declare function createMapV3(projectPath: string, params: CreateMapV3Params): Promise<{ mapId: number; seed: number; theme: string; interiorMapIds: number[]; spawn: { x: number; y: number; }; }>; /** * Create a new map from one of the bundled reference templates (knowledge/maps). * The template's tile data (and optionally its events) are copied into a brand-new * map file registered in MapInfos.json. */ declare function createMapFromTemplate(projectPath: string, params: Record): Promise<{ mapId: number; templateId: number; width: number; height: number; }>; declare function createMapBatch(projectPath: string, batchSpec: unknown[]): Promise<{ maps: unknown[]; mapIds: Record; }>; declare function connectMaps(projectPath: string, mapIdA: number, mapIdB: number, posA: Record, posB: Record): Promise<{ eventA: MapEvent; eventB: MapEvent; }>; declare function populateMapEvents(projectPath: string, mapId: number, eventType: string, count: number, opts: Record): Promise<{ added: unknown[]; mapId: number; }>; /** * Set a map's random-encounter list. Without this, generated dungeons/caves * have no enemies — encounterList stays [] and walking never triggers a battle. * Entries are shaped exactly as the engine reads them in * Game_Player.makeEncounterTroopId: { troopId, weight, regionSet }. * @param encounters - [{ troopId, weight?, regionSet? }] (weight default 5, * regionSet default [] = whole map). troopId must already exist. * @param encounterStep - average steps between battles (default keeps current/30) */ declare function setMapEncounters(projectPath: string, mapId: number, encounters: Record[], encounterStep?: number): Promise<{ mapId: number; encounterList: { troopId: number; weight: number; regionSet: any[]; }[]; encounterStep: number; }>; declare function setMapDisplayNames(projectPath: string, nameMap: Record[]): Promise<{ updated: unknown[]; skipped: unknown[]; }>; declare function organizeMapTree(projectPath: string, folderMap: Record[]): Promise<{ updated: unknown[]; }>; /** * Fill an entire layer of a map with tile data. * @param {string} projectPath - The project root path * @param {number} mapId - The map ID * @param {number} layer - Layer index (0-5) * @param {number} tileId - Tile ID to fill the layer with */ declare function fillMapLayer(projectPath: string, mapId: number, layer: number, tileId: number): Promise<{ mapId: number; layer: number; tileId: number; filled: number; }>; declare function fillMapRect(projectPath: string, mapId: number, layer: number, x1: number, y1: number, x2: number, y2: number, tileId: number): Promise<{ mapId: number; layer: number; x1: number; y1: number; x2: number; y2: number; tileId: number; filled: number; }>; declare function setMapTile(projectPath: string, mapId: number, layer: number, x: number, y: number, tileId: number): Promise<{ mapId: number; layer: number; x: number; y: number; tileId: number; }>; declare function replaceMapTile(projectPath: string, mapId: number, layer: number, oldTileId: number, newTileId: number): Promise<{ mapId: number; layer: number; oldTileId: number; newTileId: number; replaced: number; }>; declare function createMapEvent(projectPath: string, mapId: number, x: number, y: number, name: string, trigger: number, pages: EventPage[]): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: EventPage[]; }>; /** * Update an existing map event's properties (partial update). * @param {string} projectPath - The project root path * @param {number} mapId - The map ID * @param {number} eventId - The event ID to update * @param {object} fields - Fields to update */ declare function updateMapEvent(projectPath: string, mapId: number, eventId: number, fields: Partial): Promise; declare function addEventCommand(projectPath: string, mapId: number, eventId: number, pageIndex: number, command: EventCommand): Promise<{ eventId: number; pageIndex: number; command: EventCommand; totalCommands: number; }>; /** * HIGH LEVEL HELPER: Create an NPC with dialogue. * Produces a complete 2-page event: * Page 1: Action button trigger, character sprite, dialogue lines triggered by interaction * Page 2: Self-switch A condition (optional continuation) * * @param {string} projectPath - The project root path * @param {number} mapId - The map ID * @param {number} x - X position * @param {number} y - Y position * @param {string} name - NPC name * @param {string[]} dialogues - Array of dialogue strings (each becomes a message command) * @param {string} characterName - Character sprite filename * @param {number} characterIndex - Character sprite index (0-7) */ declare function createNpc(projectPath: string, mapId: number, x: number, y: number, name: string, dialogues: string[], characterName: string, characterIndex: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: EventCommand[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; /** * HIGH LEVEL HELPER: Create a chest event. * Produces a 2-page event: * Page 1: Action button trigger, gives items + activates Self Switch A * Page 2: Self Switch A = ON, shows "already opened" message * * @param {string} projectPath - The project root path * @param {number} mapId - The map ID * @param {number} x - X position * @param {number} y - Y position * @param {Array} items - Array of {type: "item"|"weapon"|"armor", id: number, amount: number} * @param {string} characterName - Chest sprite filename * @param {number} characterIndex - Chest sprite index */ declare function createChest(projectPath: string, mapId: number, x: number, y: number, items: Record[], characterName: string, characterIndex: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: EventCommand[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; /** * HIGH LEVEL HELPER: Create a teleport event. * Creates a single-page event that transfers the player to another map. * @param {string} projectPath - The project root path * @param {number} mapId - The current map ID * @param {number} x - X position on current map * @param {number} y - Y position on current map * @param {number} destMapId - Destination map ID * @param {number} destX - Destination X coordinate * @param {number} destY - Destination Y coordinate * @param {number} trigger - Trigger type (1=player touch for walk-on teleports, 0=action button for doors) */ declare function createTeleportEvent(projectPath: string, mapId: number, x: number, y: number, destMapId: number, destX: number, destY: number, trigger: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: EventCommand[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; /** * HIGH LEVEL HELPER: Create a door — an action-button warp into another map * (e.g. a house entrance). Unlike createTeleportEvent (a walk-on transfer * zone), a door is pressed to enter and can show a sprite and be locked. * * Without a lock it is a single page: face the door, press the action button, * transfer. With `lockedSwitchId` it gets two pages — page 1 (switch OFF) shows * a "locked" message; page 2 (switch ON) performs the transfer — so a key/quest * switch can gate it. * * @param destMapId/destX/destY - where the door leads (not validated) * @param opts - { characterName?, characterIndex?, trigger?, lockedSwitchId?, lockedMessage? } */ declare function createDoor(projectPath: string, mapId: number, x: number, y: number, destMapId: number, destX: number, destY: number, opts?: Record): Promise; /** * Search map events by name (case-insensitive). * @param {string} projectPath - The project root path * @param {number} mapId - The map ID * @param {string} query - Search term */ declare function searchMapEvents(projectPath: string, mapId: number, query: string): Promise; declare function deleteMapEvent(projectPath: string, mapId: number, eventId: number): Promise<{ deleted: MapEvent | null; }>; declare function duplicateMap(projectPath: string, sourceMapId: number, params: Record): Promise<{ mapId: number; map: RpgMakerMap; }>; declare function createShop(projectPath: string, mapId: number, x: number, y: number, name: string, goods: unknown[][], characterName: string, characterIndex: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: { code: number; indent: number; parameters: unknown[]; }[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; declare function createInn(projectPath: string, mapId: number, x: number, y: number, name: string, cost: number, characterName: string, characterIndex: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: EventCommand[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; /** * High-level authoring: turn an EXISTING event into a merchant / inn / sign, * preserving its identity (id, position, name) and sprite while replacing its * behaviour. Reuses the same audited command shapes as the create_* presets. * Roadmap #6 — "convert NPC into merchant" without re-placing the event. */ declare function convertEvent(projectPath: string, mapId: number, eventId: number, kind: string, options: Record): Promise<{ converted: boolean; kind: string; event: MapEvent; }>; declare function createBossEvent(projectPath: string, mapId: number, x: number, y: number, name: string, troopId: number, characterName: string, characterIndex: number): Promise<{ id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: EventCommand[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }>; declare function createPuzzleSwitch(projectPath: string, mapId: number, x: number, y: number, doorX: number, doorY: number, switchId: number, switchName?: string, doorName?: string): Promise<{ switchEvent: { id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: { code: number; indent: number; parameters: (string | number)[]; }[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }; doorEvent: { id: number; name: string; note: string; x: number; y: number; pages: { conditions: { actorId: number; actorValid: boolean; itemId: number; itemValid: boolean; selfSwitchCh: string; selfSwitchValid: boolean; switch1Id: number; switch1Valid: boolean; switch2Id: number; switch2Valid: boolean; variableId: number; variableValid: boolean; variableValue: number; } & { switch1Id: number; switch1Valid: boolean; }; directionFix: boolean; image: { characterIndex: number; characterName: string; direction: number; pattern: number; tileId: number; }; list: ({ code: number; indent: number; parameters: (number | { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; })[]; } | { code: number; indent: number; parameters: { code: number; parameters: never[]; }[]; } | { code: number; indent: number; parameters: (string | number)[]; })[]; moveFrequency: number; moveRoute: { list: { code: number; parameters: never[]; }[]; repeat: boolean; skippable: boolean; wait: boolean; }; moveSpeed: number; moveType: number; priorityType: number; stepAnime: boolean; through: boolean; trigger: number; walkAnime: boolean; }[]; }; }>; export { getMapInfos }; export { getMap }; export { loadTilesetFlags }; export { getMapEvents }; export { getMapEvent }; export { getNextMapId }; export { createMap }; export { createMapV3 }; export { createMapFromTemplate }; export { createMapBatch }; export { connectMaps }; export { populateMapEvents }; export { setMapEncounters }; export { fillMapLayer }; export { createMapEvent }; export { updateMapEvent }; export { addEventCommand }; export { createNpc }; export { createChest }; export { createTeleportEvent }; export { createDoor }; export { searchMapEvents }; export { deleteMapEvent }; export { duplicateMap }; export { createShop }; export { createInn }; export { convertEvent }; export { createBossEvent }; export { createPuzzleSwitch }; export { setMapDisplayNames }; export { organizeMapTree }; export { fillMapRect }; export { setMapTile }; export { replaceMapTile };