[web] Add types to properties

This commit is contained in:
Alain Nussbaumer 2024-02-27 17:18:58 +01:00
parent c94b905d72
commit ff8b8a0399
38 changed files with 77 additions and 52 deletions

View File

@ -33,7 +33,7 @@
<script> <script>
export default { export default {
name: 'ControlDropdown', name: 'ControlDropdown',
props: ['value', 'options'], props: { value: [String, Number], options: Array },
emits: ['update:value'], emits: ['update:value'],
data() { data() {

View File

@ -17,7 +17,7 @@
<script> <script>
export default { export default {
name: 'ControlSlider', name: 'ControlSlider',
props: ['value', 'max', 'disabled', 'cursor'], props: { value: Number, max: Number, disabled: Boolean, cursor: String },
emits: ['update:value'], emits: ['update:value'],
computed: { computed: {

View File

@ -13,7 +13,13 @@ import webapi from '@/webapi'
export default { export default {
name: 'CoverArtwork', name: 'CoverArtwork',
props: ['artist', 'album', 'artwork_url', 'maxwidth', 'maxheight'], props: {
artist: String,
album: String,
artwork_url: String,
maxwidth: Number,
maxheight: Number
},
emits: ['click'], emits: ['click'],
data() { data() {

View File

@ -77,7 +77,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ListAlbums', name: 'ListAlbums',
components: { CoverArtwork, ModalDialog, ModalDialogAlbum }, components: { CoverArtwork, ModalDialog, ModalDialogAlbum },
props: ['albums', 'media_kind', 'hide_group_title'], props: { albums: Object, media_kind: String, hide_group_title: Boolean },
emits: ['play-count-changed', 'podcast-deleted'], emits: ['play-count-changed', 'podcast-deleted'],
data() { data() {

View File

@ -39,8 +39,7 @@ import ModalDialogArtist from '@/components/ModalDialogArtist.vue'
export default { export default {
name: 'ListArtists', name: 'ListArtists',
components: { ModalDialogArtist }, components: { ModalDialogArtist },
props: { artists: Object, hide_group_title: Boolean },
props: ['artists', 'hide_group_title'],
data() { data() {
return { return {

View File

@ -40,7 +40,7 @@ import ModalDialogComposer from '@/components/ModalDialogComposer.vue'
export default { export default {
name: 'ListComposers', name: 'ListComposers',
components: { ModalDialogComposer }, components: { ModalDialogComposer },
props: ['composers', 'media_kind', 'hide_group_title'], props: { composers: Object, media_kind: String, hide_group_title: Boolean },
data() { data() {
return { return {

View File

@ -48,8 +48,7 @@ import ModalDialogDirectory from '@/components/ModalDialogDirectory.vue'
export default { export default {
name: 'ListDirectories', name: 'ListDirectories',
components: { ModalDialogDirectory }, components: { ModalDialogDirectory },
props: { directories: Array },
props: ['directories'],
data() { data() {
return { return {

View File

@ -40,8 +40,7 @@ import ModalDialogGenre from '@/components/ModalDialogGenre.vue'
export default { export default {
name: 'ListGenres', name: 'ListGenres',
components: { ModalDialogGenre }, components: { ModalDialogGenre },
props: { genres: Object, hide_group_title: Boolean, media_kind: String },
props: ['genres', 'hide_group_title', 'media_kind'],
data() { data() {
return { return {

View File

@ -25,7 +25,7 @@
<script> <script>
export default { export default {
name: 'ListItemAlbumSpotify', name: 'ListItemAlbumSpotify',
props: ['album'] props: { album: Object }
} }
</script> </script>

View File

@ -12,7 +12,7 @@
<script> <script>
export default { export default {
name: 'ListItemArtistSpotify', name: 'ListItemArtistSpotify',
props: ['artist'], props: { artist: Object },
methods: { methods: {
open_artist() { open_artist() {

View File

@ -13,7 +13,7 @@
<script> <script>
export default { export default {
name: 'ListItemPlaylistSpotify', name: 'ListItemPlaylistSpotify',
props: ['playlist'], props: { playlist: Object },
methods: { methods: {
open_playlist() { open_playlist() {

View File

@ -49,13 +49,13 @@ import webapi from '@/webapi'
export default { export default {
name: 'ListItemQueueItem', name: 'ListItemQueueItem',
props: [ props: {
'item', item: Object,
'position', position: Number,
'current_position', current_position: Number,
'show_only_next_items', show_only_next_items: Boolean,
'edit_mode' edit_mode: Boolean
], },
computed: { computed: {
state() { state() {

View File

@ -44,7 +44,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ListItemTrackSpotify', name: 'ListItemTrackSpotify',
props: ['track', 'position', 'context_uri'], props: { track: Object, position: Number, context_uri: String },
methods: { methods: {
play() { play() {
if (this.track.is_playable) { if (this.track.is_playable) {

View File

@ -32,8 +32,7 @@ import ModalDialogPlaylist from '@/components/ModalDialogPlaylist.vue'
export default { export default {
name: 'ListPlaylists', name: 'ListPlaylists',
components: { ModalDialogPlaylist }, components: { ModalDialogPlaylist },
props: { playlists: Object },
props: ['playlists'],
data() { data() {
return { return {

View File

@ -61,8 +61,13 @@ import webapi from '@/webapi'
export default { export default {
name: 'ListTracks', name: 'ListTracks',
components: { ModalDialogTrack }, components: { ModalDialogTrack },
props: {
props: ['tracks', 'uris', 'expression', 'show_progress', 'show_icon'], tracks: Object,
uris: String,
expression: String,
show_progress: Boolean,
show_icon: Boolean
},
emits: ['play-count-changed'], emits: ['play-count-changed'],
data() { data() {

View File

@ -49,7 +49,13 @@
<script> <script>
export default { export default {
name: 'ModalDialog', name: 'ModalDialog',
props: ['show', 'title', 'ok_action', 'delete_action', 'close_action'], props: {
show: Boolean,
title: String,
ok_action: String,
delete_action: String,
close_action: String
},
emits: ['delete', 'close', 'ok'] emits: ['delete', 'close', 'ok']
} }
</script> </script>

View File

@ -63,7 +63,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAddRss', name: 'ModalDialogAddRss',
props: ['show'], props: { show: Boolean },
emits: ['close', 'podcast-added'], emits: ['close', 'podcast-added'],
data() { data() {

View File

@ -69,7 +69,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAddUrlStream', name: 'ModalDialogAddUrlStream',
props: ['show'], props: { show: Boolean },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -120,7 +120,12 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAlbum', name: 'ModalDialogAlbum',
components: { CoverArtwork }, components: { CoverArtwork },
props: ['show', 'album', 'media_kind', 'new_tracks'], props: {
show: Boolean,
album: Object,
media_kind: String,
new_tracks: Array
},
emits: ['close', 'remove-podcast', 'play-count-changed'], emits: ['close', 'remove-podcast', 'play-count-changed'],
data() { data() {

View File

@ -94,7 +94,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogAlbumSpotify', name: 'ModalDialogAlbumSpotify',
components: { CoverArtwork }, components: { CoverArtwork },
props: ['show', 'album'], props: { show: Boolean, album: Object },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -69,7 +69,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogArtist', name: 'ModalDialogArtist',
props: ['show', 'artist'], props: { show: Boolean, artist: Object },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -75,7 +75,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogArtistSpotify', name: 'ModalDialogArtistSpotify',
props: ['show', 'artist'], props: { show: Boolean, artist: Object },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -71,7 +71,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogComposer', name: 'ModalDialogComposer',
props: ['show', 'composer'], props: { show: Boolean, composer: Object },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -42,7 +42,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogDirectory', name: 'ModalDialogDirectory',
props: ['show', 'directory'], props: { show: Boolean, directory: String },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -62,7 +62,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogGenre', name: 'ModalDialogGenre',
props: ['genre', 'media_kind', 'show'], props: { genre: Object, media_kind: String, show: Boolean },
emits: ['close'], emits: ['close'],
computed: { computed: {

View File

@ -68,7 +68,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogPlaylist', name: 'ModalDialogPlaylist',
props: ['show', 'playlist', 'uris'], props: { show: Boolean, playlist: Object, uris: String },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -71,7 +71,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogPlaylistSave', name: 'ModalDialogPlaylistSave',
props: ['show'], props: { show: Boolean },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -80,7 +80,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogPlaylistSpotify', name: 'ModalDialogPlaylistSpotify',
props: ['show', 'playlist'], props: { show: Boolean, playlist: Object },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -154,7 +154,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogQueueItem', name: 'ModalDialogQueueItem',
props: ['show', 'item'], props: { show: Boolean, item: Object },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -65,7 +65,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogRemotePairing', name: 'ModalDialogRemotePairing',
props: ['show'], props: { show: Boolean },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -185,8 +185,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogTrack', name: 'ModalDialogTrack',
props: { show: Boolean, track: Object },
props: ['show', 'track'],
emits: ['close', 'play-count-changed'], emits: ['close', 'play-count-changed'],
data() { data() {

View File

@ -110,7 +110,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogTrackSpotify', name: 'ModalDialogTrackSpotify',
props: ['show', 'track', 'album'], props: { show: Boolean, track: Object, album: Object },
emits: ['close'], emits: ['close'],
methods: { methods: {

View File

@ -55,7 +55,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'ModalDialogUpdate', name: 'ModalDialogUpdate',
components: { ModalDialog }, components: { ModalDialog },
props: ['show'], props: { show: Boolean },
emits: ['close'], emits: ['close'],
data() { data() {

View File

@ -47,7 +47,7 @@ export default {
components: { components: {
ControlSlider ControlSlider
}, },
props: ['output'], props: { output: Object },
data() { data() {
return { return {

View File

@ -26,7 +26,7 @@ import webapi from '@/webapi'
export default { export default {
name: 'SettingsCheckbox', name: 'SettingsCheckbox',
props: ['category_name', 'option_name'], props: { category_name: String, option_name: String },
data() { data() {
return { return {

View File

@ -32,7 +32,12 @@ import webapi from '@/webapi'
export default { export default {
name: 'SettingsIntfield', name: 'SettingsIntfield',
props: ['category_name', 'option_name', 'placeholder', 'disabled'], props: {
category_name: String,
option_name: String,
placeholder: String,
disabled: Boolean
},
data() { data() {
return { return {

View File

@ -31,8 +31,12 @@ import webapi from '@/webapi'
export default { export default {
name: 'SettingsTextfield', name: 'SettingsTextfield',
props: {
props: ['category_name', 'option_name', 'placeholder', 'disabled'], category_name: String,
option_name: String,
placeholder: String,
disabled: Boolean
},
data() { data() {
return { return {

View File

@ -38,8 +38,7 @@ import * as types from '@/store/mutation_types'
export default { export default {
name: 'TabsSearch', name: 'TabsSearch',
props: { query: String },
props: ['query'],
computed: { computed: {
spotify_enabled() { spotify_enabled() {