Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 8, 2022
1 parent e049772 commit 4c3203b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/apiDefineComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function defineComponent<
E extends EmitsOptions = {},
EE extends string = string,
I extends ComponentInjectOptions = {},
II extends string = string,
II extends string = string
>(
options: ComponentOptionsWithArrayProps<
PropNames,
Expand Down Expand Up @@ -180,7 +180,7 @@ export function defineComponent<
E extends EmitsOptions = {},
EE extends string = string,
I extends ComponentInjectOptions = {},
II extends string = string,
II extends string = string
>(
options: ComponentOptionsWithObjectProps<
PropsOptions,
Expand Down
38 changes: 26 additions & 12 deletions packages/runtime-core/src/componentOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export type ComponentOptionsWithoutProps<
EE extends string = string,
I extends ComponentInjectOptions = {},
II extends string = string,
PE = Props & EmitsToProps<E>,
PE = Props & EmitsToProps<E>
> = ComponentOptionsBase<
PE,
RawBindings,
Expand All @@ -246,7 +246,20 @@ export type ComponentOptionsWithoutProps<
> & {
props?: undefined
} & ThisType<
CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I>
CreateComponentPublicInstance<
PE,
RawBindings,
D,
C,
M,
Mixin,
Extends,
E,
PE,
{},
false,
I
>
>

export type ComponentOptionsWithArrayProps<
Expand Down Expand Up @@ -307,7 +320,7 @@ export type ComponentOptionsWithObjectProps<
I extends ComponentInjectOptions = {},
II extends string = string,
Props = Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>,
Defaults = ExtractDefaultPropTypes<PropsOptions>,
Defaults = ExtractDefaultPropTypes<PropsOptions>
> = ComponentOptionsBase<
Props,
RawBindings,
Expand Down Expand Up @@ -415,15 +428,16 @@ type ObjectInjectOptions = Record<
string | symbol | { from?: string | symbol; default?: unknown }
>

export type InjectToObject<T extends ComponentInjectOptions> = T extends string[]
? {
[K in T[number]]?: unknown
}
: T extends ObjectInjectOptions
? {
[K in keyof T]?: unknown
}
: never
export type InjectToObject<T extends ComponentInjectOptions> =
T extends string[]
? {
[K in T[number]]?: unknown
}
: T extends ObjectInjectOptions
? {
[K in keyof T]?: unknown
}
: never

interface LegacyOptions<
Props,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export type CreateComponentPublicInstance<
PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> &
EnsureNonVoid<M>,
PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> &
EnsureNonVoid<Defaults>,
EnsureNonVoid<Defaults>
> = ComponentPublicInstance<
PublicP,
PublicB,
Expand Down

0 comments on commit 4c3203b

Please sign in to comment.