import { Fn, ToSchema } from "../types/Fn"; import { Hoc } from "../types/Hoc"; interface WithRenamesFn extends Fn { return: { [K in Extract[0]]: [ K extends T[1] ? Extract[0] : K, Extract[1] ]; }[Extract[0]]; } type WithRenamesHoc = >( /** * @example * function Box({ handleClick, handleHover }: { handleClick: () => void; handleHover: () => void }) { * ... * } * const NewBox = withRenames({ * onClick: "handleClick", * onMouseOver: "handleHover" * // ↑ oldProps goes to right * // ↑ newProps goes to left * })(Box); * {}} onMouseOver={() => {}} /> * // is equivalent to * {}} handleHover={() => {}} /> */ map: Map) => Hoc<[WithRenamesFn>]>; /** * Make your component receive new props by renaming them. * * @see {@link withRename} * @example * function Box({ handleClick, handleHover }: { handleClick: () => void; handleHover: () => void }) { * ... * } * const NewBox = withRenames({ * onClick: "handleClick", * onMouseOver: "handleHover" * // ↑ oldProps goes to right * // ↑ newProps goes to left * })(Box); * {}} onMouseOver={() => {}} /> * // is equivalent to * {}} handleHover={() => {}} /> */ export declare const withRenames: WithRenamesHoc; export {}; //# sourceMappingURL=withRenames.d.ts.map