Skip to content

Commit

Permalink
fix(language-core): remove misuse of JSX.Element
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Dec 26, 2023
1 parent 5849cad commit e792758
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-core/src/utils/globalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ declare function __VLS_asFunctionalComponent<T, K = T extends new (...args: any)
attrs?: any,
slots?: K extends { ${getSlotsPropertyName(vueCompilerOptions.target)}: infer Slots } ? Slots : any,
emit?: K extends { $emit: infer Emit } ? Emit : any
}) => JSX.Element & { __ctx?: typeof ctx & { props?: typeof props; expose?(exposed: K): void; } }
}) => __VLS_Element & { __ctx?: typeof ctx & { props?: typeof props; expose?(exposed: K): void; } }
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any ? T
: (_: {}${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'}, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {}${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'} } };
Expand Down
3 changes: 3 additions & 0 deletions test-workspace/tsc/core#9923/comp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script setup lang="ts">
defineProps<{ msg: string | ((count: number) => string) }>();
</script>
7 changes: 7 additions & 0 deletions test-workspace/tsc/core#9923/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup lang="ts">
import HelloWorld from './comp.vue';
</script>

<template>
<HelloWorld :msg="(count) => `Vite + Vue + ${count}`" />
</template>
7 changes: 7 additions & 0 deletions test-workspace/tsc/core#9923/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsxImportSource": "none",
},
"include": [ "**/*" ]
}

0 comments on commit e792758

Please sign in to comment.