Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jsx-runtime): make AllowedComponentProps & ComponentCustomProps extend IntrinsicAttributes #12385

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/vue/jsx-runtime/index.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {}
}
13 changes: 11 additions & 2 deletions packages/vue/jsx.d.ts
Original file line number Diff line number Diff line change
@@ -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,
ReservedProps,
VNode,
} from '@vue/runtime-dom'

declare global {
namespace JSX {
Expand All @@ -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 {}
}
}