I don't know how to type Svelte 3 reactive syntax variables.
<script lang="ts">
import type { Player, Team } from "./types";
import { DEFAULT_PLAYER } from "./utils";
$: player = DEFAULT_PLAYER as Player;
$: team = { search: "Real", players: [] } as Team;
</script>
But this doesn't work:
'Team' cannot be used as a value because it was imported using 'import type'.ts(1361)
If I use this instead:
$: team = ({ search: "Real", players: [] } as Team);
the VSCode extension svelte.svelte-vscode
format it like the first one when I save.
Is this my fault?
Is there a better way to cast those reactive vars?