You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Pick up the correct slot scope type from $slots (#540)
* fix: Pick up the correct slot scope type from `$slots`
See: #539 (comment)
* fix: fixed slots type edge cases
Co-authored-by: johnsoncodehk <[email protected]>
Copy file name to clipboardexpand all lines: packages/vscode-vue-languageservice/src/utils/globalDoc.ts
+7-2
Original file line number
Diff line number
Diff line change
@@ -79,8 +79,13 @@ declare global {
79
79
function __VLS_directiveFunction<T>(dir: T): T extends ObjectDirective<infer E, infer V> ? V extends { value: infer V_2 } ? (value: V_2) => void : (value: V) => void
80
80
: T extends FunctionDirective<infer E, infer V> ? V extends { value: infer V_2 } ? (value: V_2) => void : (value: V) => void : T;
81
81
82
-
function __VLS_getTemplateSlots<T>(t: T): T extends { __VLS_slots: infer S } ? S : {};
83
-
function __VLS_getScriptSlots<T>(t: T): T extends new (...args: any) => { $slots?: infer S } ? (S extends object ? S : {}) : {};
82
+
type __VLS_TemplateSlots<T> = T extends { __VLS_slots: infer S } ? S : {};
83
+
type __VLS_ScriptSlots<T> = T extends new (...args: any) => { $slots?: infer S }
84
+
? { [K in keyof S]: S[K] extends (obj: infer O) => any ? O : S[K] }
85
+
: {};
86
+
type __VLS_DefaultSlots<W, R> = W extends { __VLS_slots: infer _ }
87
+
? {} : R extends new (...args: any) => { $slots?: infer _ }
88
+
? {} : Record<string, any>;
84
89
85
90
type __VLS_GetComponentName<T, K extends string> = K extends keyof T ? IsAny<T[K]> extends false ? K : __VLS_GetComponentName_CamelCase<T, CamelCase<K>> : __VLS_GetComponentName_CamelCase<T, CamelCase<K>>;
86
91
type __VLS_GetComponentName_CamelCase<T, K extends string> = K extends keyof T ? IsAny<T[K]> extends false ? K : __VLS_GetComponentName_CapitalCase<T, Capitalize<K>> : __VLS_GetComponentName_CapitalCase<T, Capitalize<K>>;
0 commit comments