import type { IfAny } from '@vue/shared'; import type { ComponentObjectPropsOptions, Prop, PropType } from 'vue'; /** * Creates a factory function for props definitions. * This is used to define props in a composable then override * default values in an implementing component. * * @example Simplified signature * (props: Props) => (defaults?: Record) => Props * * @example Usage * const makeProps = propsFactory({ * foo: String, * }) * * defineComponent({ * props: { * ...makeProps({ * foo: 'a', * }), * }, * setup (props) { * // would be "string | undefined", now "string" because a default has been provided * props.foo * }, * } */ export declare function propsFactory(props: PropsOptions, source: string): = {}>(defaults?: Defaults) => AppendDefault; type AppendDefault> = { [P in keyof T]-?: unknown extends D[P] ? T[P] : T[P] extends Record ? Omit & { type: PropType>; default: MergeDefault; } : { type: PropType>; default: MergeDefault; }; }; type MergeTypeDefault> = unknown extends D ? P : (P | D); type MergeDefault> = unknown extends D ? P : (NonNullable

| D); /** * Like `Partial` but doesn't care what the value is */ type PartialKeys = { [P in keyof T]?: unknown; }; type InferPropType = [T] extends [null] ? any : [T] extends [{ type: null | true; }] ? any : [T] extends [ObjectConstructor | { type: ObjectConstructor; }] ? Record : [T] extends [BooleanConstructor | { type: BooleanConstructor; }] ? boolean : [T] extends [DateConstructor | { type: DateConstructor; }] ? Date : [T] extends [(infer U)[] | { type: (infer U)[]; }] ? U extends DateConstructor ? Date | InferPropType : InferPropType : [T] extends [Prop] ? unknown extends V ? IfAny : V : T;