[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>
export default {
name: 'ControlDropdown',
props: ['value', 'options'],
props: { value: [String, Number], options: Array },
emits: ['update:value'],
data() {

View File

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

View File

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

View File

@ -77,7 +77,7 @@ import webapi from '@/webapi'
export default {
name: 'ListAlbums',
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'],
data() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -49,7 +49,13 @@
<script>
export default {
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']
}
</script>

View File

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

View File

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

View File

@ -120,7 +120,12 @@ import webapi from '@/webapi'
export default {
name: 'ModalDialogAlbum',
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'],
data() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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