From 708bdf2b49ff375f25c55531809921be82b672b6 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Wed, 4 Sep 2024 04:44:39 +0800 Subject: [PATCH 1/2] types(runtime-core): using intersection type in `Readonly<>` breaks JSDoc emit --- packages/runtime-core/src/componentOptions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/componentOptions.ts b/packages/runtime-core/src/componentOptions.ts index 2a39f45b685..f864f39e419 100644 --- a/packages/runtime-core/src/componentOptions.ts +++ b/packages/runtime-core/src/componentOptions.ts @@ -1279,7 +1279,9 @@ export type ComponentOptionsWithObjectProps< Directives extends Record = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, - Props = Prettify & EmitsToProps>>, + Props = Prettify< + Readonly> & Readonly> + >, Defaults = ExtractDefaultPropTypes, > = ComponentOptionsBase< Props, From e885b043e53510cbd84b3a9c3b98e8dacb8e0969 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Wed, 4 Sep 2024 04:59:18 +0800 Subject: [PATCH 2/2] Update apiDefineComponent.ts --- packages/runtime-core/src/apiDefineComponent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 760689eeb2e..520a2004534 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -210,7 +210,8 @@ export function defineComponent< : ExtractPropTypes : { [key in RuntimePropsKeys]?: any } : TypeProps, - ResolvedProps = Readonly>, + ResolvedProps = Readonly & + Readonly>, TypeRefs extends Record = {}, >( options: {