diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index bc6cedb5..75dd69fb 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -174,8 +174,11 @@ export { ComponentOptionsWithArrayProps, ComponentCustomOptions, ComponentOptionsBase, - RenderFunction + RenderFunction, + MethodOptions, + ComputedOptions } from './componentOptions' +export { EmitsOptions, ObjectEmitsOptions } from './componentEmits' export { ComponentPublicInstance, ComponentCustomProperties diff --git a/test-dts/defineComponent.test-d.tsx b/test-dts/defineComponent.test-d.tsx index 59d6a3bc..98f8018e 100644 --- a/test-dts/defineComponent.test-d.tsx +++ b/test-dts/defineComponent.test-d.tsx @@ -10,7 +10,8 @@ import { expectType, ComponentPublicInstance, ComponentOptions, - SetupContext + SetupContext, + h } from './index' describe('with object props', () => { @@ -900,3 +901,23 @@ describe('async setup', () => { // setup context properties should be mutable vm.a = 2 }) + +// check if defineComponent can be exported +export default { + // function components + a: defineComponent(_ => h('div')), + // no props + b: defineComponent({ + data() { + return {} + } + }), + c: defineComponent({ + props: ['a'] + }), + d: defineComponent({ + props: { + a: Number + } + }) +} diff --git a/test-dts/tsconfig.build.json b/test-dts/tsconfig.build.json index 0ed6e46e..6747eb10 100644 --- a/test-dts/tsconfig.build.json +++ b/test-dts/tsconfig.build.json @@ -1,10 +1,18 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "noEmit": false, "paths": { "@vue/*": ["../packages/*/dist"], "vue": ["../packages/vue/dist"] } }, - "exclude": ["../packages/*/__tests__", "../packages/*/src"] + "exclude": ["../packages/*/__tests__", "../packages/*/src"], + "include": [ + "../packages/global.d.ts", + "../packages/*/dist", + "../packages/runtime-dom/types/jsx.d.ts", + "../packages/*/__tests__", + "../test-dts" + ] }