start project "move to typescript"

This commit is contained in:
geoffrey45
2022-03-14 21:05:58 +03:00
parent ead3a731ef
commit 33a9aa2c30
18 changed files with 48 additions and 41 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
</template>
<script setup>
import state from "@/composables/state.js";
import state from "@/composables/state";
const loading = state.loading
</script>
+17 -18
View File
@@ -60,17 +60,18 @@
</div>
</template>
<script setup>
import perks from "@/composables/perks.js";
import state from "@/composables/state.js";
<script setup lang="ts">
import perks from "../../composables/perks.js";
import state from "../../composables/state";
import useContextStore from "../../stores/context.js";
import { ref } from "vue";
import trackContext from "../../composables/track_context";
import { Track } from "../../interfaces.js";
const contextStore = useContextStore();
const context_on = ref(false);
const showContextMenu = (e) => {
const showContextMenu = (e: Event) => {
e.preventDefault();
e.stopPropagation();
@@ -84,23 +85,21 @@ const showContextMenu = (e) => {
});
};
const props = defineProps({
song: {
type: Object,
default: () => ({}),
},
index: {
type: Number,
default: () => 0,
},
});
const props = defineProps<{
song: Track;
index: Number;
}>();
const emit = defineEmits(["updateQeuue", "loadAlbum"]);
const emit = defineEmits<{
(e: "updateQueue", song: Track): void;
(e: "loadAlbum", album: string, artist: string): void;
}>();
function emitUpdate(song) {
emit("updateQueue", song);
function emitUpdate(track: Track) {
emit("updateQueue", track);
}
function emitLoadAlbum(title, artist) {
function emitLoadAlbum(title: string, artist: string) {
emit("loadAlbum", title, artist);
}