Skip to content

Commit

Permalink
remove fix, leave vue2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Jul 13, 2023
1 parent 2258f65 commit aa38535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/vue-language-core/src/utils/directorySharedTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VueCompilerOptions } from '../types';
import { getDefaultAllowedProps, getSlotsPropertyName } from './shared';
import { getSlotsPropertyName } from './shared';

export const baseName = '__VLS_types.d.ts';

Expand Down Expand Up @@ -87,7 +87,7 @@ type __VLS_EmitEvent<F, E> =
: unknown | '[Type Warning] Volar could not infer $emit event more than 4 overloads without DefineComponent. see https://github.com/vuejs/language-tools/issues/60';
declare function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
T extends new (...args: any) => any
? (props: (K extends { $props: infer Props } ? Props : any)${getDefaultAllowedProps(vueCompilerOptions.strictTemplates, vueCompilerOptions.target)}, ctx?: {
? (props: (K extends { $props: infer Props } ? Props : any)${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'}, ctx?: {
attrs?: any,
slots?: K extends { ${getSlotsPropertyName(vueCompilerOptions.target)}: infer Slots } ? Slots : any,
emit?: K extends { $emit: infer Emit } ? Emit : any
Expand Down
8 changes: 0 additions & 8 deletions packages/vue-language-core/src/utils/shared.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export function getSlotsPropertyName(vueVersion: number) {
return vueVersion < 3 ? '$scopedSlots' : '$slots';
}

export function getDefaultAllowedProps(strictTemplates: boolean, vueVersion: number) {
if (!strictTemplates) {
return ' & Record<string, unknown>';
}

return vueVersion < 3 ? ' & JSX.IntrinsicAttributes' : '';
}

0 comments on commit aa38535

Please sign in to comment.