From d11fb320a9991ad1c9264054886a5dee6be75a0c Mon Sep 17 00:00:00 2001 From: iwata hidetaka Date: Sat, 19 Sep 2020 09:37:29 +0900 Subject: [PATCH] fix(types): make enable to use tuple type as EmitsOptions (#2159) --- packages/runtime-core/src/componentEmits.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/componentEmits.ts b/packages/runtime-core/src/componentEmits.ts index 6418f8c7d5d..daf82b71e30 100644 --- a/packages/runtime-core/src/componentEmits.ts +++ b/packages/runtime-core/src/componentEmits.ts @@ -28,8 +28,8 @@ export type EmitsOptions = ObjectEmitsOptions | string[] export type EmitFn< Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options -> = Options extends any[] - ? (event: Options[0], ...args: any[]) => void +> = Options extends Array + ? (event: V, ...args: any[]) => void : {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function ? (event: string, ...args: any[]) => void : UnionToIntersection<