diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index b188111ba28..faaeac2988e 100644 --- a/src/runtime/internal/lifecycle.ts +++ b/src/runtime/internal/lifecycle.ts @@ -36,6 +36,8 @@ type ExtractObjectValues> = Object[keyof Object] type ConstructDispatchFunction, EventKey extends keyof EventMap> = EventMap[EventKey] extends never ? (type: EventKey) => void + : undefined extends EventMap[EventKey] + ? (type: EventKey, detail?: EventMap[EventKey]) => void : (type: EventKey, detail: EventMap[EventKey]) => void type CreateDispatchFunctionMap = {