@vue/runtime-core
Advanced tools
Comparing version
@@ -306,3 +306,3 @@ import { camelize } from '@vue/shared'; | ||
export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string> extends LegacyOptions<Props, D, C, M, Mixin, Extends>, ComponentInternalOptions, ComponentCustomOptions { | ||
export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends>, ComponentInternalOptions, ComponentCustomOptions { | ||
setup?: (this: void, props: Props, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void; | ||
@@ -324,19 +324,20 @@ name?: string; | ||
__isSuspense?: never; | ||
__defaults?: Defaults; | ||
} | ||
export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>; | ||
export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>; | ||
export declare type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Props = Readonly<{ | ||
[key in PropNames]?: any; | ||
}>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE> & { | ||
}>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & { | ||
props: PropNames[]; | ||
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>; | ||
export declare type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Props = Readonly<ExtractPropTypes<PropsOptions>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE> & { | ||
export declare type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Props = Readonly<ExtractPropTypes<PropsOptions>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & { | ||
props: PropsOptions & ThisType<void>; | ||
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>; | ||
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false>>; | ||
export declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE> & { | ||
export declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Defaults = {}> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & { | ||
props?: undefined; | ||
} & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>; | ||
} & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false>>; | ||
@@ -348,6 +349,6 @@ export declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[]; | ||
D = {}, // return from data() | ||
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any>> = { | ||
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>> = { | ||
$: ComponentInternalInstance; | ||
$data: D; | ||
$props: P & PublicProps; | ||
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps; | ||
$attrs: Data; | ||
@@ -381,3 +382,3 @@ $refs: Data; | ||
declare type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>; | ||
export declare type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>; | ||
export { ComputedRef } | ||
@@ -420,3 +421,3 @@ | ||
declare type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E>>; | ||
declare type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults>>; | ||
@@ -475,2 +476,8 @@ export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer; | ||
declare type DefaultKeys<T> = { | ||
[K in keyof T]: T[K] extends { | ||
default: any; | ||
} ? K : never; | ||
}[keyof T]; | ||
export declare function defineAsyncComponent<T extends Component = { | ||
@@ -480,3 +487,3 @@ new (): ComponentPublicInstance; | ||
export declare type DefineComponent<PropsOrPropOptions = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string, PP = PublicProps, RequiredProps = Readonly<ExtractPropTypes<PropsOrPropOptions>>, OptionalProps = Readonly<ExtractPropTypes<PropsOrPropOptions, false>>> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<OptionalProps, RawBindings, D, C, M, Mixin, Extends, E, PP & OptionalProps> & RequiredProps> & ComponentOptionsBase<RequiredProps, RawBindings, D, C, M, Mixin, Extends, E, EE> & PP; | ||
export declare type DefineComponent<PropsOrPropOptions = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = Record<string, any>, EE extends string = string, PP = PublicProps, Props = Readonly<ExtractPropTypes<PropsOrPropOptions>>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & PP; | ||
@@ -524,3 +531,3 @@ export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>; | ||
declare type EmitsOptions = ObjectEmitsOptions | string[]; | ||
export declare type EmitsOptions = ObjectEmitsOptions | string[]; | ||
@@ -557,2 +564,6 @@ declare type EnsureNonVoid<T> = T extends void ? {} : T; | ||
export declare type ExtractDefaultPropTypes<O> = O extends object ? { | ||
[K in DefaultKeys<O>]: InferPropType<O[K]>; | ||
} : {}; | ||
declare type ExtractMixin<T> = { | ||
@@ -562,6 +573,6 @@ Mixin: MixinToOptionTypes<T>; | ||
export declare type ExtractPropTypes<O, MakeDefaultRequired extends boolean = true> = O extends object ? { | ||
[K in RequiredKeys<O, MakeDefaultRequired>]: InferPropType<O[K]>; | ||
export declare type ExtractPropTypes<O> = O extends object ? { | ||
[K in RequiredKeys<O>]: InferPropType<O[K]>; | ||
} & { | ||
[K in OptionalKeys<O, MakeDefaultRequired>]?: InferPropType<O[K]>; | ||
[K in OptionalKeys<O>]?: InferPropType<O[K]>; | ||
} : { | ||
@@ -622,3 +633,3 @@ [K in string]: any; | ||
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes): void; | ||
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void; | ||
@@ -748,7 +759,7 @@ export declare interface HMRRuntime { | ||
declare interface MethodOptions { | ||
export declare interface MethodOptions { | ||
[key: string]: Function; | ||
} | ||
declare type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never; | ||
declare type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never; | ||
@@ -797,3 +808,3 @@ declare type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean, start?: number) => void; | ||
declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>; | ||
export declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>; | ||
@@ -840,9 +851,9 @@ export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void; | ||
declare type OptionalKeys<T, MakeDefaultRequired> = Exclude<keyof T, RequiredKeys<T, MakeDefaultRequired>>; | ||
declare type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>; | ||
export declare type OptionMergeFunction = (to: unknown, from: unknown, instance: any, key: string) => any; | ||
declare type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M'; | ||
declare type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults'; | ||
declare type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}> = { | ||
declare type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = { | ||
P: P; | ||
@@ -853,2 +864,3 @@ B: B; | ||
M: M; | ||
Defaults: Defaults; | ||
}; | ||
@@ -1021,8 +1033,8 @@ | ||
declare type RequiredKeys<T, MakeDefaultRequired> = { | ||
declare type RequiredKeys<T> = { | ||
[K in keyof T]: T[K] extends { | ||
required: true; | ||
} | (MakeDefaultRequired extends true ? { | ||
} | { | ||
default: any; | ||
} : never) ? K : never; | ||
} ? K : never; | ||
}[keyof T]; | ||
@@ -1029,0 +1041,0 @@ |
{ | ||
"name": "@vue/runtime-core", | ||
"version": "3.0.0-rc.11", | ||
"version": "3.0.0-rc.12", | ||
"description": "@vue/runtime-core", | ||
@@ -35,5 +35,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.0-rc.11", | ||
"@vue/reactivity": "3.0.0-rc.11" | ||
"@vue/shared": "3.0.0-rc.12", | ||
"@vue/reactivity": "3.0.0-rc.12" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
797570
0.32%19747
0.21%177
0.57%+ Added
+ Added
- Removed
- Removed
Updated
Updated