added type definition

This commit is contained in:
2023-01-29 21:03:34 +09:00
parent 276d3528de
commit 497dfd720a
3 changed files with 18 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
import { invoke } from "@tauri-apps/api/tauri";
import AutoComplete from "simple-svelte-autocomplete";
import DisplayData from "./DisplayData.svelte";
import type { PokemonData } from "../model/PokemonStatus";
$: {
if (myValue > 0 && myValue !== currentValue) {
invoke("search", { index: myValue }).then((r) => {
@@ -11,7 +12,7 @@
});
}
pokemonStatus = {
types: pokemonData?.types ? pokemonData.types : [],
types: pokemonData?.types ? JSON.parse(pokemonData.types) : [],
terastype: terastype,
hp: hp_final,
atk: atk_final,
@@ -32,7 +33,7 @@
let spatk_final = 0;
let spdef_final = 0;
let spd_final = 0;
export let pokemonStatus = {
export let pokemonStatus: PokemonData = {
types: [],
terastype: [0],
hp: 0,