[TS] Fix ts-strict errors in Vue components (Part 1) (#3119)

This commit is contained in:
Chenlei Hu
2025-03-17 21:15:00 -04:00
committed by GitHub
parent 329bdff677
commit 2db29fc2af
17 changed files with 60 additions and 42 deletions

View File

@@ -12,11 +12,11 @@ import { Ref, onUnmounted, ref } from 'vue'
import { useTerminal } from '@/composables/bottomPanelTabs/useTerminal'
const emit = defineEmits<{
created: [ReturnType<typeof useTerminal>, Ref<HTMLElement>]
created: [ReturnType<typeof useTerminal>, Ref<HTMLElement | undefined>]
unmounted: []
}>()
const terminalEl = ref<HTMLElement>()
const rootEl = ref<HTMLElement>()
const terminalEl = ref<HTMLElement | undefined>()
const rootEl = ref<HTMLElement | undefined>()
emit('created', useTerminal(terminalEl), rootEl)
onUnmounted(() => emit('unmounted'))

View File

@@ -13,7 +13,7 @@ import BaseTerminal from './BaseTerminal.vue'
const terminalCreated = (
{ terminal, useAutoSize }: ReturnType<typeof useTerminal>,
root: Ref<HTMLElement>
root: Ref<HTMLElement | undefined>
) => {
const terminalApi = electronAPI().Terminal

View File

@@ -27,7 +27,7 @@ const loading = ref(true)
const terminalCreated = (
{ terminal, useAutoSize }: ReturnType<typeof useTerminal>,
root: Ref<HTMLElement>
root: Ref<HTMLElement | undefined>
) => {
// `autoCols` is false because we don't want the progress bar in the terminal
// to render incorrectly as the progress bar is rendered based on the