import type { Map } from '@/application/types' import { ref } from 'vue' const currentMap = ref(null) export function useMapEditorComposable() { const loadMap = (map: Map) => { currentMap.value = map } const updateProperty = (property: K, value: Map[K]) => { if (currentMap.value) { currentMap.value[property] = value } } const clearMap = () => { if (!currentMap.value) return currentMap.value.placedMapObjects = [] currentMap.value.mapEventTiles = [] currentMap.value.tiles = [] } return { currentMap, loadMap, updateProperty, clearMap } }