Started event handling

This commit is contained in:
Pax1601
2023-02-25 18:03:31 +01:00
parent abf5f40020
commit 93b1ac8f81
21 changed files with 140 additions and 310 deletions

29
client/src/@types/dom.d.ts vendored Normal file
View File

@@ -0,0 +1,29 @@
interface CustomEventMap {
"unitSelection": CustomEvent<Unit>,
"unitsSelection": CustomEvent<Unit[]>,
"clearSelection": CustomEvent<>,
"unitCreation": CustomEvent<Unit>,
"unitDeletion": CustomEvent<Unit>,
"unitUpdated": CustomEvent<Unit>,
"unitMoveCommand": CustomEvent<Unit>,
"unitAttackCommand": CustomEvent<Unit>,
"unitLandCommand": CustomEvent<Unit>,
"unitSetAltitudeCommand": CustomEvent<Unit>,
"unitSetSpeedCommand": CustomEvent<Unit>,
"unitSetROECommand": CustomEvent<Unit>,
"unitSetReactionToThreatCommand": CustomEvent<Unit>,
"groupCreation": CustomEvent<Unit[]>,
"groupDeletion": CustomEvent<Unit[]>,
"mapStateChanged": CustomEvent<string>,
"mapContextMenu": CustomEvent<>
}
declare global {
interface Document {
addEventListener<K extends keyof CustomEventMap>(type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void): void;
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K]): void;
}
}
export { };