import { HasAllPropsFn, IfThenFn, IntersectionFn, SetOptionalFn } from "../types/Fn"; import { Hoc } from "../types/Hoc"; type WithDefaultHoc = (propName: PropName, value: PropValue) => Hoc<[ IfThenFn, [ ...(PropValue extends (...args: any[]) => any ? [] : [IntersectionFn<[PropName, PropValue]>]), SetOptionalFn ]> ]>; /** * adds default value to a prop, so it can still receive a value but it now has a default one * @see {@link withDefaults} {@link withFactory} {@link withOverride} {@link withOverrides} * @example * function CardWithIcon({ content, icon }: { * content: string; * icon: "star" | "heart" | ...; * }) { * return <>... * } * const StandardCard = withDefault("icon", "star")(CardWithIcon); * * * // is equivalent to * * * // but * * // is equivalent to * // it propagates the new value */ export declare const withDefault: WithDefaultHoc; export {}; //# sourceMappingURL=withDefault.d.ts.map