I have a number of components that I dynamically render via
and defineAsyncComponent()
. All these components have the same props, emit and defineExpose in common. How do I indicate this type of component in the main file with typescript without importing all of them?
Something like:
<template> <component ref="myCustomComponent" :is="rendereCustomComponent" v-bind="{ ...bindingProps }" /> <template> <script setup lang="ts"> export interface CommonProps {...} export interface CommonEmits {...} export interface CommonExposes {...} const myCustomComponent = ref<InstanceType<typeof Component<CommonProps, CommonEmits, CommonExposes>> | null>(null) script>
Thanks.