@@ -8,6 +8,13 @@ export { ComponentPropsOptions } from './componentProps'
8
8
export type ComputedGetter < T > = ( ctx ?: any ) => T
9
9
export type ComputedSetter < T > = ( v : T ) => void
10
10
11
+ export type ObjectEmitsOptions = Record <
12
+ string ,
13
+ ( ( ...args : any [ ] ) => any ) | null
14
+ >
15
+
16
+ export type EmitsOptions = ObjectEmitsOptions | string [ ]
17
+
11
18
export interface WritableComputedOptions < T > {
12
19
get : ComputedGetter < T >
13
20
set : ComputedSetter < T >
@@ -63,7 +70,7 @@ export type ComponentOptionsWithProps<
63
70
Props = ExtractPropTypes < PropsOptions >
64
71
> = ComponentOptionsBase < Props , D , C , M > & {
65
72
props ?: PropsOptions
66
- emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
73
+ emits ?: ( EmitsOptions | string [ ] ) & ThisType < void >
67
74
setup ?: SetupFunction < Props , RawBindings >
68
75
} & ThisType < ComponentRenderProxy < Props , RawBindings , D , C , M > >
69
76
@@ -76,7 +83,7 @@ export type ComponentOptionsWithArrayProps<
76
83
Props = Readonly < { [ key in PropNames ] ?: any } >
77
84
> = ComponentOptionsBase < Props , D , C , M > & {
78
85
props ?: PropNames [ ]
79
- emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
86
+ emits ?: ( EmitsOptions | string [ ] ) & ThisType < void >
80
87
setup ?: SetupFunction < Props , RawBindings >
81
88
} & ThisType < ComponentRenderProxy < Props , RawBindings , D , C , M > >
82
89
@@ -88,7 +95,7 @@ export type ComponentOptionsWithoutProps<
88
95
M extends MethodOptions = { }
89
96
> = ComponentOptionsBase < Props , D , C , M > & {
90
97
props ?: undefined
91
- emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
98
+ emits ?: ( EmitsOptions | string [ ] ) & ThisType < void >
92
99
setup ?: SetupFunction < Props , RawBindings >
93
100
} & ThisType < ComponentRenderProxy < Props , RawBindings , D , C , M > >
94
101
0 commit comments