I'm using Vue 3 and TS 4.4. I've got a component that defines its prop types with defineProps. When I add a call to defineEmits, VS Code starts telling me my props variable doesn't exist in the component template. Here's the source code:
<script setup lang="ts">
import { defineProps, defineEmits, VueElement, defineComponent } from "vue";
const emit = defineEmits<{
"update:checked": boolean;
}>();
const props = defineProps<{
label?: VueElement | string;
checked?: boolean;
}>();
</script>
<template>
<label>
<input
type="checkbox"
:checked="props.checked"
@change="(event) => emit('update:checked', (event.target as any)?.checked)"
/>
{{ props.label }}
</label>
</template>
And a couple of screenshots to better show what I'm seeing in VS Code. This is after adding defineEmits:
And this is without defineEmits:
What is the correct way to define types for both props and emits?

