diff --git a/packages/dts-test/setupHelpers.test-d.ts b/packages/dts-test/setupHelpers.test-d.ts index 51f95c00944..2404d9bcc89 100644 --- a/packages/dts-test/setupHelpers.test-d.ts +++ b/packages/dts-test/setupHelpers.test-d.ts @@ -4,6 +4,7 @@ import { useAttrs, useSlots, withDefaults, + PropType, Slots, defineSlots, VNode, @@ -193,6 +194,26 @@ describe('defineProps w/ runtime declaration', () => { props2.baz }) +describe('defineProps w/ generics and runtime declarations', () => { + function test>() { + const props = defineProps({ + foo: { + type: Object as PropType, + required: false, + default: null, + }, + bar: { + type: Object as PropType, + required: true, + }, + }) + expectType(props.foo) + expectType(props.bar) + } + test() +}) + + describe('defineEmits w/ type declaration', () => { const emit = defineEmits<(e: 'change') => void>() emit('change')