From b233cb6f6c48dfcb7214fa741fa32e528bbaf9e7 Mon Sep 17 00:00:00 2001 From: zhiyuanzmj <260480378@qq.com> Date: Wed, 13 Nov 2024 21:28:55 +0800 Subject: [PATCH 1/2] feat(jsx-runtime): make AllowedComponentProps & ComponentCustomProps extend IntrinsicAttributes closed #12384 --- packages/vue/jsx-runtime/index.d.ts | 13 +++++++++++-- packages/vue/jsx.d.ts | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/vue/jsx-runtime/index.d.ts b/packages/vue/jsx-runtime/index.d.ts index a52ac66a0df..4e646811094 100644 --- a/packages/vue/jsx-runtime/index.d.ts +++ b/packages/vue/jsx-runtime/index.d.ts @@ -1,5 +1,11 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ -import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom' +import type { + AllowedComponentProps, + ComponentCustomProps, + NativeElements, + ReservedProps, + VNode, +} from '@vue/runtime-dom' /** * JSX namespace for usage with @jsxImportsSource directive @@ -21,5 +27,8 @@ export namespace JSX { // @ts-ignore suppress ts:2374 = Duplicate string index signature. [name: string]: any } - export interface IntrinsicAttributes extends ReservedProps {} + export interface IntrinsicAttributes + extends ReservedProps, + AllowedComponentProps, + ComponentCustomProps {} } diff --git a/packages/vue/jsx.d.ts b/packages/vue/jsx.d.ts index 1fa1e326676..80328afb2be 100644 --- a/packages/vue/jsx.d.ts +++ b/packages/vue/jsx.d.ts @@ -1,7 +1,13 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ // global JSX namespace registration // somehow we have to copy=pase the jsx-runtime types here to make TypeScript happy -import type { NativeElements, ReservedProps, VNode } from '@vue/runtime-dom' +import type { + AllowedComponentProps, + ComponentCustomProps, + NativeElements, + PublicProps, + VNode, +} from '@vue/runtime-dom' declare global { namespace JSX { @@ -17,6 +23,9 @@ declare global { // @ts-ignore suppress ts:2374 = Duplicate string index signature. [name: string]: any } - export interface IntrinsicAttributes extends ReservedProps {} + export interface IntrinsicAttributes + extends ReservedProps, + AllowedComponentProps, + ComponentCustomProps {} } } From f5ef8aabb460395523b4da8fca59717a07511f9c Mon Sep 17 00:00:00 2001 From: zhiyuanzmj <260480378@qq.com> Date: Wed, 13 Nov 2024 21:49:58 +0800 Subject: [PATCH 2/2] fix: typo --- packages/vue/jsx.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue/jsx.d.ts b/packages/vue/jsx.d.ts index 80328afb2be..47f7e41ce11 100644 --- a/packages/vue/jsx.d.ts +++ b/packages/vue/jsx.d.ts @@ -5,7 +5,7 @@ import type { AllowedComponentProps, ComponentCustomProps, NativeElements, - PublicProps, + ReservedProps, VNode, } from '@vue/runtime-dom'