ComponentOptionsMixin,
EmitsOptions,
string,
- {},
VNodeProps & AllowedComponentProps & ComponentCustomProps,
Readonly<ExtractPropTypes<{}>>,
+ {},
{}
>
;<MyButton class="x" />
AllowedComponentProps &
ComponentCustomProps
+type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<
+ PropsOrPropOptions extends ComponentPropsOptions
+ ? ExtractPropTypes<PropsOrPropOptions>
+ : PropsOrPropOptions
+> &
+ ({} extends E ? {} : EmitsToProps<E>)
+
export type DefineComponent<
PropsOrPropOptions = {},
RawBindings = {},
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = {},
EE extends string = string,
- S extends SlotsType = {},
PP = PublicProps,
- Props = Readonly<
- PropsOrPropOptions extends ComponentPropsOptions
- ? ExtractPropTypes<PropsOrPropOptions>
- : PropsOrPropOptions
- > &
- ({} extends E ? {} : EmitsToProps<E>),
- Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>
+ Props = ResolveProps<PropsOrPropOptions, E>,
+ Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>,
+ S extends SlotsType = {}
> = ComponentPublicInstanceConstructor<
CreateComponentPublicInstance<
Props,
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
>
-): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, S>
+): DefineComponent<
+ Props,
+ RawBindings,
+ D,
+ C,
+ M,
+ Mixin,
+ Extends,
+ E,
+ EE,
+ PublicProps,
+ ResolveProps<Props, E>,
+ ExtractDefaultPropTypes<Props>,
+ S
+>
// overload 3: object format with array props declaration
// props inferred as { [key in PropNames]?: any }
EE extends string = string,
S extends SlotsType = {},
I extends ComponentInjectOptions = {},
- II extends string = string
+ II extends string = string,
+ Props = Readonly<{ [key in PropNames]?: any }>
>(
options: ComponentOptionsWithArrayProps<
PropNames,
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
>
): DefineComponent<
- Readonly<{ [key in PropNames]?: any }>,
+ Props,
RawBindings,
D,
C,
Extends,
E,
EE,
+ PublicProps,
+ ResolveProps<Props, E>,
+ ExtractDefaultPropTypes<Props>,
S
>
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
>
-): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, S>
+): DefineComponent<
+ PropsOptions,
+ RawBindings,
+ D,
+ C,
+ M,
+ Mixin,
+ Extends,
+ E,
+ EE,
+ PublicProps,
+ ResolveProps<PropsOptions, E>,
+ ExtractDefaultPropTypes<PropsOptions>,
+ S
+>
// implementation, close to no-op
export function defineComponent(
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = EmitsOptions,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
II extends string = string,
+ S extends SlotsType = {},
PE = Props & EmitsToProps<E>
> = ComponentOptionsBase<
PE,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = EmitsOptions,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
II extends string = string,
+ S extends SlotsType = {},
Props = Prettify<Readonly<{ [key in PropNames]?: any } & EmitsToProps<E>>>
> = ComponentOptionsBase<
Props,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = EmitsOptions,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
II extends string = string,
+ S extends SlotsType = {},
Props = Prettify<Readonly<ExtractPropTypes<PropsOptions> & EmitsToProps<E>>>,
Defaults = ExtractDefaultPropTypes<PropsOptions>
> = ComponentOptionsBase<
PublicC,
PublicM,
E,
- S,
PublicProps,
PublicDefaults,
MakeDefaultsOptional,
ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, S, Defaults>,
- I
+ I,
+ S
>
// public properties exposed on the proxy, which is used as the render context
C extends ComputedOptions = {},
M extends MethodOptions = {},
E extends EmitsOptions = {},
- S extends SlotsType = {},
PublicProps = P,
Defaults = {},
MakeDefaultsOptional extends boolean = false,
Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>,
- I extends ComponentInjectOptions = {}
+ I extends ComponentInjectOptions = {},
+ S extends SlotsType = {}
> = {
$: ComponentInternalInstance
$data: D
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = EmitsOptions,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
- II extends string = string
+ II extends string = string,
+ S extends SlotsType = {}
>(
options: ComponentOptionsWithoutProps<
Props,
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
> & { styles?: string[] }
): VueElementConstructor<Props>
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
- II extends string = string
+ II extends string = string,
+ S extends SlotsType = {}
>(
options: ComponentOptionsWithArrayProps<
PropNames,
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
> & { styles?: string[] }
): VueElementConstructor<{ [K in PropNames]: any }>
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
- S extends SlotsType = {},
I extends ComponentInjectOptions = {},
- II extends string = string
+ II extends string = string,
+ S extends SlotsType = {}
>(
options: ComponentOptionsWithObjectProps<
PropsOptions,
Extends,
E,
EE,
- S,
I,
- II
+ II,
+ S
> & { styles?: string[] }
): VueElementConstructor<ExtractPropTypes<PropsOptions>>