diff --git a/packages/runtime-core/src/apiSetupHelpers.ts b/packages/runtime-core/src/apiSetupHelpers.ts index 292b2f42..fc1866af 100644 --- a/packages/runtime-core/src/apiSetupHelpers.ts +++ b/packages/runtime-core/src/apiSetupHelpers.ts @@ -127,20 +127,21 @@ export function defineExpose(exposed?: Record) { type NotUndefined = T extends undefined ? never : T type InferDefaults = { - [K in keyof T]?: NotUndefined extends - | number - | string - | boolean - | symbol - | Function - ? NotUndefined - : (props: T) => NotUndefined + [K in keyof T]?: InferDefault> } -type PropsWithDefaults = Base & - { - [K in keyof Defaults]: K extends keyof Base ? NotUndefined : never - } +type InferDefault = T extends + | number + | string + | boolean + | symbol + | Function + ? T + : (props: P) => T + +type PropsWithDefaults = Base & { + [K in keyof Defaults]: K extends keyof Base ? NotUndefined : never +} /** * Vue `