Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: implement prop types #203

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions StreamAwesome/src/components/IconCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { useFontsStatusStore } from '@/stores/fontStatus'

const fontStatusStore = useFontsStatusStore()
const iconCanvas = ref<HTMLCanvasElement | null>(null)
const props = defineProps({
icon: {
type: Object as () => CustomIcon
}
})
const props = defineProps<{
icon: CustomIcon
}>()

onMounted(() => {
waitForRequiredInitialization(createGenerator)
Expand Down
13 changes: 4 additions & 9 deletions StreamAwesome/src/components/browser/InputGroup.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<script setup lang="ts">
defineProps({
label: {
type: String
},
inputId: {
required: true,
type: String
}
})
defineProps<{
label: string
inputId: string
}>()
defineEmits<{
onInput: [inputValue: string]
}>()
Expand Down
8 changes: 3 additions & 5 deletions StreamAwesome/src/components/settings/GeneralOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import type { FontAwesomeIcon } from '@/model/fontAwesomeIcon'
import { fontAwesomeVersionInfo } from '@/model/versions'
import { reactive } from 'vue'

const props = defineProps({
icon: {
type: Object as () => CustomIcon
}
})
const props = defineProps<{
icon: CustomIcon
}>()

const currentIcon = reactive(props.icon ?? ({} as CustomIcon))

Expand Down
8 changes: 3 additions & 5 deletions StreamAwesome/src/components/settings/IconSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import type { CustomIcon } from '@/model/customIcon'
import PresetOptions from '@/components/settings/PresetOptions.vue'
import GeneralOptions from '@/components/settings/GeneralOptions.vue'
import DownloadButton from '@/components/settings/DownloadButton.vue'
defineProps({
icon: {
type: Object as () => CustomIcon
}
})

defineProps<{
icon: CustomIcon
}>()
defineEmits<{
downloadIcon: []
}>()
Expand Down
9 changes: 4 additions & 5 deletions StreamAwesome/src/components/settings/PresetOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import type { CustomIcon } from '@/model/customIcon'
import ElgatoClassic from '@/components/settings/presets/ElgatoClassic.vue'
import { ref } from 'vue'
defineProps({
icon: {
type: Object as () => CustomIcon
}
})

defineProps<{
icon: CustomIcon
}>()

// TODO: Move somewhere else in the refactoring of the model
const availablePresets = ['Elgato Classic', 'Other']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { reactive, ref } from 'vue'
import chroma from 'chroma-js'
import type { CustomIcon, ColorValue } from '@/model/customIcon'

const props = defineProps({
icon: {
type: Object as () => CustomIcon
}
})
const props = defineProps<{
icon: CustomIcon
}>()

const currentIcon = reactive(props.icon ?? ({} as CustomIcon))
const color = chroma(props.icon?.foregroundColor ?? '#000000')
Expand Down
9 changes: 3 additions & 6 deletions StreamAwesome/src/components/utils/IconDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
import type { FontAwesomeIcon } from '@/model/fontAwesomeIcon'
import { FontAwesomeIconType } from '@/model/fontAwesomeIconType'

const props = defineProps({
fontAwesomeIcon: {
required: true,
type: Object as () => FontAwesomeIcon
}
})
const props = defineProps<{
fontAwesomeIcon: FontAwesomeIcon
}>()
</script>

<template>
Expand Down