From 082abab6558145fc783784a0a8a061ff73c48f03 Mon Sep 17 00:00:00 2001 From: PINGUET Julien Date: Thu, 30 Nov 2023 14:37:05 +0100 Subject: [PATCH] fix(component-type-helpers): correct type inference for FunctionalComponent --- packages/component-type-helpers/index.d.ts | 4 ++-- packages/component-type-helpers/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/component-type-helpers/index.d.ts b/packages/component-type-helpers/index.d.ts index 0ce45dcf0d..033e56ce51 100644 --- a/packages/component-type-helpers/index.d.ts +++ b/packages/component-type-helpers/index.d.ts @@ -14,12 +14,12 @@ export type ComponentProps = export type ComponentSlots = T extends new () => { $slots: infer S; } ? NonNullable : - T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable : + T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable : {}; export type ComponentEmit = T extends new () => { $emit: infer E; } ? NonNullable : - T extends (props: any, ctx: { emit: infer E; }, ...args: any) => any ? NonNullable : + T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E; }, ...args: any) => any ? NonNullable : {}; export type ComponentExposed = diff --git a/packages/component-type-helpers/index.js b/packages/component-type-helpers/index.js index 49123c5d9c..90132268f3 100644 --- a/packages/component-type-helpers/index.js +++ b/packages/component-type-helpers/index.js @@ -13,12 +13,12 @@ export type ComponentProps = export type ComponentSlots = T extends new () => { $slots: infer S; } ? NonNullable : - T extends (props: any, ctx: { slots: infer S; }, ...args: any) => any ? NonNullable : + T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any; }, ...args: any) => any ? NonNullable : {}; export type ComponentEmit = T extends new () => { $emit: infer E; } ? NonNullable : - T extends (props: any, ctx: { emit: infer E; }, ...args: any) => any ? NonNullable : + T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E; }, ...args: any) => any ? NonNullable : {}; export type ComponentExposed =