More typescript

This commit is contained in:
2024-11-28 18:36:57 +01:00
parent faa17e87c9
commit afb9f106f9
4 changed files with 36 additions and 39 deletions

View File

@@ -1,13 +1,5 @@
<script setup lang="ts">
type ChampionResponse = {
data: Ref<Array<Champion>>
}
type Champion = {
name: string
alias: string
squarePortraitPath: string
}
const {data: championsData} : ChampionResponse = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
const {data: championsData} : ChampionsResponse = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
const champions = championsData.value.slice(1).sort((a, b) => {
if(a.name < b.name) return -1;
if(a.name > b.name) return 1;
@@ -46,9 +38,6 @@ function filterToLane(filter: number) {
function onLaneFilterChange(newValue: number) {
if(newValue != -1) {
filteredChampions.value = champions.filter((champion) => {
const lanes : Array<any> = lanesMap.get(champion.alias.toLowerCase())
if(lanes == undefined) return false;