import { DependencyNames } from "../types/DependencyNames"; import { Fn, HasAllPropsFn, IfThenFn, IntersectionFn, KeepNeversFn, OmitFn, Pipe, ReplaceFn, ToSchema } from "../types/Fn"; import { Hoc } from "../types/Hoc"; interface WithFactoryFn extends Fn { return: Pipe, [ IntersectionFn<[PropName, PropValue]>, KeepNeversFn> ]>, KeepNeversFn> ]>; } type WithFactoryHoc = = DependencyNames>(propName: PropName, factory: (props: DependencyProps) => PropValue, dependencyNames: TDependencyName) => Hoc<[WithFactoryFn>]>; /** * add value to a prop based on a function and/or other props * @see {@link withDefaults} {@link withDefault} {@link withOverride} {@link withOverrides} * @example * function Card({ content, icon, border }: { * content: string; * icon?: "star" | "heart" | ...; * }) { * return <>... * } * const StandardCard = withFactory<{content: string; icon?: Icon}>("icon", ({content, icon}) => content.includes("star") ? "star" : icon)(Card); * * * // is equivalent to * * * // and * * // is equivalent to * */ export declare const withFactory: WithFactoryHoc; export {}; //# sourceMappingURL=withFactory.d.ts.map